Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 48f41b2

Browse files
committed
add staking banner and fixed epoch est date
1 parent 8650c04 commit 48f41b2

File tree

4 files changed

+80
-5
lines changed

4 files changed

+80
-5
lines changed

ts/components/banner.tsx

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ interface Props {
1616
mainCta?: CTAButton;
1717
secondaryCta?: CTAButton;
1818
theme?: IThemeInterface;
19+
padding?: string;
20+
mainCtaCentered?: boolean;
1921
}
2022

2123
interface CTAButton {
@@ -30,13 +32,15 @@ interface BorderProps {
3032
}
3133

3234
export const Banner: React.StatelessComponent<Props> = (props: Props) => {
33-
const { heading, subline, mainCta, secondaryCta, customCta } = props;
35+
const { heading, subline, mainCta, secondaryCta, customCta, padding, mainCtaCentered } = props;
36+
console.log(padding);
3437
return (
3538
<CustomSection
3639
bgColor={colors.brandDark}
3740
isFlex={true}
3841
flexBreakpoint="900px"
39-
paddingMobile="120px 0"
42+
padding={`${padding ? padding : '120px'} 0`}
43+
paddingMobile={`${padding ? padding : '120px'} 0`}
4044
alignItems="center"
4145
>
4246
<Border />
@@ -52,10 +56,23 @@ export const Banner: React.StatelessComponent<Props> = (props: Props) => {
5256
)}
5357
</Column>
5458
<ColumnCta>
59+
{mainCta && mainCtaCentered && (
60+
<ButtonWrapCentered>
61+
<Button
62+
color={colors.white}
63+
isTransparent={false}
64+
href={mainCta.href}
65+
onClick={mainCta.onClick}
66+
target={mainCta.shouldOpenInNewTab ? '_blank' : ''}
67+
>
68+
{mainCta.text}
69+
</Button>
70+
</ButtonWrapCentered>
71+
)}
5572
<ButtonWrap>
5673
{customCta}
5774

58-
{mainCta && (
75+
{mainCta && !mainCtaCentered && (
5976
<Button
6077
color={colors.white}
6178
isTransparent={false}
@@ -106,6 +123,7 @@ const CustomSection = styled(Section)`
106123

107124
const ColumnCta = styled(Column)`
108125
flex-shrink: 0;
126+
display: flex;
109127
`;
110128

111129
const CustomHeading = styled.h2`
@@ -141,6 +159,28 @@ const ButtonWrap = styled.div`
141159
}
142160
`;
143161

162+
const ButtonWrapCentered = styled.div`
163+
align-self: center;
164+
165+
@media (min-width: 768px) {
166+
* + * {
167+
margin-left: 15px;
168+
}
169+
}
170+
171+
@media (max-width: 768px) {
172+
a,
173+
button {
174+
display: block;
175+
width: 220px;
176+
}
177+
178+
* + * {
179+
margin-top: 15px;
180+
}
181+
}
182+
`;
183+
144184
// Note let's refactor this
145185
// is it absolutely necessary to have a stateless component
146186
// to pass props down into the styled icon?

ts/components/staking/current_epoch_overview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ export const CurrentEpochOverview: React.FC<CurrentEpochOverviewProps> = ({
7171
<Explanation>ZRX Staked</Explanation>
7272
</OverviewItem>
7373
<OverviewItem>
74-
<Metric>{stakingUtils.getTimeToEpochDate(nextEpochStartDate)}</Metric>
75-
<Explanation>Epoch ends</Explanation>
74+
<Metric>{stakingUtils.getTimeToEpochDate(new Date(1621357200 * 1000))}</Metric>
75+
<Explanation>Epoch ends (est)</Explanation>
7676
</OverviewItem>
7777
<OverviewItem>
7878
<Metric>{currentEpochRewards ? formatEther(currentEpochRewards, { decimals: 2 }).full : '-'}</Metric>

ts/pages/account/dashboard.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { BigNumber, hexUtils, logUtils } from '@0x/utils';
2+
import { Banner } from 'ts/components/banner';
3+
24
import { Web3Wrapper } from '@0x/web3-wrapper';
35
import { DialogContent, DialogOverlay } from '@reach/dialog';
46
import '@reach/dialog/styles.css';
@@ -446,6 +448,22 @@ export const Account: React.FC<AccountProps> = () => {
446448
return (
447449
<StakingPageLayout title="0x Staking | Account">
448450
<HeaderWrapper>
451+
<BannerWrapper>
452+
<Banner
453+
mainCtaCentered={true}
454+
padding={'50px'}
455+
heading={`Staking Notice`}
456+
subline="The staking system is currently paused until an issue with the finalization logic is resolved. All user funds are safe. Thank you!"
457+
mainCta={{
458+
text: 'Learn More',
459+
onClick: () => {
460+
window.location.href =
461+
'https://gov.0x.org/t/0x-staking-system-epoch-67-finalization/882';
462+
},
463+
}}
464+
/>
465+
</BannerWrapper>
466+
449467
<Inner>
450468
{account && account.address && <AccountDetail userEthAddress={account.address} />}
451469
<Figures>
@@ -924,3 +942,7 @@ const StyledDialogContent = styled(DialogContent)`
924942
const StyledParagraph = styled(Paragraph)`
925943
margin-top: 50px;
926944
`;
945+
946+
const BannerWrapper = styled.div`
947+
margin-bottom: 50px;
948+
`;

ts/pages/staking/home.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import styled from 'styled-components';
77
import { colors } from 'ts/style/colors';
88

99
import { State } from 'ts/redux/reducer';
10+
import { Banner } from 'ts/components/banner';
1011

1112
import { Button } from 'ts/components/button';
1213
import { CFLMetrics } from 'ts/pages/cfl/cfl_metrics';
@@ -109,6 +110,18 @@ export const StakingIndex: React.FC<StakingIndexProps> = () => {
109110

110111
return (
111112
<StakingPageLayout isHome={true} title="0x Staking">
113+
<Banner
114+
mainCtaCentered={true}
115+
padding={'50px'}
116+
heading={`Staking Notice`}
117+
subline="The staking system is currently paused until an issue with the finalization logic is resolved. All user funds are safe. Thank you!"
118+
mainCta={{
119+
text: 'Learn More',
120+
onClick: () => {
121+
window.location.href = 'https://gov.0x.org/t/0x-staking-system-epoch-67-finalization/882';
122+
},
123+
}}
124+
/>
112125
<StakingHero
113126
title={
114127
<div>

0 commit comments

Comments
 (0)