-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Access to the subscription whitelist button (#1959)
* join beta * lingui extract * Apply suggestions from code review * lingui extract * switch to form * lingui extract * Update packages/files-ui/src/Components/Elements/BetaModal.tsx * lingui extract * Update packages/files-ui/src/Components/FilesRoutes.tsx Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com> Co-authored-by: GitHub Actions <actions@github.com> Co-authored-by: Tanmoy Basak Anjan <tanmoy3399@gmail.com> Co-authored-by: Michael Yankelev <12774278+FSM1@users.noreply.github.com>
- Loading branch information
1 parent
288f56c
commit dbe1ade
Showing
8 changed files
with
142 additions
and
1 deletion.
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,80 @@ | ||
import { Button, Typography } from "@chainsafe/common-components" | ||
import { createStyles, makeStyles } from "@chainsafe/common-theme" | ||
import { Trans } from "@lingui/macro" | ||
import React, { useCallback } from "react" | ||
import { CSFTheme } from "../../Themes/types" | ||
import { ROUTE_LINKS } from "../FilesRoutes" | ||
import CustomModal from "./CustomModal" | ||
|
||
const useStyles = makeStyles( | ||
({ constants }: CSFTheme) => { | ||
return createStyles({ | ||
root: { | ||
padding: `${constants.generalUnit * 6}px ${constants.generalUnit * 4}px`, | ||
flexDirection: "column", | ||
display: "flex", | ||
alignItems: "center" | ||
}, | ||
title: { | ||
marginBottom: constants.generalUnit * 3 | ||
}, | ||
modalInner: { | ||
maxWidth: "600px !important" | ||
}, | ||
buttonContainer: { | ||
width: "100%" | ||
}, | ||
nextButton: { | ||
margin: "auto", | ||
marginTop: constants.generalUnit * 3 | ||
} | ||
}) | ||
}) | ||
|
||
interface Props { | ||
onHide: () => void | ||
} | ||
|
||
const BetaModal = ({ onHide }: Props) => { | ||
const classes = useStyles() | ||
|
||
const onFormdButtonClick = useCallback(() => { | ||
window.open(ROUTE_LINKS.DiscordInvite, "_blank") | ||
onHide() | ||
}, [onHide]) | ||
|
||
return ( | ||
<CustomModal | ||
injectedClass={{ inner: classes.modalInner }} | ||
active={true} | ||
closePosition="right" | ||
maxWidth="sm" | ||
onClose={onHide} | ||
mobileStickyBottom={false} | ||
> | ||
<div className={classes.root}> | ||
<Typography | ||
variant="h2" | ||
className={classes.title} | ||
> | ||
<Trans>Need more storage?</Trans> | ||
</Typography> | ||
<Typography variant="h4"> | ||
<Trans> | ||
Join our new limited-access subscription plans to upgrade to a plan with more storage. | ||
</Trans> | ||
</Typography> | ||
<div className={classes.buttonContainer}> | ||
<Button | ||
data-posthog="Subscription-whitelist-form" | ||
className={classes.nextButton} | ||
onClick={onFormdButtonClick} | ||
> | ||
<Trans>Request access!</Trans> | ||
</Button> | ||
</div> | ||
</div> | ||
</CustomModal> | ||
)} | ||
|
||
export default BetaModal |
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
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
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