This repository was archived by the owner on Jun 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-structure claim button and mobile responsive. (#2137)
* Re-structure claim button and mobile responsive. * Claim style improve 5 (#2146) * Update * Update * Investing table styling start
- Loading branch information
1 parent
b814cda
commit 54acd8f
Showing
5 changed files
with
201 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import { Trans } from '@lingui/macro' | ||
import { Dots } from 'components/swap/styleds' | ||
import styled, { css } from 'styled-components/macro' | ||
import CowProtocolLogo from 'components/CowProtocolLogo' | ||
import { useUserHasSubmittedClaim } from 'state/transactions/hooks' | ||
|
||
export const Wrapper = styled.div<{ isClaimPage?: boolean | null }>` | ||
${({ theme }) => theme.card.boxShadow}; | ||
color: ${({ theme }) => theme.text1}; | ||
padding: 0 12px; | ||
font-size: 15px; | ||
font-weight: 500; | ||
height: 38px; | ||
display: flex; | ||
align-items: center; | ||
position: relative; | ||
border-radius: 12px; | ||
pointer-events: auto; | ||
> b { | ||
margin: 0 0 0 5px; | ||
color: inherit; | ||
font-weight: inherit; | ||
white-space: nowrap; | ||
&::before, | ||
&::after { | ||
content: ''; | ||
position: absolute; | ||
left: -1px; | ||
top: -1px; | ||
background: ${({ theme }) => | ||
`linear-gradient(45deg, ${theme.primary1}, ${theme.primary2}, ${theme.primary3}, ${theme.bg4}, ${theme.primary1}, ${theme.primary2})`}; | ||
background-size: 800%; | ||
width: calc(100% + 2px); | ||
height: calc(100% + 2px); | ||
z-index: -1; | ||
animation: glow 50s linear infinite; | ||
transition: background-position 0.3s ease-in-out; | ||
border-radius: 12px; | ||
} | ||
&::after { | ||
filter: blur(8px); | ||
} | ||
&:hover::before, | ||
&:hover::after { | ||
animation: glow 12s linear infinite; | ||
} | ||
// Stop glowing effect on claim page | ||
${({ isClaimPage }) => | ||
isClaimPage && | ||
css` | ||
&::before, | ||
&::after { | ||
content: none; | ||
} | ||
`}; | ||
@keyframes glow { | ||
0% { | ||
background-position: 0 0; | ||
} | ||
50% { | ||
background-position: 300% 0; | ||
} | ||
100% { | ||
background-position: 0 0; | ||
} | ||
} | ||
` | ||
|
||
interface CowClaimButtonProps { | ||
isClaimPage?: boolean | null | undefined | ||
account?: string | null | undefined | ||
handleOnClickClaim?: () => void | ||
} | ||
|
||
export default function CowClaimButton({ isClaimPage, account, handleOnClickClaim }: CowClaimButtonProps) { | ||
const { claimTxn } = useUserHasSubmittedClaim(account ?? undefined) | ||
|
||
return ( | ||
<Wrapper isClaimPage={isClaimPage} onClick={handleOnClickClaim}> | ||
{claimTxn && !claimTxn?.receipt ? ( | ||
<Dots> | ||
<Trans>Claiming vCOW...</Trans> | ||
</Dots> | ||
) : ( | ||
<> | ||
<CowProtocolLogo /> | ||
<b> | ||
<Trans>vCOW</Trans> | ||
</b> | ||
</> | ||
)} | ||
</Wrapper> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.