diff --git a/packages/skin-database/app/[[...folderName]]/page.tsx b/packages/skin-database/app/[[...folderName]]/page.tsx new file mode 100644 index 00000000..0e448683 --- /dev/null +++ b/packages/skin-database/app/[[...folderName]]/page.tsx @@ -0,0 +1,4 @@ +import App from "../../../skin-museum-client/src/App"; +export default function Page() { + return ; +} diff --git a/packages/skin-database/app/layout.tsx b/packages/skin-database/app/layout.tsx index 225b6038..9e9fbb43 100644 --- a/packages/skin-database/app/layout.tsx +++ b/packages/skin-database/app/layout.tsx @@ -1,3 +1,6 @@ +import ReduxContextProvider from "./redux"; +import { GoogleAnalytics } from "@next/third-parties/google"; + export default function RootLayout({ children, }: { @@ -5,7 +8,10 @@ export default function RootLayout({ }) { return ( - {children} + + {children} + + ); } diff --git a/packages/skin-database/app/page.tsx b/packages/skin-database/app/page.tsx deleted file mode 100644 index e85d5092..00000000 --- a/packages/skin-database/app/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function Page() { - return

Hello, Next.js!

; -} diff --git a/packages/skin-database/app/redux.tsx b/packages/skin-database/app/redux.tsx new file mode 100644 index 00000000..a64ba74a --- /dev/null +++ b/packages/skin-database/app/redux.tsx @@ -0,0 +1,23 @@ +"use client"; +import { Provider } from "react-redux"; +import { createStore } from "../../skin-museum-client/src/redux/store"; +import { useEffect, useState } from "react"; + +type Props = { + children: React.ReactNode; +}; + +export default function ReduxContextProvider({ children }: Props) { + const [store, setStore] = useState(null); + + // Store creation currently fails on the server, so we delay and only create + // the store on mount for now. + useEffect(() => { + const store = createStore(); + setStore(store); + }, []); + if (store == null) { + return null; + } + return {children}; +} diff --git a/packages/skin-database/package.json b/packages/skin-database/package.json index b31916eb..c1dc4a6d 100644 --- a/packages/skin-database/package.json +++ b/packages/skin-database/package.json @@ -4,6 +4,7 @@ "main": "index.js", "license": "MIT", "dependencies": { + "@next/third-parties": "^15.3.3", "@sentry/node": "^5.27.3", "@sentry/tracing": "^5.27.3", "algoliasearch": "^4.3.0", diff --git a/packages/skin-museum-client/src/App.js b/packages/skin-museum-client/src/App.js index bb228c50..de31553a 100644 --- a/packages/skin-museum-client/src/App.js +++ b/packages/skin-museum-client/src/App.js @@ -63,8 +63,8 @@ function App(props) { return (
- -
+ {props.next || } +
{props.uploadViewOpen || isDragActive ? ( 500) { - return ; + return ; } return ( - + {next || } }) ); -const loggingEpic = (actions, state) => - actions.pipe( - tap((action) => { - // ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]); - switch (action.type) { - case "CONCENTS_TO_NSFW": - case "DOES_NOT_CONCENT_TO_NSFW": - case "CLOSE_UPLOAD_FILES": - case "GOT_FILE_MD5": - case "ARCHIVED_SKIN": - case "TRY_TO_UPLOAD_FILE": - case "UPLOAD_FAILED": - case "STARTING_FILE_UPLOAD": - case "TRY_TO_UPLOAD_ALL_FILES": - case "INVALID_FILE_EXTENSION": - case "GOT_FILE": - case "GOT_MISSING_AND_FOUND_MD5S": - case "REQUESTED_RANDOM_SKIN": - case "MARK_NSFW": - case "INVALID_ARCHIVE": - case "SET_SCALE": - window.ga("send", "event", "redux", action.type); - break; - default: { - } - } - }), - ignoreElements() - ); - const urlEpic = (actions, state) => { return actions.pipe( map(() => Selectors.getUrl(state.value)), @@ -492,8 +462,6 @@ const urlEpic = (actions, state) => { const newUrl = proposedUrl.toString(); - window.ga("set", "page", newUrl); - window.history.replaceState({}, Selectors.getPageTitle(state), newUrl); }), ignoreElements() @@ -573,7 +541,6 @@ export default combineEpics( uploadSingleFileEpic, checkIfUploadsAreMissingEpic, urlEpic, - loggingEpic, skinDataEpic, markNsfwEpic, alertEpic diff --git a/yarn.lock b/yarn.lock index 8773bd31..cb5d13e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3728,6 +3728,13 @@ resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.3.3.tgz#c0e33e069d7922dd0546cac77a0247ad81d4a1aa" integrity sha512-4QZG6F8enl9/S2+yIiOiju0iCTFd93d8VC1q9LZS4p/Xuk81W2QDjCFeoogmrWWkAD59z8ZxepBQap2dKS5ruw== +"@next/third-parties@^15.3.3": + version "15.3.3" + resolved "https://registry.yarnpkg.com/@next/third-parties/-/third-parties-15.3.3.tgz#8637d3d9a8c1da4419f95cf74a97d171e7c44070" + integrity sha512-kwhDkK/3klTvW6SuNkmIMSqzEk9Rnc7PkpGeAi3x0mcbPJhFTwdC/qTEd/HZt53J2yFv73YohOBk6dUG3TEIkQ== + dependencies: + third-party-capital "1.0.20" + "@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": version "5.1.1-v1" resolved "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz" @@ -15390,16 +15397,11 @@ graphql-yoga@^5.10.10: lru-cache "^10.0.0" tslib "^2.8.1" -graphql@^16.8.1: +graphql@16.8.1, graphql@^16.8.1, graphql@^16.9.0: version "16.8.1" resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07" integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw== -graphql@^16.9.0: - version "16.10.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.10.0.tgz#24c01ae0af6b11ea87bf55694429198aaa8e220c" - integrity sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ== - grats@^0.0.31: version "0.0.31" resolved "https://registry.yarnpkg.com/grats/-/grats-0.0.31.tgz#f094786584a0f2fb345b38e6c37330d3f4f391cd" @@ -27526,6 +27528,11 @@ thenify-all@^1.0.0: dependencies: any-promise "^1.0.0" +third-party-capital@1.0.20: + version "1.0.20" + resolved "https://registry.yarnpkg.com/third-party-capital/-/third-party-capital-1.0.20.tgz#e218a929a35bf4d2245da9addb8ab978d2f41685" + integrity sha512-oB7yIimd8SuGptespDAZnNkzIz+NWaJCu2RMsbs4Wmp9zSDUM8Nhi3s2OOcqYuv3mN4hitXc8DVx+LyUmbUDiA== + throat@^6.0.1: version "6.0.2" resolved "https://registry.npmjs.org/throat/-/throat-6.0.2.tgz"