Commit 62423eec authored by tom's avatar tom

fix hero banner

parent 2a51f536
import type { ThemingConfig } from '@chakra-ui/react'; import type { ThemingConfig } from '@chakra-ui/react';
import config from 'configs/app';
const heroBannerButton = config.UI.homepage.heroBanner?.button;
const semanticTokens: ThemingConfig['semanticTokens'] = { const semanticTokens: ThemingConfig['semanticTokens'] = {
// TODO @tom2drum remove *_hover in favor of conditional selectors // TODO @tom2drum remove *_hover in favor of conditional selectors
colors: { colors: {
...@@ -34,6 +38,48 @@ const semanticTokens: ThemingConfig['semanticTokens'] = { ...@@ -34,6 +38,48 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
DEFAULT: { value: { _light: '{colors.gray.300}', _dark: '{colors.gray.600}' } }, DEFAULT: { value: { _light: '{colors.gray.300}', _dark: '{colors.gray.600}' } },
}, },
}, },
hero: {
bg: {
DEFAULT: {
value: {
_light: heroBannerButton?._default?.background?.[0] || '{colors.blue.600}',
_dark: heroBannerButton?._default?.background?.[1] || heroBannerButton?._default?.background?.[0] || '{colors.blue.600}',
},
},
hover: {
value: {
_light: heroBannerButton?._hover?.background?.[0] || '{colors.blue.400}',
_dark: heroBannerButton?._hover?.background?.[1] || heroBannerButton?._hover?.background?.[0] || '{colors.blue.400}',
},
},
selected: {
value: {
_light: heroBannerButton?._selected?.background?.[0] || '{colors.blue.50}',
_dark: heroBannerButton?._selected?.background?.[1] || heroBannerButton?._selected?.background?.[0] || '{colors.blue.50}',
},
},
},
fg: {
DEFAULT: {
value: {
_light: heroBannerButton?._default?.text_color?.[0] || '{colors.white}',
_dark: heroBannerButton?._default?.text_color?.[1] || heroBannerButton?._default?.text_color?.[0] || '{colors.white}',
},
},
hover: {
value: {
_light: heroBannerButton?._hover?.text_color?.[0] || '{colors.white}',
_dark: heroBannerButton?._hover?.text_color?.[1] || heroBannerButton?._hover?.text_color?.[0] || '{colors.white}',
},
},
selected: {
value: {
_light: heroBannerButton?._selected?.text_color?.[0] || '{colors.blackAlpha.800}',
_dark: heroBannerButton?._selected?.text_color?.[1] || heroBannerButton?._selected?.text_color?.[0] || '{colors.blackAlpha.800}',
},
},
},
},
}, },
link: { link: {
primary: { primary: {
......
...@@ -108,6 +108,22 @@ export const recipe = defineRecipe({ ...@@ -108,6 +108,22 @@ export const recipe = defineRecipe({
}, },
}, },
}, },
hero: {
bg: 'button.hero.bg',
color: 'button.hero.fg',
_hover: {
bg: 'button.hero.bg.hover',
color: 'button.hero.fg.hover',
},
_selected: {
bg: 'button.hero.bg.selected',
color: 'button.hero.fg.selected',
_hover: {
bg: 'button.hero.bg.selected',
color: 'button.hero.fg.selected',
},
},
},
plain: { plain: {
bg: 'transparent', bg: 'transparent',
color: 'inherit', color: 'inherit',
......
import { Box, Flex, Heading, useColorModeValue } from '@chakra-ui/react'; import { Box, Flex, Heading } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import config from 'configs/app'; import config from 'configs/app';
...@@ -13,34 +13,38 @@ const TEXT_COLOR_DEFAULT = 'white'; ...@@ -13,34 +13,38 @@ const TEXT_COLOR_DEFAULT = 'white';
const BORDER_DEFAULT = 'none'; const BORDER_DEFAULT = 'none';
const HeroBanner = () => { const HeroBanner = () => {
const background = useColorModeValue( const background = {
// light mode _light:
config.UI.homepage.heroBanner?.background?.[0] || config.UI.homepage.heroBanner?.background?.[0] ||
config.UI.homepage.plate.background || config.UI.homepage.plate.background ||
BACKGROUND_DEFAULT, BACKGROUND_DEFAULT,
// dark mode _dark:
config.UI.homepage.heroBanner?.background?.[1] || config.UI.homepage.heroBanner?.background?.[1] ||
config.UI.homepage.heroBanner?.background?.[0] || config.UI.homepage.heroBanner?.background?.[0] ||
config.UI.homepage.plate.background || config.UI.homepage.plate.background ||
BACKGROUND_DEFAULT, BACKGROUND_DEFAULT,
); };
const textColor = useColorModeValue( const textColor = {
// light mode _light:
config.UI.homepage.heroBanner?.text_color?.[0] || // light mode
config.UI.homepage.plate.textColor || config.UI.homepage.heroBanner?.text_color?.[0] ||
TEXT_COLOR_DEFAULT, config.UI.homepage.plate.textColor ||
TEXT_COLOR_DEFAULT,
// dark mode // dark mode
config.UI.homepage.heroBanner?.text_color?.[1] || _dark:
config.UI.homepage.heroBanner?.text_color?.[0] || config.UI.homepage.heroBanner?.text_color?.[1] ||
config.UI.homepage.plate.textColor || config.UI.homepage.heroBanner?.text_color?.[0] ||
TEXT_COLOR_DEFAULT, config.UI.homepage.plate.textColor ||
); TEXT_COLOR_DEFAULT,
};
const border = useColorModeValue( const border = {
config.UI.homepage.heroBanner?.border?.[0] || BORDER_DEFAULT, _light:
config.UI.homepage.heroBanner?.border?.[1] || config.UI.homepage.heroBanner?.border?.[0] || BORDER_DEFAULT, config.UI.homepage.heroBanner?.border?.[0] || BORDER_DEFAULT,
); _dark:
config.UI.homepage.heroBanner?.border?.[1] || config.UI.homepage.heroBanner?.border?.[0] || BORDER_DEFAULT,
};
return ( return (
<Flex <Flex
...@@ -69,10 +73,10 @@ const HeroBanner = () => { ...@@ -69,10 +73,10 @@ const HeroBanner = () => {
</Heading> </Heading>
{ config.UI.navigation.layout === 'vertical' && ( { config.UI.navigation.layout === 'vertical' && (
<Box display={{ base: 'none', lg: 'flex' }} gap={ 2 }> <Box display={{ base: 'none', lg: 'flex' }} gap={ 2 }>
{ config.features.rewards.isEnabled && <RewardsButton variant="hero"/> } { config.features.rewards.isEnabled && <RewardsButton visual="hero"/> }
{ {
(config.features.account.isEnabled && <UserProfileDesktop buttonVariant="hero"/>) || (config.features.account.isEnabled && <UserProfileDesktop buttonVisual="hero"/>) ||
(config.features.blockchainInteraction.isEnabled && <UserWalletDesktop buttonVariant="hero"/>) (config.features.blockchainInteraction.isEnabled && <UserWalletDesktop buttonVisual="hero"/>)
} }
</Box> </Box>
) } ) }
......
...@@ -15,23 +15,23 @@ const rollupFeature = config.features.rollup; ...@@ -15,23 +15,23 @@ const rollupFeature = config.features.rollup;
const Home = () => { const Home = () => {
const leftWidget = (() => { // const leftWidget = (() => {
if (rollupFeature.isEnabled && !rollupFeature.homepage.showLatestBlocks) { // if (rollupFeature.isEnabled && !rollupFeature.homepage.showLatestBlocks) {
switch (rollupFeature.type) { // switch (rollupFeature.type) {
case 'zkEvm': // case 'zkEvm':
return <LatestZkEvmL2Batches/>; // return <LatestZkEvmL2Batches/>;
case 'arbitrum': // case 'arbitrum':
return <LatestArbitrumL2Batches/>; // return <LatestArbitrumL2Batches/>;
} // }
} // }
return <LatestBlocks/>; // return <LatestBlocks/>;
})(); // })();
return ( return (
<Box as="main"> <Box as="main">
<HeroBanner/> <HeroBanner/>
<Flex flexDir={{ base: 'column', lg: 'row' }} columnGap={ 2 } rowGap={ 1 } mt={ 3 } _empty={{ mt: 0 }}> { /* <Flex flexDir={{ base: 'column', lg: 'row' }} columnGap={ 2 } rowGap={ 1 } mt={ 3 } _empty={{ mt: 0 }}>
<Stats/> <Stats/>
<ChainIndicators/> <ChainIndicators/>
</Flex> </Flex>
...@@ -41,7 +41,7 @@ const Home = () => { ...@@ -41,7 +41,7 @@ const Home = () => {
<Box flexGrow={ 1 }> <Box flexGrow={ 1 }>
<Transactions/> <Transactions/>
</Box> </Box>
</Flex> </Flex> */ }
</Box> </Box>
); );
}; };
......
...@@ -33,7 +33,7 @@ const RewardsButton = ({ visual = 'header', size }: Props) => { ...@@ -33,7 +33,7 @@ const RewardsButton = ({ visual = 'header', size }: Props) => {
> >
<Button <Button
visual={ visual } visual={ visual }
data-selected={ !isLoading && Boolean(apiToken) } selected={ !isLoading && Boolean(apiToken) }
flexShrink={ 0 } flexShrink={ 0 }
as={ apiToken ? LinkInternal : 'button' } as={ apiToken ? LinkInternal : 'button' }
{ ...(apiToken ? { href: route({ pathname: '/account/rewards' }) } : {}) } { ...(apiToken ? { href: route({ pathname: '/account/rewards' }) } : {}) }
......
...@@ -5,7 +5,7 @@ import type { BannerPlatform } from './types'; ...@@ -5,7 +5,7 @@ import type { BannerPlatform } from './types';
import type { AdBannerProviders } from 'types/client/adProviders'; import type { AdBannerProviders } from 'types/client/adProviders';
import config from 'configs/app'; import config from 'configs/app';
import Skeleton from 'ui/shared/chakra/Skeleton'; import { Skeleton } from 'toolkit/chakra/skeleton';
import AdbutlerBanner from './AdbutlerBanner'; import AdbutlerBanner from './AdbutlerBanner';
import CoinzillaBanner from './CoinzillaBanner'; import CoinzillaBanner from './CoinzillaBanner';
...@@ -41,7 +41,7 @@ const AdBannerContent = ({ className, isLoading, provider, platform }: Props) => ...@@ -41,7 +41,7 @@ const AdBannerContent = ({ className, isLoading, provider, platform }: Props) =>
return ( return (
<Skeleton <Skeleton
className={ className } className={ className }
isLoaded={ !isLoading } loading={ isLoading }
borderRadius="none" borderRadius="none"
maxW={ ('adButler' in feature && feature.adButler) ? feature.adButler.config.desktop.width : '728px' } maxW={ ('adButler' in feature && feature.adButler) ? feature.adButler.config.desktop.width : '728px' }
w="100%" w="100%"
......
...@@ -44,7 +44,7 @@ const FilterButton = ({ isActive, isLoading, appliedFiltersNum, onClick, as }: P ...@@ -44,7 +44,7 @@ const FilterButton = ({ isActive, isLoading, appliedFiltersNum, onClick, as }: P
colorScheme="gray" colorScheme="gray"
onClick={ onClick } onClick={ onClick }
isActive={ isActive } isActive={ isActive }
data-selected={ Boolean(appliedFiltersNum) } selected={ Boolean(appliedFiltersNum) }
px={ 1.5 } px={ 1.5 }
flexShrink={ 0 } flexShrink={ 0 }
as={ as } as={ as }
......
...@@ -31,7 +31,7 @@ const RadioButton = (props: RadioButtonProps) => { ...@@ -31,7 +31,7 @@ const RadioButton = (props: RadioButtonProps) => {
as="label" as="label"
aria-label={ props.title } aria-label={ props.title }
variant="radio_group" variant="radio_group"
data-selected={ props.isChecked } selected={ props.isChecked }
> >
<input { ...input }/> <input { ...input }/>
<Flex <Flex
...@@ -48,7 +48,7 @@ const RadioButton = (props: RadioButtonProps) => { ...@@ -48,7 +48,7 @@ const RadioButton = (props: RadioButtonProps) => {
as="label" as="label"
leftIcon={ props.icon ? <IconSvg name={ props.icon } boxSize={ 5 } mr={ -1 }/> : undefined } leftIcon={ props.icon ? <IconSvg name={ props.icon } boxSize={ 5 } mr={ -1 }/> : undefined }
variant="radio_group" variant="radio_group"
data-selected={ props.isChecked } selected={ props.isChecked }
> >
<input { ...input }/> <input { ...input }/>
<Flex <Flex
......
...@@ -33,7 +33,7 @@ const ButtonDesktop = ({ children, isActive, onClick, isLoading, className }: Bu ...@@ -33,7 +33,7 @@ const ButtonDesktop = ({ children, isActive, onClick, isLoading, className }: Bu
fontWeight="600" fontWeight="600"
borderColor="transparent" borderColor="transparent"
px={ 2 } px={ 2 }
data-selected={ isActive } selected={ isActive }
> >
<Box <Box
as={ isActive ? 'div' : 'span' } as={ isActive ? 'div' : 'span' }
......
...@@ -18,7 +18,6 @@ import AuthModalScreenSelectMethod from './screens/AuthModalScreenSelectMethod'; ...@@ -18,7 +18,6 @@ import AuthModalScreenSelectMethod from './screens/AuthModalScreenSelectMethod';
import AuthModalScreenSuccessEmail from './screens/AuthModalScreenSuccessEmail'; import AuthModalScreenSuccessEmail from './screens/AuthModalScreenSuccessEmail';
import AuthModalScreenSuccessWallet from './screens/AuthModalScreenSuccessWallet'; import AuthModalScreenSuccessWallet from './screens/AuthModalScreenSuccessWallet';
// TODO @tom2drum fix auth modal
const feature = config.features.account; const feature = config.features.account;
interface Props { interface Props {
......
...@@ -47,8 +47,8 @@ const UserWalletButton = ({ size, visual, isPending, isAutoConnectDisabled, addr ...@@ -47,8 +47,8 @@ const UserWalletButton = ({ size, visual, isPending, isAutoConnectDisabled, addr
ref={ ref } ref={ ref }
size={ size } size={ size }
visual={ visual } visual={ visual }
data-selected={ Boolean(address) } selected={ Boolean(address) }
data-warning={ isAutoConnectDisabled } highlighted={ isAutoConnectDisabled }
textStyle="sm" textStyle="sm"
px={ address ? 2.5 : 4 } px={ address ? 2.5 : 4 }
fontWeight={ address ? 700 : 600 } fontWeight={ address ? 700 : 600 }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment