-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
218 additions
and
17 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 |
---|---|---|
|
@@ -56,6 +56,7 @@ query TransactionResult($txId: TxId!) { | |
blockHash | ||
blockIndex | ||
txStatus | ||
outputState | ||
} | ||
} | ||
} | ||
|
42 changes: 42 additions & 0 deletions
42
src/renderer/components/core/Layout/UserInfo/MigrateButton.tsx
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,42 @@ | ||
import { motion } from "framer-motion"; | ||
import React, { MouseEvent, useCallback } from "react"; | ||
import { T } from "src/renderer/i18n"; | ||
import { styled } from "src/renderer/stitches.config"; | ||
|
||
export const Button = styled(motion.button, { | ||
appearance: "none", | ||
backgroundColor: "#dc9c2d", | ||
border: "none", | ||
padding: "5px 1rem", | ||
"&:disabled": { | ||
backgroundColor: "$gray", | ||
color: "white", | ||
}, | ||
}); | ||
|
||
const transifexTags = "v2/MigrateButton"; | ||
|
||
interface MigrateButtonProps { | ||
onClick: () => void; | ||
loading: boolean; | ||
} | ||
|
||
export function MigrateButton({ loading, onClick }: MigrateButtonProps) { | ||
const eventListener = useCallback<(e: MouseEvent) => void>( | ||
(e) => { | ||
e.stopPropagation(); | ||
onClick(); | ||
}, | ||
[onClick], | ||
); | ||
|
||
return ( | ||
<Button disabled={loading} onClick={eventListener}> | ||
{loading ? ( | ||
<T _str="Loading" _tags={transifexTags} /> | ||
) : ( | ||
<T _str="Migrate Stake" _tags={transifexTags} /> | ||
)} | ||
</Button> | ||
); | ||
} |
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
81 changes: 81 additions & 0 deletions
81
src/renderer/views/MigrateCollectionRewardsOverlay/MigrateContent.tsx
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,81 @@ | ||
import React from "react"; | ||
import { observer } from "mobx-react"; | ||
import { GetAvatarAddressQuery } from "src/generated/graphql"; | ||
|
||
import Button, { ButtonBar } from "src/renderer/components/ui/Button"; | ||
import { styled, Box } from "@material-ui/core"; | ||
import { T } from "src/renderer/i18n"; | ||
import OverlayBase, { | ||
CloseButton, | ||
} from "src/renderer/components/core/OverlayBase"; | ||
import { OverlayProps } from "src/utils/types"; | ||
import H1 from "src/renderer/components/ui/H1"; | ||
import { MigrateCollectionRewardsOverlayProps } from "."; | ||
|
||
const transifexTags = "v2/views/MigrateCollectionRewardsOverlay"; | ||
|
||
const Description = { | ||
textShadow: "0px 2px 2px rgba(0, 0, 0, 0.5)", | ||
textAlign: "center" as const, | ||
fontSize: "20px", | ||
paddingBottom: "2.5rem", | ||
}; | ||
|
||
const MigrateCollectionRewardsOverlayBase = styled(OverlayBase)({ | ||
"&&": { | ||
width: "500px", | ||
height: "auto", | ||
backgroundColor: "#1d1e1f", | ||
margin: "20vh auto", | ||
padding: "2rem", | ||
display: "flex", | ||
gap: "0.5rem", | ||
flexDirection: "column", | ||
alignItems: "center", | ||
color: "white", | ||
}, | ||
}); | ||
|
||
function ClaimContent({ | ||
onConfirm, | ||
onClose, | ||
isOpen, | ||
}: MigrateCollectionRewardsOverlayProps) { | ||
return ( | ||
<MigrateCollectionRewardsOverlayBase isOpen={isOpen} onDismiss={onClose}> | ||
<CloseButton | ||
onClick={() => { | ||
onClose(); | ||
}} | ||
/> | ||
<H1> | ||
<T _str="Warning" _tags={transifexTags} /> | ||
</H1> | ||
<Box style={Description}> | ||
<b>If you migrate,</b> | ||
<br /> | ||
<b> | ||
the reward claim cycle gets{" "} | ||
<span style={{ color: "#ff4343" }}>reset</span> | ||
<br /> | ||
and you need to wait 7 days to claim. | ||
</b> | ||
<br /> | ||
<br /> | ||
Also, deposits cannot be withdrawn within 28 days. | ||
</Box> | ||
<Box> | ||
<ButtonBar placement="bottom"> | ||
<Button onClick={() => onClose()}> | ||
<T _str="Cancel" _tags={transifexTags} /> | ||
</Button> | ||
<Button variant="primary" onClick={() => onConfirm()}> | ||
<T _str="Confirm" _tags={transifexTags} /> | ||
</Button> | ||
</ButtonBar> | ||
</Box> | ||
</MigrateCollectionRewardsOverlayBase> | ||
); | ||
} | ||
|
||
export default observer(ClaimContent); |
23 changes: 23 additions & 0 deletions
23
src/renderer/views/MigrateCollectionRewardsOverlay/index.tsx
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,23 @@ | ||
import { observer } from "mobx-react"; | ||
import React from "react"; | ||
import { OverlayProps } from "src/utils/types"; | ||
import MigrateContent from "./MigrateContent"; | ||
|
||
export interface MigrateCollectionRewardsOverlayProps extends OverlayProps { | ||
tip: number; | ||
onConfirm(): void; | ||
} | ||
|
||
const transifexTags = "v2/views/MigrateCollectionRewardsOverlay"; | ||
|
||
function MigrateCollectionRewardsOverlay({ | ||
isOpen, | ||
onClose, | ||
...collectionData | ||
}: MigrateCollectionRewardsOverlayProps) { | ||
return ( | ||
<MigrateContent {...collectionData} isOpen={isOpen} onClose={onClose} /> | ||
); | ||
} | ||
|
||
export default observer(MigrateCollectionRewardsOverlay); |