diff --git a/dapp/.env b/dapp/.env index 58e02204e..79f9dc9d6 100644 --- a/dapp/.env +++ b/dapp/.env @@ -23,7 +23,6 @@ VITE_FEATURE_FLAG_GAMIFICATION_ENABLED="false" 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_ACRE_POINTS_ENABLED="true" VITE_FEATURE_FLAG_TVL_ENABLED="true" VITE_FEATURE_GATING_DAPP_ENABLED="true" diff --git a/dapp/src/assets/icons/Info.tsx b/dapp/src/assets/icons/Info.tsx deleted file mode 100644 index 364e278d7..000000000 --- a/dapp/src/assets/icons/Info.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react" -import { createIcon } from "@chakra-ui/react" - -export const Info = createIcon({ - displayName: "Info", - viewBox: "0 0 20 20", - path: [ - , - , - ], -}) diff --git a/dapp/src/assets/icons/index.ts b/dapp/src/assets/icons/index.ts index 5cf9cd32a..7a8fe57c2 100644 --- a/dapp/src/assets/icons/index.ts +++ b/dapp/src/assets/icons/index.ts @@ -1,4 +1,3 @@ -export * from "./Info" export * from "./ArrowUpRight" export * from "./AcreLogo" export * from "./Pause" diff --git a/dapp/src/assets/images/mezo-bees.svg b/dapp/src/assets/images/mezo-bees.svg deleted file mode 100644 index 6ca70750b..000000000 --- a/dapp/src/assets/images/mezo-bees.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/dapp/src/components/ConnectWalletModal/ConnectWalletButton.tsx b/dapp/src/components/ConnectWalletModal/ConnectWalletButton.tsx index cff1fd58e..0747fdc8e 100644 --- a/dapp/src/components/ConnectWalletModal/ConnectWalletButton.tsx +++ b/dapp/src/components/ConnectWalletModal/ConnectWalletButton.tsx @@ -189,8 +189,9 @@ export default function ConnectWalletButton({ rounded="lg" mb={3} _last={{ mb: 0 }} + p={0} > - + - - + + + + + + + + Total collected mats from Mezo + + + + + {data && ( +
+ {numberToLocaleString(data.totalMats)} +
+ )} + +
diff --git a/dapp/src/pages/DashboardPage/DashboardCard.tsx b/dapp/src/pages/DashboardPage/DashboardCard.tsx index 2c676c020..ef1055de9 100644 --- a/dapp/src/pages/DashboardPage/DashboardCard.tsx +++ b/dapp/src/pages/DashboardPage/DashboardCard.tsx @@ -7,7 +7,7 @@ import PositionDetails from "./PositionDetails" export default function DashboardCard(props: CardProps) { return ( - + diff --git a/dapp/src/pages/DashboardPage/GrantedSeasonPassCard.tsx b/dapp/src/pages/DashboardPage/GrantedSeasonPassCard.tsx index 9fc48ff00..4e618844f 100644 --- a/dapp/src/pages/DashboardPage/GrantedSeasonPassCard.tsx +++ b/dapp/src/pages/DashboardPage/GrantedSeasonPassCard.tsx @@ -13,21 +13,15 @@ import UserDataSkeleton from "#/components/shared/UserDataSkeleton" export default function GrantedSeasonPassCard(props: CardProps) { return ( - + - - Season 2 arriving soon + + Season 2 arriving soon - + Your seat is secured. diff --git a/dapp/src/pages/DashboardPage/PositionDetails.tsx b/dapp/src/pages/DashboardPage/PositionDetails.tsx index 1e35966d0..c05c6163a 100644 --- a/dapp/src/pages/DashboardPage/PositionDetails.tsx +++ b/dapp/src/pages/DashboardPage/PositionDetails.tsx @@ -49,7 +49,8 @@ export default function PositionDetails() { return ( - + {/* TODO: Component should be moved to `CardHeader` */} + Your deposit {/* TODO: Uncomment when position will be implemented */} {/* {positionPercentage && ( diff --git a/dapp/src/pages/DashboardPage/TransactionHistory/TransactionTable.tsx b/dapp/src/pages/DashboardPage/TransactionHistory/TransactionTable.tsx index fd4fc94ec..a29242694 100644 --- a/dapp/src/pages/DashboardPage/TransactionHistory/TransactionTable.tsx +++ b/dapp/src/pages/DashboardPage/TransactionHistory/TransactionTable.tsx @@ -27,13 +27,8 @@ export default function TransactionTable() { {(pageData: Activity[]) => pageData.map((activity) => ( - - + + - - Transactions - + Transactions ) diff --git a/dapp/src/pages/DashboardPage/index.tsx b/dapp/src/pages/DashboardPage/index.tsx index 149d631f3..6f28092ec 100644 --- a/dapp/src/pages/DashboardPage/index.tsx +++ b/dapp/src/pages/DashboardPage/index.tsx @@ -12,11 +12,11 @@ import { AcreTVLProgress } from "./AcreTVLProgress" const TEMPLATE_AREAS = ` ${featureFlags.TVL_ENABLED ? '"tvl tvl"' : ""} "dashboard acre-points" - ${featureFlags.BEEHIVE_COMPONENT_ENABLED ? '"dashboard beehive"' : ""} + "dashboard beehive" "dashboard useful-links" ` -const GRID_TEMPLATE_ROWS = `${featureFlags.TVL_ENABLED ? "auto" : ""} ${featureFlags.BEEHIVE_COMPONENT_ENABLED ? "auto" : ""} auto 1fr` +const GRID_TEMPLATE_ROWS = `${featureFlags.TVL_ENABLED ? "auto" : ""} auto auto 1fr` export default function DashboardPage() { useTriggerConnectWalletModal() @@ -45,9 +45,7 @@ export default function DashboardPage() { )} - {featureFlags.BEEHIVE_COMPONENT_ENABLED && ( - - )} + ) } diff --git a/dapp/src/theme/Card.ts b/dapp/src/theme/Card.ts index c117b2550..dc2873d4b 100644 --- a/dapp/src/theme/Card.ts +++ b/dapp/src/theme/Card.ts @@ -1,40 +1,29 @@ -import { ComponentMultiStyleConfig, StyleFunctionProps } from "@chakra-ui/react" +import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react" import { cardAnatomy as parts } from "@chakra-ui/anatomy" -export const cardTheme: ComponentMultiStyleConfig = { - baseStyle: { - container: { - boxShadow: "none", - borderColor: "gold.100", - bg: "gold.200", - }, - }, - parts: parts.keys, - variants: { - elevated: ({ colorScheme }: StyleFunctionProps) => { - if (!colorScheme) return {} +const multiStyleConfig = createMultiStyleConfigHelpers(parts.keys) - return { - container: { - bg: "gold.100", - borderColor: "white", - }, - } - }, - }, - sizes: { - md: { - container: { - borderWidth: "1px", - }, - }, - lg: { - container: { - borderWidth: "2px", - }, - }, - }, - defaultProps: { - size: "lg", - }, -} +const baseStyleContainer = defineStyle({ + boxShadow: "none", + bg: "gold.200", + borderRadius: "xl", + p: 5, +}) + +const baseStyleHeader = defineStyle({ + p: 0, +}) + +const baseStyleBody = defineStyle({ + p: 0, +}) + +const baseStyle = multiStyleConfig.definePartsStyle({ + container: baseStyleContainer, + header: baseStyleHeader, + body: baseStyleBody, +}) + +export const cardTheme = multiStyleConfig.defineMultiStyleConfig({ + baseStyle, +}) diff --git a/dapp/src/theme/Tooltip.ts b/dapp/src/theme/Tooltip.ts index 01802f399..922d31fd6 100644 --- a/dapp/src/theme/Tooltip.ts +++ b/dapp/src/theme/Tooltip.ts @@ -1,7 +1,8 @@ import { - ComponentSingleStyleConfig, Tooltip as ChakraTooltip, cssVar, + defineStyle, + defineStyleConfig, } from "@chakra-ui/react" // Currently, there is no possibility to set all tooltips with hasArrow by @@ -14,12 +15,36 @@ ChakraTooltip.defaultProps = { ...ChakraTooltip.defaultProps, hasArrow: true } // https://github.com/chakra-ui/chakra-ui/issues/4695#issuecomment-991023319 const $arrowBg = cssVar("popper-arrow-bg") -export const tooltipTheme: ComponentSingleStyleConfig = { - baseStyle: { - borderRadius: "md", - bg: "grey.700", - [$arrowBg.variable]: "colors.grey.700", - py: 2, - px: 3, - }, +const baseStyle = defineStyle({ + color: "gold.100", + bg: "grey.700", + [$arrowBg.variable]: "colors.grey.700", +}) + +const sizeXs = defineStyle({ + px: 2, + py: 1, + fontSize: "xs", + lineHeight: "xs", + borderRadius: "base", +}) + +const sizeSm = defineStyle({ + p: 3, + fontSize: "sm", + lineHeight: "sm", + borderRadius: "lg", +}) + +const sizes = { + xs: sizeXs, + sm: sizeSm, } + +export const tooltipTheme = defineStyleConfig({ + defaultProps: { + size: "sm", + }, + baseStyle, + sizes, +}) diff --git a/dapp/src/theme/utils/colors.ts b/dapp/src/theme/utils/colors.ts index 06c04c8e7..47a25f093 100644 --- a/dapp/src/theme/utils/colors.ts +++ b/dapp/src/theme/utils/colors.ts @@ -84,4 +84,5 @@ export const colors = { 30: "#FF7A00", 50: "#FFB76E", }, + mezo: "#FF004D", } diff --git a/dapp/src/utils/acreApi.ts b/dapp/src/utils/acreApi.ts index 694085473..8eec8b2bb 100644 --- a/dapp/src/utils/acreApi.ts +++ b/dapp/src/utils/acreApi.ts @@ -37,6 +37,7 @@ async function deleteSession() { type PointsDataResponse = { dropAt: number isCalculationInProgress: boolean + totalPool: string } const getPointsData = async () => { @@ -46,6 +47,7 @@ const getPointsData = async () => { return { dropAt: response.data.dropAt, isCalculationInProgress: response.data.isCalculationInProgress, + totalPool: Number(response.data.totalPool), } } diff --git a/dapp/src/utils/orangekit/ledger-live/bitcoin-provider.ts b/dapp/src/utils/orangekit/ledger-live/bitcoin-provider.ts index 5ed054a88..7dab9c5ad 100644 --- a/dapp/src/utils/orangekit/ledger-live/bitcoin-provider.ts +++ b/dapp/src/utils/orangekit/ledger-live/bitcoin-provider.ts @@ -48,6 +48,16 @@ function tryRequest(): TryRequestFn { } } +function numberToValidHexString(value: number): string { + let hex = value.toString(16) + + if (hex.length % 2 !== 0) { + hex = `0${hex}` + } + + return `0x${hex}` +} + export type AcreLedgerLiveBitcoinProviderOptions = { tryConnectToAddress: string | undefined } @@ -273,7 +283,7 @@ export default class AcreLedgerLiveBitcoinProvider message: { ...data, operation: data.operation.toString(), - nonce: data.nonce.toString(), + nonce: numberToValidHexString(data.nonce), }, }) } diff --git a/dapp/src/utils/orangekit/ledger-live/tests/bitcoin-provider.test.ts b/dapp/src/utils/orangekit/ledger-live/tests/bitcoin-provider.test.ts index 80f782406..58d1d0f89 100644 --- a/dapp/src/utils/orangekit/ledger-live/tests/bitcoin-provider.test.ts +++ b/dapp/src/utils/orangekit/ledger-live/tests/bitcoin-provider.test.ts @@ -32,7 +32,7 @@ describe("AcreLedgerLiveBitcoinProvider", () => { gasToken: ZeroAddress, refundReceiver: ZeroAddress, operation: 1, - nonce: 1, + nonce: 12, } const mockedWalletApiClient = { @@ -155,6 +155,7 @@ describe("AcreLedgerLiveBitcoinProvider", () => { const mockedPublicKey = "033b37d8b5dda991cdeb628c28c7958cf9d7bc61dfde29357b8a7190b9b3295423" const signInMessage = "test" + const expectedNonceAsHex = "0x0c" const messageTypesData = [ { @@ -164,7 +165,7 @@ describe("AcreLedgerLiveBitcoinProvider", () => { messageData: { ...withdrawalData, operation: withdrawalData.operation.toString(), - nonce: withdrawalData.nonce.toString(), + nonce: expectedNonceAsHex, }, }, { diff --git a/dapp/src/vite-env.d.ts b/dapp/src/vite-env.d.ts index 890b327f9..53f7175b8 100644 --- a/dapp/src/vite-env.d.ts +++ b/dapp/src/vite-env.d.ts @@ -11,7 +11,6 @@ interface ImportMetaEnv { readonly VITE_FEATURE_FLAG_WITHDRAWALS_ENABLED: string 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_ACRE_POINTS_ENABLED: string readonly VITE_FEATURE_FLAG_TVL_ENABLED: string readonly VITE_FEATURE_GATING_DAPP_ENABLED: string