-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Account Restricted #1589
Merged
Merged
Account Restricted #1589
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
df47f9b
Add flag to context
FSM1 84b0f1a
restrict functions when api returns restricted flag
FSM1 19c4cec
fix share modal when restricted
FSM1 ff9ed27
add banner
FSM1 0ea9dd8
lingui
FSM1 7acfd18
move banner to fileList and shared folder overview
FSM1 cd6bd09
use padding instead of margin
FSM1 24adacb
remove unused class
FSM1 89c3e2e
fix linting
FSM1 9615ec4
remove unnecessary css
FSM1 346d245
use constants and left
FSM1 711ce8f
remove stray comma
FSM1 1985419
Update packages/files-ui/src/Components/Layouts/AppWrapper.tsx
FSM1 2ca2ba7
Apply suggestions from code review
FSM1 3d3d7a5
Update packages/files-ui/src/Components/Modules/FileBrowsers/views/Fi…
FSM1 5fe7f47
make font larger on desktop
FSM1 794ada4
Merge branches 'feat/billing-account-blocked-1304' and 'feat/billing-…
FSM1 0c637d2
fix lint
FSM1 0e5e6ef
Update packages/files-ui/src/Components/Elements/RestrictedModeBanner…
FSM1 f8f6cbe
fix spelling
FSM1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
packages/files-ui/src/Components/Elements/RestrictedModeBanner.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,49 @@ | ||
import { Typography, Button, useHistory } from "@chainsafe/common-components" | ||
import { createStyles, makeStyles, useThemeSwitcher } from "@chainsafe/common-theme" | ||
import { Trans } from "@lingui/macro" | ||
import React from "react" | ||
import { CSFTheme } from "../../Themes/types" | ||
import { ROUTE_LINKS } from "../FilesRoutes" | ||
|
||
const useStyles = makeStyles( | ||
({ breakpoints, constants, palette }: CSFTheme) => { | ||
return createStyles({ | ||
accountRestrictedNotification: { | ||
position: "fixed", | ||
bottom: 0, | ||
backgroundColor: palette.additional["gray"][10], | ||
color: palette.additional["gray"][1], | ||
padding: `${constants.generalUnit * 2}px ${constants.generalUnit * 3}px`, | ||
left: 0, | ||
width: "100vw", | ||
[breakpoints.up("md")]: { | ||
left: `${constants.navWidth}px`, | ||
width:`calc(100vw - ${constants.navWidth}px)`, | ||
display: "flex", | ||
justifyContent: "space-between", | ||
alignItems: "center" | ||
} | ||
} | ||
}) | ||
} | ||
) | ||
|
||
const RestrictedModeBanner = () => { | ||
const classes = useStyles() | ||
const { desktop } = useThemeSwitcher() | ||
const { redirect } = useHistory() | ||
|
||
return ( | ||
<div className={classes.accountRestrictedNotification}> | ||
<Typography variant={desktop ? "body1" : "body2"}> | ||
<Trans>You've got a payment due. Until you've settled up, we've placed your account in restricted mode</Trans> | ||
</Typography> | ||
<Button | ||
onClick={() => redirect(ROUTE_LINKS.SettingsPath("plan"))} | ||
fullsize={!desktop}> | ||
<Trans>Go to Payments</Trans> | ||
</Button> | ||
</div>) | ||
} | ||
|
||
export default RestrictedModeBanner |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer the owner's shared folders to be disabled !
Maybe we can have a separate ticket for that !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahhh yeah that is probably doable, though might be a bit confusing for users why certain items are enabled while others are not.