Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dApp: Hide <CurrentSeasonCard /> component behind feature flag #711

Merged
merged 10 commits into from
Aug 21, 2024
1 change: 1 addition & 0 deletions dapp/.env
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ VITE_FEATURE_FLAG_WITHDRAWALS_ENABLED="false"
VITE_FEATURE_FLAG_OKX_WALLET_ENABLED="false"
VITE_FEATURE_FLAG_XVERSE_WALLET_ENABLED="false"
VITE_FEATURE_FLAG_BEEHIVE_COMPONENT_ENABLED="false"
VITE_FEATURE_FLAG_TVL_ENABLED="false"

3 changes: 3 additions & 0 deletions dapp/src/constants/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ const WITHDRAWALS_ENABLED =
const BEEHIVE_COMPONENT_ENABLED =
import.meta.env.VITE_FEATURE_FLAG_BEEHIVE_COMPONENT_ENABLED === "true"

const TVL_ENABLED = import.meta.env.VITE_FEATURE_FLAG_TVL_ENABLED === "true"

const featureFlags = {
GAMIFICATION_ENABLED,
OKX_WALLET_ENABLED,
XVERSE_WALLET_ENABLED,
WITHDRAWALS_ENABLED,
BEEHIVE_COMPONENT_ENABLED,
TVL_ENABLED,
}

export default featureFlags
4 changes: 3 additions & 1 deletion dapp/src/pages/DashboardPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export default function DashboardPage() {
</PageLayoutColumn>

<PageLayoutColumn>
<CurrentSeasonCard showSeasonStats={false} />
{featureFlags.TVL_ENABLED && (
<CurrentSeasonCard showSeasonStats={false} />
)}
{/* TODO: Uncomment in post-launch phases */}
{/* <GrantedSeasonPassCard /> */}
{featureFlags.BEEHIVE_COMPONENT_ENABLED && <BeehiveCard />}
Expand Down
103 changes: 53 additions & 50 deletions dapp/src/pages/LandingPage/components/CurrentSeasonSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import {
CardBody,
Image,
} from "@chakra-ui/react"
// import ProgressBar from "#/components/shared/ProgressBar"
// import { CurrencyBalance } from "#/components/shared/CurrencyBalance"
import ProgressBar from "#/components/shared/ProgressBar"
import { CurrencyBalance } from "#/components/shared/CurrencyBalance"
import { H3, TextMd } from "#/components/shared/Typography"
// import { SEASON_CAP } from "#/constants"
import { featureFlags, SEASON_CAP } from "#/constants"
import { LiveTag } from "#/components/shared/LiveTag"
import { SeasonSectionBackground } from "#/components/shared/SeasonSectionBackground"
// import { useSeasonProgress } from "#/hooks"
import { useSeasonProgress } from "#/hooks"
import { mezoLogoColor } from "#/assets/images/partner-logos"

export default function CurrentSeasonSection() {
// const { progress: seasonProgress, value: seasonTotalAssets } =
// useSeasonProgress()
const { progress: seasonProgress, value: seasonTotalAssets } =
useSeasonProgress()

return (
<Box position="relative" mb={5}>
Expand Down Expand Up @@ -78,52 +78,55 @@ export default function CurrentSeasonSection() {
Season 1 stakers will soon be able to earn Acre and Mezo points.
</TextMd>

{/* TODO: Uncomment when TVL is higher */}
{/* <TextMd fontWeight="semibold" mb={4}>
Total value locked
</TextMd>
{featureFlags.TVL_ENABLED && (
<>
<TextMd fontWeight="semibold" mb={4}>
Total value locked
</TextMd>

<ProgressBar
size={{
base: "xl",
md: "2xl",
}}
value={seasonProgress}
maxW="50rem" // 800px
>
<CurrencyBalance
amount={seasonTotalAssets}
currency="bitcoin"
variant={{
base: "greater-balance-md",
md: "greater-balance-xl",
}}
symbolFontWeight="black"
desiredDecimals={2}
// TODO: Refactor `CurrencyBalance` to make font styles truely adjustable
/>
</ProgressBar>
<ProgressBar
size={{
base: "xl",
md: "2xl",
}}
value={seasonProgress}
maxW="50rem" // 800px
>
<CurrencyBalance
amount={seasonTotalAssets}
currency="bitcoin"
variant={{
base: "greater-balance-md",
md: "greater-balance-xl",
}}
symbolTextProps={{ fontWeight: "black" }}
desiredDecimals={2}
// TODO: Refactor `CurrencyBalance` to make font styles truely adjustable
/>
</ProgressBar>

<TextMd
fontSize={{ md: "xl" }}
lineHeight={{ md: "xl" }}
display="flex"
whiteSpace="pre"
mt={2}
mb={{
base: 10,
md: "7.5rem", // 120px
}}
>
Season 1 cap{" "}
<CurrencyBalance
as="span"
size={{ base: "", md: "xl" }}
amount={SEASON_CAP}
currency="bitcoin"
desiredDecimals={0}
/>
</TextMd> */}
<TextMd
fontSize={{ md: "xl" }}
lineHeight={{ md: "xl" }}
display="flex"
whiteSpace="pre"
mt={2}
mb={{
base: 10,
md: "7.5rem", // 120px
}}
>
Season 1 cap{" "}
<CurrencyBalance
as="span"
size={{ base: "", md: "xl" }}
amount={SEASON_CAP}
currency="bitcoin"
desiredDecimals={0}
/>
</TextMd>
</>
)}

{/* TODO: Uncomment in post-launch phases */}
{/* <Flex
Expand Down
1 change: 1 addition & 0 deletions dapp/src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface ImportMetaEnv {
readonly VITE_FEATURE_FLAG_OKX_WALLET_ENABLED: string
readonly VITE_FEATURE_FLAG_XVERSE_WALLET_ENABLED: string
readonly VITE_FEATURE_FLAG_BEEHIVE_COMPONENT_ENABLED: string
readonly VITE_FEATURE_FLAG_TVL_ENABLED: string
readonly VITE_SUBGRAPH_API_KEY: string
readonly VITE_MEZO_PORTAL_API_KEY: string
readonly VITE_LATEST_COMMIT_HASH: string
Expand Down
Loading