Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
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 Nov 18, 2020
57628d6
add notifications for SpendingLimit
fernandomg Nov 18, 2020
2937a6a
add `label` parameter to AddressBookInput
fernandomg Nov 18, 2020
8100755
add typing to TokenSelectField
fernandomg Nov 18, 2020
ef12de1
create helper functions for spendingLimit
fernandomg Nov 18, 2020
37c4564
add enableModule method
fernandomg Nov 18, 2020
bafc75e
fetch and store spendingLimit information
fernandomg Nov 18, 2020
38a051f
add spendingLimit module address
fernandomg Nov 18, 2020
85fcfc8
add SpendingLimit in Advanced settings
fernandomg Nov 18, 2020
f6efa60
add spendingLimit feature to the SendFunds modal
fernandomg Nov 19, 2020
c5d6f11
refactor methods decodes
fernandomg Nov 20, 2020
09afbd5
add typings
fernandomg Nov 20, 2020
0b89465
identify module txs
fernandomg Nov 20, 2020
e9ab1c3
add module selector
fernandomg Nov 20, 2020
c135a04
adapt tx list to spending limit
fernandomg Nov 20, 2020
9fa795d
Merge branch 'development' into feature/413-spendingLimit
Nov 20, 2020
b723730
update reset time label
fernandomg Nov 24, 2020
07bd387
fix typo
fernandomg Nov 24, 2020
03c95ee
remove `adjustAmountToToken` function
fernandomg Nov 24, 2020
2e2caae
standardize keyboard navigation handling for addressBookInput wrappers
fernandomg Nov 24, 2020
7d79ea3
replace string comparison with `sameString`/`sameAddress` function calls
fernandomg Nov 24, 2020
b33de17
extract compatibility-added types into a particular type
fernandomg Nov 24, 2020
0e64bb0
add an explanatory text next to 'reset time' toggle
fernandomg Nov 24, 2020
b15a531
add an explanatory text next to 'reset time' toggle
fernandomg Nov 24, 2020
b4f0aff
fix to display token info despite it has being disabled in the assets…
fernandomg Nov 25, 2020
aad9ba9
Merge branch 'development' into feature/413-spendingLimit
fernandomg Nov 25, 2020
3012125
fix unit conversion
fernandomg Nov 25, 2020
92bfd10
fix token selector, by adding a new selector that includes the native…
fernandomg Nov 25, 2020
95e75b3
Merge remote-tracking branch 'origin/feature/413-spendingLimit' into …
fernandomg Nov 25, 2020
f04dccb
Merge branch 'development' into feature/413-spendingLimit
fernandomg Nov 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ REACT_APP_APP_VERSION=$npm_package_version

# For Apps
REACT_APP_GNOSIS_APPS_URL=https://safe-apps.staging.gnosisdev.com

# Contracts Addresses
REACT_APP_SPENDING_LIMIT_MODULE_ADDRESS=0x9e9Bf12b5a66c0f0A7435835e0365477E121B110

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
"electron-build": "electron-builder --mac --windows --linux",
"electron-dev": "concurrently \"BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron .\"",
"format:staged": "lint-staged",
"generate-types": "yarn generate-types:contracts",
"generate-types": "yarn generate-types:contracts && yarn generate-types:spendingLimit",
"generate-types:contracts": "cross-env typechain --target=web3-v1 --outDir './src/types/contracts' './node_modules/@gnosis.pm/safe-contracts/build/contracts/*.json'",
"generate-types:spendingLimit": "cross-env typechain --target=web3-v1 --outDir './src/types/contracts' ./src/logic/contracts/artifacts/*.json",
"lint:check": "eslint './src/**/*.{js,jsx,ts,tsx}'",
"lint:fix": "yarn lint:check --fix",
"postinstall": "patch-package && electron-builder install-app-deps && yarn generate-types",
Expand Down
90 changes: 54 additions & 36 deletions src/components/Modal/index.tsx
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧙🏻‍♀️

}['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
5 changes: 2 additions & 3 deletions src/components/ScanQRModal/ScanQRWrapper/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { makeStyles } from '@material-ui/core/styles'
import { useState } from 'react'
import * as React from 'react'
import React, { ReactElement, useState } from 'react'

import QRIcon from 'src/assets/icons/qrcode.svg'
import { ScanQRModal } from 'src/components/ScanQRModal'
Expand All @@ -16,7 +15,7 @@ type Props = {
handleScan: (dataResult: string, closeQrModal: () => void) => void
}

export const ScanQRWrapper = ({ handleScan }: Props): React.ReactElement => {
export const ScanQRWrapper = ({ handleScan }: Props): ReactElement => {
const classes = useStyles()
const [qrModalOpen, setQrModalOpen] = useState(false)

Expand Down
Loading