-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪄 [QA] Update stage environments (#566)
This is a pull request that upon merging will update stage environments with recent `main` changes. The environments that will be updated: * Stage live: https://stage-live--taho-development.netlify.app/ * Stage fork: https://stage-fork--taho-development.netlify.app/ Read more: [Deployment to Production Flow](https://github.com/tahowallet/dapp/blob/main/docs/testing-env.md)
- Loading branch information
Showing
12 changed files
with
165 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import React, { ReactNode, useEffect } from "react" | ||
import { | ||
Route, | ||
BrowserRouter as Router, | ||
Switch, | ||
useLocation, | ||
} from "react-router-dom" | ||
import { | ||
selectHasLoadedBalances, | ||
selectHasLoadedRealmData, | ||
selectHasLoadedSeasonInfo, | ||
selectIslandMode, | ||
useDappSelector, | ||
} from "redux-state" | ||
import FullPageLoader from "shared/components/FullPageLoader" | ||
import { | ||
useBalanceFetch, | ||
useConnect, | ||
useGameDataFetch, | ||
useGameLoadDataFetch, | ||
usePopulationFetch, | ||
useWallet, | ||
useWalletChange, | ||
useWalletOnboarding, | ||
} from "shared/hooks" | ||
import Onboarding from "ui/Onboarding" | ||
import IslandComponent from "ui/Island" | ||
import TestingPanel from "testing/components/TestingPanel" | ||
import Nav from "ui/Nav" | ||
import { ROUTES } from "shared/constants" | ||
import Claim from "ui/Claim" | ||
import Referrals from "ui/Referrals" | ||
import LiquidityPool from "ui/LiquidityPool" | ||
import Footer from "ui/Footer" | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { usePostHog } from "posthog-js/react" | ||
|
||
function TrackEvents({ children }: { children: ReactNode[] }) { | ||
const location = useLocation() | ||
const posthog = usePostHog() | ||
|
||
useEffect(() => { | ||
posthog?.capture("$pageview", { url: location.pathname }) | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []) | ||
|
||
return children | ||
} | ||
|
||
export default function DesktopDApp() { | ||
const islandMode = useDappSelector(selectIslandMode) | ||
const { isConnected } = useConnect() | ||
const { walletOnboarded } = useWalletOnboarding() | ||
|
||
const hasLoadedRealmData = useDappSelector(selectHasLoadedRealmData) | ||
const hasLoadedSeasonInfo = useDappSelector(selectHasLoadedSeasonInfo) | ||
const hasBalances = useDappSelector(selectHasLoadedBalances) | ||
|
||
useWallet() | ||
useGameLoadDataFetch() | ||
useBalanceFetch() | ||
usePopulationFetch() | ||
useGameDataFetch() | ||
useWalletChange() | ||
|
||
return ( | ||
<Router> | ||
{(!walletOnboarded || !isConnected) && <Onboarding />} | ||
{walletOnboarded && isConnected && ( | ||
<TrackEvents> | ||
<FullPageLoader | ||
loaded={hasLoadedRealmData && hasLoadedSeasonInfo && hasBalances} | ||
/> | ||
<IslandComponent /> | ||
<TestingPanel /> | ||
{islandMode === "default" && <Nav />} | ||
<Switch> | ||
<Route path={ROUTES.CLAIM.HOME}> | ||
<Claim /> | ||
</Route> | ||
<Route path={ROUTES.REFERRALS}> | ||
<Referrals /> | ||
</Route> | ||
{/* TODO should be removed or defined later */} | ||
<Route path={ROUTES.LP}> | ||
<LiquidityPool /> | ||
</Route> | ||
</Switch> | ||
<Footer /> | ||
</TrackEvents> | ||
)} | ||
</Router> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from "react" | ||
import MobileScreen from "ui/MobileScreen" | ||
|
||
export default function MobileDApp() { | ||
return <MobileScreen /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from "react" | ||
import { useMobileScreen } from "shared/hooks" | ||
import GlobalStyles from "ui/GlobalStyles" | ||
import MobileDApp from "./MobileDApp" | ||
import DesktopDApp from "./DesktopDApp" | ||
|
||
export default function DApp() { | ||
const isMobileScreen = useMobileScreen() | ||
|
||
return ( | ||
<> | ||
<GlobalStyles /> | ||
{isMobileScreen ? <MobileDApp /> : <DesktopDApp />} | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export const WEEKLY_XP_ALLOCATION = 1_000_000 | ||
export const MOBILE_BREAKPOINT = 854 // qHD width |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.