Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
YHhaoareyou committed Mar 29, 2022
2 parents 4cc5b89 + 68a7299 commit bc8ecd7
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 351 deletions.
8 changes: 4 additions & 4 deletions root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
"workbox-webpack-plugin": "6.5.1"
},
"dependencies": {
"@aws-amplify/auth": "4.4.4",
"@aws-amplify/core": "4.4.0",
"@aws-amplify/auth": "4.5.0",
"@aws-amplify/core": "4.5.0",
"@bit/wasedatime.core.assets.text-logo": "0.0.1",
"@bit/wasedatime.core.theme.colors": "0.0.4",
"@bit/wasedatime.core.ts.constants.langs": "0.0.5",
Expand All @@ -88,10 +88,10 @@
"@bit/wasedatime.core.ts.ui.loading-spinner": "0.1.2",
"@bit/wasedatime.core.ts.ui.logo": "0.0.9",
"@bit/wasedatime.core.ts.ui.modal": "0.0.8",
"@bit/wasedatime.core.ts.ui.sign-in-modal": "0.1.3",
"@bit/wasedatime.core.ts.ui.sign-in-modal": "0.1.4",
"@bit/wasedatime.core.ts.utils.i18n": "0.0.4",
"@bit/wasedatime.core.ts.utils.responsive-utils": "0.0.1",
"@bit/wasedatime.core.ts.utils.user": "0.0.3",
"@bit/wasedatime.core.ts.utils.user": "0.0.4",
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
"@fortawesome/fontawesome-svg-core": "1.3.0",
Expand Down
193 changes: 74 additions & 119 deletions root/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 32 additions & 31 deletions root/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ErrorBoundary } from "@sentry/react";
import ReactGA from "react-ga";
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
import { BrowserRouter, Routes, Route, useNavigate } from "react-router-dom";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import { navigateToUrl } from "single-spa";

import CommonStyle from "@app/common-style";
Expand Down Expand Up @@ -37,36 +37,37 @@ const Redirect = ({ to }: { to: string }) => {
};

const AppRoutes = () => {
const navigate = useNavigate();

Hub.listen("auth", ({ payload: { event, data } }) => {
switch (event) {
case "signIn":
ReactGA.event({
category: gaUser,
action: gaUserSignIn,
});
break;
case "signOut":
ReactGA.event({
category: gaUser,
action: gaUserSignOut,
});
break;
case "signIn_failure":
ReactGA.event({
category: gaUser,
action: gaUserSignInFailure,
});
break;
case "customOAuthState":
navigate(data);
break;
default:
break;
}
});

useEffect(() => {
const unsubscribe = Hub.listen("auth", ({ payload: { event, data } }) => {
switch (event) {
case "signIn":
ReactGA.event({
category: gaUser,
action: gaUserSignIn,
});
break;
case "signOut":
ReactGA.event({
category: gaUser,
action: gaUserSignOut,
});
break;
case "signIn_failure":
ReactGA.event({
category: gaUser,
action: gaUserSignInFailure,
});
break;
case "customOAuthState":
window.location.pathname = data;
break;
default:
break;
}
});
return unsubscribe;
}, []);

return (
<Routes>
<Route element={<TermsOfService />} path="/terms-of-service" />
Expand Down
Loading

0 comments on commit bc8ecd7

Please sign in to comment.