-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#382] add create governance action information screen
- Loading branch information
1 parent
0b27149
commit f6c6f0f
Showing
7 changed files
with
82 additions
and
10 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
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
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
60 changes: 60 additions & 0 deletions
60
govtool/frontend/src/components/organisms/WhatGovernanceActionIsAbout.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,60 @@ | ||
import { Dispatch, SetStateAction, useCallback } from "react"; | ||
import { Trans } from "react-i18next"; | ||
|
||
import { Typography } from "@atoms"; | ||
import { useScreenDimension, useTranslation } from "@hooks"; | ||
import { | ||
correctAdaFormat, | ||
getItemFromLocalStorage, | ||
PROTOCOL_PARAMS_KEY, | ||
} from "@utils"; | ||
|
||
import { BgCard } from "."; | ||
|
||
type WhatGovernanceActionIsAboutProps = { | ||
onClickCancel: () => void; | ||
setStep: Dispatch<SetStateAction<number>>; | ||
}; | ||
|
||
export const WhatGovernanceActionIsAbout = ({ | ||
setStep, | ||
onClickCancel, | ||
}: WhatGovernanceActionIsAboutProps) => { | ||
const { t } = useTranslation(); | ||
const { isMobile } = useScreenDimension(); | ||
|
||
const deposit = getItemFromLocalStorage(PROTOCOL_PARAMS_KEY); | ||
|
||
const onClickContinue = useCallback(() => setStep(2), []); | ||
|
||
return ( | ||
<BgCard | ||
actionButtonLabel={t("continue")} | ||
backButtonLabel={t("cancel")} | ||
onClickActionButton={onClickContinue} | ||
onClickBackButton={onClickCancel} | ||
sx={{ paddingBottom: isMobile ? undefined : 3 }} | ||
> | ||
<Typography sx={{ textAlign: "center" }} variant="headline4"> | ||
{t("createGovernanceAction.creatingAGovernanceAction")} | ||
</Typography> | ||
<Typography | ||
fontWeight={400} | ||
sx={{ | ||
pb: isMobile ? 6 : 4, | ||
pt: 4, | ||
textAlign: "center", | ||
whiteSpace: "pre-line", | ||
}} | ||
variant="body1" | ||
> | ||
<Trans | ||
i18nKey="createGovernanceAction.creatingAGovernanceActionDescription" | ||
values={{ | ||
deposit: correctAdaFormat(deposit.gov_action_deposit), | ||
}} | ||
/> | ||
</Typography> | ||
</BgCard> | ||
); | ||
}; |
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
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
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