This repository was archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 357
(Feature) Spending Limit #1637
Merged
Merged
(Feature) Spending Limit #1637
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
e47e39e
add spendingLimit contract artifact
fernandomg 57628d6
add notifications for SpendingLimit
fernandomg 2937a6a
add `label` parameter to AddressBookInput
fernandomg 8100755
add typing to TokenSelectField
fernandomg ef12de1
create helper functions for spendingLimit
fernandomg 37c4564
add enableModule method
fernandomg bafc75e
fetch and store spendingLimit information
fernandomg 38a051f
add spendingLimit module address
fernandomg 85fcfc8
add SpendingLimit in Advanced settings
fernandomg f6efa60
add spendingLimit feature to the SendFunds modal
fernandomg c5d6f11
refactor methods decodes
fernandomg 09afbd5
add typings
fernandomg 0b89465
identify module txs
fernandomg e9ab1c3
add module selector
fernandomg c135a04
adapt tx list to spending limit
fernandomg 9fa795d
Merge branch 'development' into feature/413-spendingLimit
b723730
update reset time label
fernandomg 07bd387
fix typo
fernandomg 03c95ee
remove `adjustAmountToToken` function
fernandomg 2e2caae
standardize keyboard navigation handling for addressBookInput wrappers
fernandomg 7d79ea3
replace string comparison with `sameString`/`sameAddress` function calls
fernandomg b33de17
extract compatibility-added types into a particular type
fernandomg 0e64bb0
add an explanatory text next to 'reset time' toggle
fernandomg b15a531
add an explanatory text next to 'reset time' toggle
fernandomg b4f0aff
fix to display token info despite it has being disabled in the assets…
fernandomg aad9ba9
Merge branch 'development' into feature/413-spendingLimit
fernandomg 3012125
fix unit conversion
fernandomg 92bfd10
fix token selector, by adding a new selector that includes the native…
fernandomg 95e75b3
Merge remote-tracking branch 'origin/feature/413-spendingLimit' into …
fernandomg f04dccb
Merge branch 'development' into feature/413-spendingLimit
fernandomg 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
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,52 +1,70 @@ | ||
| import Modal from '@material-ui/core/Modal' | ||
| import { withStyles } from '@material-ui/core/styles' | ||
| import { makeStyles, createStyles } from '@material-ui/core/styles' | ||
| import cn from 'classnames' | ||
| import * as React from 'react' | ||
| import React, { ReactElement, ReactNode } from 'react' | ||
|
|
||
| import { sm } from 'src/theme/variables' | ||
|
|
||
| const styles = () => ({ | ||
| root: { | ||
| alignItems: 'center', | ||
| justifyContent: 'center', | ||
| display: 'flex', | ||
| overflowY: 'scroll', | ||
| }, | ||
| paper: { | ||
| position: 'absolute', | ||
| top: '120px', | ||
| width: '500px', | ||
| height: '540px', | ||
| borderRadius: sm, | ||
| backgroundColor: '#ffffff', | ||
| boxShadow: '0 0 5px 0 rgba(74, 85, 121, 0.5)', | ||
| '&:focus': { | ||
| outline: 'none', | ||
| const useStyles = makeStyles( | ||
| createStyles({ | ||
| root: { | ||
| alignItems: 'center', | ||
| justifyContent: 'center', | ||
| display: 'flex', | ||
| overflowY: 'scroll', | ||
| }, | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| }, | ||
| }) | ||
| paper: { | ||
| position: 'absolute', | ||
| top: '120px', | ||
| width: '500px', | ||
| height: '540px', | ||
| borderRadius: sm, | ||
| backgroundColor: '#ffffff', | ||
| boxShadow: '0 0 5px 0 rgba(74, 85, 121, 0.5)', | ||
| '&:focus': { | ||
| outline: 'none', | ||
| }, | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| }, | ||
| }), | ||
| ) | ||
|
|
||
| interface GnoModalProps { | ||
| children: ReactNode | ||
| description: string | ||
| // type copied from Material-UI Modal's `close` prop | ||
| handleClose?: { | ||
| bivarianceHack(event: Record<string, unknown>, reason: 'backdropClick' | 'escapeKeyDown'): void | ||
| }['bivarianceHack'] | ||
| modalClassName?: string | ||
| open: boolean | ||
| paperClassName?: string | ||
| title: string | ||
| } | ||
|
|
||
| const GnoModal = ({ | ||
| children, | ||
| classes, | ||
| description, | ||
| handleClose, | ||
| modalClassName, | ||
| open, | ||
| paperClassName, | ||
| title, | ||
| }: any) => ( | ||
| <Modal | ||
| aria-describedby={description} | ||
| aria-labelledby={title} | ||
| className={cn(classes.root, modalClassName)} | ||
| onClose={handleClose} | ||
| open={open} | ||
| > | ||
| <div className={cn(classes.paper, paperClassName)}>{children}</div> | ||
| </Modal> | ||
| ) | ||
| }: GnoModalProps): ReactElement => { | ||
| const classes = useStyles() | ||
|
|
||
| return ( | ||
| <Modal | ||
| aria-describedby={description} | ||
| aria-labelledby={title} | ||
| className={cn(classes.root, modalClassName)} | ||
| onClose={handleClose} | ||
| open={open} | ||
| > | ||
| <div className={cn(classes.paper, paperClassName)}>{children}</div> | ||
| </Modal> | ||
| ) | ||
| } | ||
|
|
||
| export default withStyles(styles as any)(GnoModal) | ||
| export default GnoModal | ||
This file contains hidden or 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.
🧙🏻♀️