diff --git a/.env.example b/.env.example index 266bbc27..ba240349 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,6 @@ REACT_APP_NETWORK= REACT_APP_GOOGLE_ANALYTICS= REACT_APP_INFURA_TOKEN= REACT_APP_IPFS_GATEWAY=https://ipfs.io/ipfs -PUBLIC_URL=/app/ REACT_APP_SENTRY_DSN= # For production environments diff --git a/package.json b/package.json index 61d94146..5c7b64f5 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,7 @@ "@gnosis.pm/safe-apps-sdk": "1.0.3", "@gnosis.pm/safe-apps-sdk-v1": "npm:@gnosis.pm/safe-apps-sdk@0.4.2", "@gnosis.pm/safe-contracts": "1.1.1-dev.2", - "@gnosis.pm/safe-react-components": "https://github.com/gnosis/safe-react-components.git#80f5db6", + "@gnosis.pm/safe-react-components": "https://github.com/gnosis/safe-react-components.git#2e427ee", "@gnosis.pm/util-contracts": "2.0.6", "@ledgerhq/hw-transport-node-hid-singleton": "5.45.0", "@material-ui/core": "^4.11.0", diff --git a/readme.md b/readme.md index dbd62775..a7bf34d3 100644 --- a/readme.md +++ b/readme.md @@ -4,16 +4,14 @@ The most trusted platform to store digital assets on Ethereum ## Getting Started -These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See [Deployment](#deployment) for notes on how to deploy the project on a live system. ### Prerequisites -What things you need to install the software and how to install them +What things you need to install globally: ``` -yarn add truffle // recommended usage of -g flag -yarn add ganache-cli // recommended usage of -g flag -yarn add flow-type // recommended usage of -g flag +yarn global add truffle ganache-cli ``` We use [yarn](https://yarnpkg.com) in our infrastacture, so we decided to go with yarn in the README @@ -37,6 +35,18 @@ If you prefer using Mainnet ones: yarn start-mainnet ``` +### Environment variables +The app grabs environment variables from the `.env` file. Copy our template to your own local file: +``` +cp .env.example .env +``` + +To execute transactions, you'll need to create an [Infura](https://infura.io) project and set the project ID in the `.env` you've just created: +``` +REACT_APP_INFURA_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +``` +Once done, you'll need to restart the app. + ### Building For Rinkeby: ``` @@ -120,7 +130,7 @@ Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c6 ## Versioning -We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/gnosis/gnosis-team-safe/tags). +We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/gnosis/gnosis-team-safe/tags). ## Authors diff --git a/src/components/AddressInfo/index.tsx b/src/components/AddressInfo/index.tsx deleted file mode 100644 index 8e08f2b7..00000000 --- a/src/components/AddressInfo/index.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import React from 'react' -import { getExplorerInfo, getNetworkInfo } from 'src/config' -import CopyBtn from 'src/components/CopyBtn' -import Identicon from 'src/components/Identicon' -import Block from 'src/components/layout/Block' -import Bold from 'src/components/layout/Bold' -import Paragraph from 'src/components/layout/Paragraph' -import { border, xs } from 'src/theme/variables' -import styled from 'styled-components' -import { ExplorerButton } from '@gnosis.pm/safe-react-components' - -const Wrapper = styled.div` - display: flex; - align-items: center; - - .icon-section { - margin-right: 10px; - } - - .data-section { - display: flex; - flex-direction: column; - - .address { - display: flex; - } - } -` -const StyledBlock = styled(Block)` - font-size: 12px; - line-height: 1.08; - letter-spacing: -0.5; - background-color: ${border}; - width: fit-content; - padding: 5px 10px; - margin-top: ${xs}; - border-radius: 3px; -` -interface Props { - safeName?: string - safeAddress: string - ethBalance?: string -} - -const { nativeCoin } = getNetworkInfo() - -const AddressInfo = ({ ethBalance, safeAddress, safeName }: Props): React.ReactElement => { - return ( - -
- -
-
- {safeName && ( - - {safeName} - - )} -
- - {safeAddress} - - - -
- {ethBalance && ( - - - Balance: {`${ethBalance} ${nativeCoin.symbol}`} - - - )} -
-
- ) -} - -export default AddressInfo diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index ae64a97d..158725fe 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -50,12 +50,6 @@ const notificationStyles = { info: { background: '#fff', }, - receiveModal: { - height: 'auto', - maxWidth: 'calc(100% - 30px)', - minHeight: '544px', - overflow: 'hidden', - }, } const Frame = styled.div` @@ -149,7 +143,7 @@ const App: React.FC = ({ children }) => { description="Receive Tokens Form" handleClose={onReceiveHide} open={safeActionsState.showReceive} - paperClassName={classes.receiveModal} + paperClassName="receive-modal" title="Receive Tokens" > diff --git a/src/components/AppLayout/Header/components/Layout.tsx b/src/components/AppLayout/Header/components/Layout.tsx index 85051334..fae9690d 100644 --- a/src/components/AppLayout/Header/components/Layout.tsx +++ b/src/components/AppLayout/Header/components/Layout.tsx @@ -12,7 +12,7 @@ import Spacer from 'src/components/Spacer' import Col from 'src/components/layout/Col' import Img from 'src/components/layout/Img' import Row from 'src/components/layout/Row' -import { border, headerHeight, md, screenSm, sm } from 'src/theme/variables' +import { headerHeight, md, screenSm, sm } from 'src/theme/variables' import { useStateHandler } from 'src/logic/hooks/useStateHandler' import SafeLogo from '../assets/gnosis-safe-multisig-logo.svg' @@ -29,8 +29,6 @@ const styles = () => ({ summary: { alignItems: 'center', backgroundColor: 'white', - borderBottom: `solid 2px ${border}`, - boxShadow: '0 2px 4px 0 rgba(212, 212, 211, 0.59)', flexWrap: 'nowrap', height: headerHeight, position: 'fixed', diff --git a/src/components/AppLayout/Header/components/ProviderDetails/ConnectDetails.tsx b/src/components/AppLayout/Header/components/ProviderDetails/ConnectDetails.tsx index 0b52d4e5..e3ebe602 100644 --- a/src/components/AppLayout/Header/components/ProviderDetails/ConnectDetails.tsx +++ b/src/components/AppLayout/Header/components/ProviderDetails/ConnectDetails.tsx @@ -6,13 +6,11 @@ import ConnectButton from 'src/components/ConnectButton' import Block from 'src/components/layout/Block' import Paragraph from 'src/components/layout/Paragraph' import Row from 'src/components/layout/Row' -import { lg, md } from 'src/theme/variables' import { KeyRing } from 'src/components/AppLayout/Header/components/KeyRing' +import { Card } from '@gnosis.pm/safe-react-components' +import styled from 'styled-components' const styles = () => ({ - container: { - padding: `${md} 12px`, - }, logo: { justifyContent: 'center', }, @@ -22,8 +20,8 @@ const styles = () => ({ textAlign: 'center', }, connect: { - padding: `${md} ${lg}`, textAlign: 'center', + marginTop: '60px', }, connectText: { letterSpacing: '1px', @@ -33,22 +31,24 @@ const styles = () => ({ }, }) +const StyledCard = styled(Card)` + padding: 20px; +` const ConnectDetails = ({ classes }) => ( - <> -
- - - Connect a Wallet - - -
- - + + + + Connect a Wallet + + + + + - + ) export default withStyles(styles as any)(ConnectDetails) diff --git a/src/components/AppLayout/Header/components/ProviderDetails/UserDetails.tsx b/src/components/AppLayout/Header/components/ProviderDetails/UserDetails.tsx index d50fa6cf..1598904f 100644 --- a/src/components/AppLayout/Header/components/ProviderDetails/UserDetails.tsx +++ b/src/components/AppLayout/Header/components/ProviderDetails/UserDetails.tsx @@ -2,7 +2,7 @@ import { makeStyles } from '@material-ui/core/styles' import Dot from '@material-ui/icons/FiberManualRecord' import classNames from 'classnames' import * as React from 'react' -import { EthHashInfo, Identicon } from '@gnosis.pm/safe-react-components' +import { EthHashInfo, Identicon, Card } from '@gnosis.pm/safe-react-components' import Spacer from 'src/components/Spacer' import Block from 'src/components/layout/Block' @@ -18,6 +18,7 @@ import { getExplorerInfo } from 'src/config' import { KeyRing } from 'src/components/AppLayout/Header/components/KeyRing' import { CircleDot } from '../CircleDot' import { createStyles } from '@material-ui/core' +import styled from 'styled-components' import WalletIcon from '../../assets/wallet.svg' @@ -91,6 +92,9 @@ const styles = createStyles({ }, }) +const StyledCard = styled(Card)` + padding: 0px; +` type Props = { connected: boolean network: ETHEREUM_NETWORK @@ -116,11 +120,11 @@ export const UserDetails = ({ const classes = useStyles() return ( - <> + {connected ? ( - + ) : ( )} @@ -185,11 +189,11 @@ export const UserDetails = ({ variant="contained" data-testid="disconnect-btn" > - + Disconnect - + ) } diff --git a/src/components/AppLayout/Header/components/ProviderInfo/ProviderAccessible.tsx b/src/components/AppLayout/Header/components/ProviderInfo/ProviderAccessible.tsx index 563c3abb..e4720113 100644 --- a/src/components/AppLayout/Header/components/ProviderInfo/ProviderAccessible.tsx +++ b/src/components/AppLayout/Header/components/ProviderInfo/ProviderAccessible.tsx @@ -89,8 +89,8 @@ const ProviderInfo = ({ connected, provider, userAddress }: ProviderInfoProps): diff --git a/src/components/AppLayout/Sidebar/SafeHeader/index.tsx b/src/components/AppLayout/Sidebar/SafeHeader/index.tsx index 149f7d84..fad57d55 100644 --- a/src/components/AppLayout/Sidebar/SafeHeader/index.tsx +++ b/src/components/AppLayout/Sidebar/SafeHeader/index.tsx @@ -45,7 +45,7 @@ const IconContainer = styled.div` ` const StyledButton = styled(Button)` &&.MuiButton-root { - padding: 0 16px; + padding: 0 12px; } *:first-child { margin: 0 4px 0 0; @@ -170,7 +170,7 @@ const SafeHeader = ({ {balance} - + New transaction diff --git a/src/components/AppLayout/index.tsx b/src/components/AppLayout/index.tsx index e70a31b4..72fb20a0 100644 --- a/src/components/AppLayout/index.tsx +++ b/src/components/AppLayout/index.tsx @@ -17,16 +17,16 @@ const Container = styled.div` ` const HeaderWrapper = styled.nav` - height: 54px; + height: 52px; width: 100%; - z-index: 1; + z-index: 2; background-color: white; - box-shadow: 0 0 4px 0 rgba(212, 212, 211, 0.59); + box-shadow: 0 2px 4px 0 rgba(40, 54, 61, 0.18); ` const BodyWrapper = styled.div` - height: calc(100% - 54px); + height: calc(100% - 52px); width: 100%; display: flex; flex-direction: row; @@ -41,7 +41,7 @@ const SidebarWrapper = styled.aside` padding: 8px 8px 0 8px; background-color: ${({ theme }) => theme.colors.white}; - border-right: 2px solid ${({ theme }) => theme.colors.separator}; + box-shadow: 0 2px 4px 0 rgba(40, 54, 61, 0.18); ` const ContentWrapper = styled.section` diff --git a/src/components/ConnectButton/index.tsx b/src/components/ConnectButton/index.tsx index 4d3c23dd..dc9bbd2e 100644 --- a/src/components/ConnectButton/index.tsx +++ b/src/components/ConnectButton/index.tsx @@ -73,7 +73,7 @@ export const onConnectButtonClick = async () => { } const ConnectButton = (props): React.ReactElement => ( - ) diff --git a/src/components/CookiesBanner/index.tsx b/src/components/CookiesBanner/index.tsx index 9219aab6..781ae6de 100644 --- a/src/components/CookiesBanner/index.tsx +++ b/src/components/CookiesBanner/index.tsx @@ -21,7 +21,7 @@ const useStyles = makeStyles({ container: { backgroundColor: '#fff', bottom: '0', - boxShadow: '0 2px 4px 0 rgba(212, 212, 211, 0.59)', + boxShadow: '1px 2px 10px 0 rgba(40, 54, 61, 0.18)', boxSizing: 'border-box', display: 'flex', justifyContent: 'center', diff --git a/src/components/CustomIconText/index.tsx b/src/components/CustomIconText/index.tsx index 31fc13ba..5cbb94ab 100644 --- a/src/components/CustomIconText/index.tsx +++ b/src/components/CustomIconText/index.tsx @@ -1,5 +1,5 @@ import { Text } from '@gnosis.pm/safe-react-components' -import React from 'react' +import React, { ReactElement } from 'react' import styled from 'styled-components' const Wrapper = styled.div` @@ -12,11 +12,11 @@ const Icon = styled.img` margin-right: 9px; ` -const CustomIconText = ({ iconUrl, text }: { iconUrl: string; text?: string }) => ( +type Props = { iconUrl: string | null | undefined; text?: string } + +export const CustomIconText = ({ iconUrl, text }: Props): ReactElement => ( - + {iconUrl && } {text && {text}} ) - -export default CustomIconText diff --git a/src/components/DecodeTxs/index.tsx b/src/components/DecodeTxs/index.tsx index 8b242e99..703ef001 100644 --- a/src/components/DecodeTxs/index.tsx +++ b/src/components/DecodeTxs/index.tsx @@ -69,7 +69,7 @@ export const BasicTxInfo = ({