Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Style claim and invest page. (#2294)
Browse files Browse the repository at this point in the history
* Style claim and invest page.

* Move pseudo-element content text.

* Fix stepper for responsive.

* Fix stepper text alignment.
  • Loading branch information
fairlighteth authored Jan 26, 2022
1 parent 926736c commit 82736a0
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 23 deletions.
17 changes: 13 additions & 4 deletions src/custom/components/Stepper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import styled from 'styled-components/macro'
import CheckCircle from 'assets/cow-swap/check.svg'
import { transparentize } from 'polished'

export const Wrapper = styled.div`
export const Wrapper = styled.div<{ totalSteps: number }>`
width: 100%;
display: flex;
flex-flow: row wrap;
display: grid;
grid-template-columns: ${({ totalSteps }) => `repeat(${totalSteps}, 1fr)`};
margin: 12px 0 24px;
`

Expand Down Expand Up @@ -82,6 +82,11 @@ export const Step = styled.div<{
color: ${({ isActiveStep, completedStep, theme }) =>
completedStep ? theme.text1 : isActiveStep ? theme.text1 : transparentize(0.4, theme.text1)};
font-weight: ${({ isActiveStep, completedStep }) => (completedStep ? '300' : isActiveStep ? 'bold' : '300')};
text-align: center;
${({ theme }) => theme.mediaWidth.upToSmall`
font-size: 14px;
`}
}
> i {
Expand All @@ -96,6 +101,10 @@ export const Step = styled.div<{
margin: 6px 0 0;
padding: 0 24px;
text-align: center;
${({ theme }) => theme.mediaWidth.upToSmall`
display: none;
`}
}
`

Expand All @@ -109,7 +118,7 @@ interface StepperProps {

export function Stepper({ steps, activeStep }: StepperProps) {
return (
<Wrapper>
<Wrapper totalSteps={steps.length}>
{steps.map(({ title, subtitle }, index) => {
const completedStep = activeStep > index
const isActiveStep = activeStep === index
Expand Down
46 changes: 27 additions & 19 deletions src/custom/pages/Claim/InvestmentFlow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
InvestSummaryTable,
ClaimTable,
AccountClaimSummary,
StepExplainer,
Badge,
} from 'pages/Claim/styled'
import { InvestSummaryRow } from 'pages/Claim/InvestmentFlow/InvestSummaryRow'
Expand Down Expand Up @@ -179,25 +180,32 @@ export default function InvestmentFlow({ hasClaims, isAirdropOnly, modalCbs }: I
</h1>

{investFlowStep === 0 && (
<p>
You have chosen to exercise one or more investment opportunities alongside claiming your airdrop. Exercising
your investment options will give you the chance to acquire vCOW tokens at a fixed price. This process
consists of two steps:
<br />
<br />
1) Define the amount you would like to invest and set the required allowances for the token you are purchasing
vCOW with.
<br />
<br />
2) Claim your vCOW tokens for the Airdrop (available immediately) and for your investment (vesting linearly
over 4 years).
<br />
<br />
For more details around the token, please read{' '}
<ExternalLink href={COW_LINKS.vCowPost}>the blog post</ExternalLink>
.<br /> For more details about the claiming process, please read{' '}
<ExternalLink href={COW_LINKS.stepGuide}>step by step guide</ExternalLink>.
</p>
<>
<p>
You have chosen to exercise one or more investment opportunities alongside claiming your airdrop. Exercising
your investment options will give you the chance to acquire vCOW tokens at a fixed price. This process
consists of two steps.
</p>
<StepExplainer>
<span data-step="Step 1">
<p>
Define the amount you would like to invest and set the required allowances for the token you are
purchasing vCOW with.
</p>
</span>
<span data-step="Step 2">
<p>
Claim your vCOW tokens for the Airdrop (available immediately) and for your investment (vesting linearly
over 4 years).
</p>
</span>
</StepExplainer>
<p>
For more details around the token, please read{' '}
<ExternalLink href={COW_LINKS.vCowPost}>the blog post</ExternalLink>. For more details about the claiming
process, please read <ExternalLink href={COW_LINKS.stepGuide}>step by step guide</ExternalLink>.
</p>
</>
)}

{/* Invest flow: Step 1 > Set allowances and investment amounts */}
Expand Down
34 changes: 34 additions & 0 deletions src/custom/pages/Claim/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1195,3 +1195,37 @@ export const CowSpinner = styled.div`
}
}
`

export const StepExplainer = styled.div`
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0 16px;
margin: 0 0 24px;
${({ theme }) => theme.mediaWidth.upToSmall`
grid-template-columns: 1fr;
gap: 16px 0;
`}
> span {
padding: 24px;
background: ${({ theme }) => theme.blueShade3};
border-radius: 12px;
position: relative;
}
> span::before {
content: attr(data-step);
display: flex;
align-items: center;
justify-content: center;
margin: auto;
flex: 1 1 min-content;
padding: 0 0 12px;
font-size: 22px;
font-weight: bold;
}
> span > p {
margin: 0;
}
`

0 comments on commit 82736a0

Please sign in to comment.