Commit 618c3cde authored by Max Alekseenko's avatar Max Alekseenko

adapt rewards dashboard for mobiles

parent a7280d39
...@@ -65,17 +65,14 @@ const RewardsDashboard = () => { ...@@ -65,17 +65,14 @@ const RewardsDashboard = () => {
<PageTitle <PageTitle
title="Dashboard" title="Dashboard"
secondRow={ ( secondRow={ (
<> <span>
The Blockscout Merits Program is just getting started! Learn more about the details, The Blockscout Merits Program is just getting started! Learn more about the details,
features, and future plans in our <LinkExternal ml={ 1 } href="">blog post</LinkExternal>. features, and future plans in our <LinkExternal href="">blog post</LinkExternal>.
</> </span>
) } ) }
/> />
<Flex flexDirection="column" alignItems="flex-start" w="full" gap={ 6 }> <Flex flexDirection="column" alignItems="flex-start" w="full" gap={ 6 }>
<Button variant="outline" isDisabled> <Flex gap={ 6 } flexDirection={{ base: 'column', md: 'row' }}>
Pre-staking dashboard
</Button>
<Flex gap={ 6 }>
<RewardsDashboardCard <RewardsDashboardCard
description="Claim your daily merits and any merits received from referrals." description="Claim your daily merits and any merits received from referrals."
direction="column-reverse" direction="column-reverse"
...@@ -136,7 +133,13 @@ const RewardsDashboard = () => { ...@@ -136,7 +133,13 @@ const RewardsDashboard = () => {
) } ) }
direction="row" direction="row"
> >
<Flex flex={ 1 } gap={ 6 } px={ 6 }> <Flex
flex={ 1 }
gap={{ base: 2, md: 6 }}
px={{ base: 4, md: 6 }}
py={{ base: 4, md: 0 }}
flexDirection={{ base: 'column', md: 'row' }}
>
<CopyField <CopyField
label="Referral link" label="Referral link"
value={ `https://eth.blockscout.com?ref=${ referralsQuery.data?.code }` } value={ `https://eth.blockscout.com?ref=${ referralsQuery.data?.code }` }
...@@ -149,7 +152,7 @@ const RewardsDashboard = () => { ...@@ -149,7 +152,7 @@ const RewardsDashboard = () => {
/> />
</Flex> </Flex>
</RewardsDashboardCard> </RewardsDashboardCard>
<Flex gap={ 6 }> <Flex gap={ 6 } flexDirection={{ base: 'column', md: 'row' }}>
<RewardsDashboardCard <RewardsDashboardCard
title="Activity" title="Activity"
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
...@@ -175,15 +178,19 @@ const RewardsDashboard = () => { ...@@ -175,15 +178,19 @@ const RewardsDashboard = () => {
direction="row" direction="row"
availableSoon availableSoon
> >
<Flex flex={ 1 } gap={ 6 } px={ 6 } justifyContent="space-between"> <Flex
flex={ 1 }
px={{ base: 4, md: 6 }}
py={{ base: 4, md: 0 }}
justifyContent="space-between"
>
{ Array(5).fill(null).map((_, index) => ( { Array(5).fill(null).map((_, index) => (
<Image <Image
key={ index } key={ index }
src={ `/static/badges/badge_${ index + 1 }.svg` } src={ `/static/badges/badge_${ index + 1 }.svg` }
alt={ `Badge ${ index + 1 }` } alt={ `Badge ${ index + 1 }` }
w="100px" boxSize={{ base: '50px', md: '100px' }}
h="100px" fallback={ <Skeleton boxSize={{ base: '50px', md: '100px' }}/> }
fallback={ <Skeleton w="100px" h="100px"/> }
/> />
)) } )) }
</Flex> </Flex>
......
...@@ -20,19 +20,25 @@ const RewardsDashboardCard = ({ ...@@ -20,19 +20,25 @@ const RewardsDashboardCard = ({
}: Props) => { }: Props) => {
return ( return (
<Flex <Flex
flexDirection={ direction } flexDirection={{ base: direction === 'row' ? 'column' : direction, md: direction }}
justifyContent={ direction === 'column-reverse' ? 'flex-end' : 'flex-start' } justifyContent={ direction === 'column-reverse' ? 'flex-end' : 'flex-start' }
p={ 2 } p={{ base: 1.5, md: 2 }}
border="1px solid" border="1px solid"
borderColor={ useColorModeValue('gray.200', 'whiteAlpha.200') } borderColor={ useColorModeValue('gray.200', 'whiteAlpha.200') }
borderRadius="lg" borderRadius="lg"
gap={ direction === 'row' ? 10 : 1 } gap={{ base: 1, md: direction === 'row' ? 10 : 1 }}
w={ direction === 'row' ? 'full' : 'auto' } w={ direction === 'row' ? 'full' : 'auto' }
flex={ direction !== 'row' ? 1 : '0 1 auto' }
> >
<Flex flexDirection="column" gap={ 2 } p={ 3 } w={ direction === 'row' ? '340px' : 'full' }> <Flex
flexDirection="column"
gap={ 2 }
p={{ base: 1.5, md: 3 }}
w={{ base: 'full', md: direction === 'row' ? '340px' : 'full' }}
>
{ title && ( { title && (
<Flex alignItems="center" gap={ 2 }> <Flex alignItems="center" gap={ 2 }>
<Text fontSize="lg" fontWeight="500">{ title }</Text> <Text fontSize={{ base: 'md', md: 'lg' }} fontWeight="500">{ title }</Text>
{ availableSoon && <AvailableSoonLabel/> } { availableSoon && <AvailableSoonLabel/> }
</Flex> </Flex>
) } ) }
...@@ -44,9 +50,9 @@ const RewardsDashboardCard = ({ ...@@ -44,9 +50,9 @@ const RewardsDashboardCard = ({
<Flex <Flex
alignItems="center" alignItems="center"
justifyContent="space-around" justifyContent="space-around"
borderRadius="8px" borderRadius={{ base: 'lg', md: '8px' }}
backgroundColor={ useColorModeValue('gray.50', 'whiteAlpha.50') } backgroundColor={ useColorModeValue('gray.50', 'whiteAlpha.50') }
h="128px" h={{ base: '80px', md: '128px' }}
filter="auto" filter="auto"
blur={ blurFilter ? '4px' : '0' } blur={ blurFilter ? '4px' : '0' }
flex={ direction === 'row' ? 1 : '0 1 auto' } flex={ direction === 'row' ? 1 : '0 1 auto' }
......
...@@ -31,11 +31,12 @@ const RewardsDashboardCard = ({ label, value, withIcon, hint }: Props) => { ...@@ -31,11 +31,12 @@ const RewardsDashboardCard = ({ label, value, withIcon, hint }: Props) => {
<IconSvg <IconSvg
name="merits_colored" name="merits_colored"
boxSize={ 12 } boxSize={ 12 }
mb={ -0.5 } mt={ -2 }
mb={ -2.5 }
filter="drop-shadow(0px 4px 3px rgba(21, 57, 103, 0.1))" filter="drop-shadow(0px 4px 3px rgba(21, 57, 103, 0.1))"
/> />
) } ) }
<Text fontSize="32px" fontWeight="500"> <Text fontSize={{ base: '24px', md: '32px' }} lineHeight={{ base: '24px', md: 1.5 }} fontWeight="500">
{ value } { value }
</Text> </Text>
</Flex> </Flex>
......
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