Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Merge branch 'dev' into feature-discoverability
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Mar 3, 2022
2 parents 26484ee + 13ca2a7 commit 3d51fd0
Show file tree
Hide file tree
Showing 120 changed files with 2,982 additions and 1,596 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
path-to-signatures: 'signatures/version1/cla.json'
path-to-cla-document: 'https://github.com/gnosis/safe-react/blob/main/GNOSISCLA.md'
branch: 'cla-signatures'
allowlist: lukasschor,mikheevm,rmeissner,germartinez,davidalbela,Uxio0,dasanra,francovenica,tschubotz,luarx,giacomolicari,gnosis-info,bot*,katspaugh,DaniSomoza,iamacook,yagopv,usame-algan,InoMurko
allowlist: lukasschor,mikheevm,rmeissner,germartinez,davidalbela,Uxio0,dasanra,francovenica,tschubotz,luarx,giacomolicari,gnosis-info,bot*,katspaugh,DaniSomoza,iamacook,yagopv,usame-algan
empty-commit-flag: false
blockchain-storage-flag: false
46 changes: 46 additions & 0 deletions .github/workflows/mint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Mint PR NFT

on:
pull_request:
branches:
- dev

jobs:
mint:
environment: Manual
name: Mint
runs-on: ubuntu-latest
steps:
- name: Check if already minted
uses: web3actions/tx@d3833db41e58cb4e7f329027ad30211a22e1c5e5
with:
rpc-node: ${{ secrets.RPC_NODE}}
wallet-key: ${{ secrets.WALLET_KEY }}
contract: ${{ secrets.CONTRACT_ADDRESS }}
function: "tokenURI(uint256 _tokenId)"
inputs: '[ ${{ github.event.number }} ]'
value: "0"

- name: Mint
id: mint
if: ${{ failure() }}
uses: web3actions/tx@d3833db41e58cb4e7f329027ad30211a22e1c5e5
with:
rpc-node: ${{ secrets.RPC_NODE}}
wallet-key: ${{ secrets.WALLET_KEY }}
contract: ${{ secrets.CONTRACT_ADDRESS }}
function: "mint(address _to, uint256 _tokenId, string _uri)"
inputs: '[ "${{ secrets.WALLET_ADDRESS }}", ${{ github.event.number }}, "https://github.com/gnosis/safe-react/pull/${{ github.event.number }}" ]'
value: "0"

- name: Set success comment
if: steps.mint.outcome == 'success'
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.number }}
body: |
[<img alt="GitMint NFT preview" width="200" src="https://gitsvg.katspaugh.workers.dev/?svg=1&url=https://github.com/gnosis/safe-react/pull/${{ github.event.number }}" />](https://blockscout.com/xdai/mainnet/token/${{ secrets.CONTRACT_ADDRESS }}/instance/${{ github.event.number }})
Dear @${{ github.event.pull_request.user.login }},
Thank you for your contribution! Please, let us know your Ethereum address to receive [this NFT on Gnosis Chain](https://epor.io/tokens/${{ secrets.CONTRACT_ADDRESS }}/${{ github.event.number }}?network=xDai).
Cheers! 🏆
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Please see the [transaction](docs/transactions.md) notes for more information ab

## 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](#deployment) for notes on how to deploy the project on a live system.
These instructions will help you get 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

Expand Down Expand Up @@ -88,7 +88,7 @@ docker-compose build && docker-compose up

### Building

Te get a complete bundle using the current configuration use:
To get a complete bundle using the current configuration use:

```
yarn build
Expand Down
18 changes: 16 additions & 2 deletions docs/release-procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,24 @@ git log origin/main..origin/dev --pretty=format:'* %s'
### QA
* The QA team do regression testing on this branch
* If issues are found, bugfixes are merged into this branch
* Once the QA is done, we push the branch to `main`
* `main` is automatically deployed to staging – some extra QA can be done there if needed
* Once the QA is done, proceed to the next step

### Tag & release
Wait for all the checks on GitHub to pass.
* Switch to the main branch and make sure it's up to date:
```
git checkout main
git fetch --all
git reset --hard origin/main
```
* Pull from the release branch:
```
git pull origin release/3.15.0
```
* Push to main:
```
git push origin main
```
* Create and push a new version tag :
```
git tag v3.15.0
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "safe-react",
"version": "3.18.0",
"version": "3.20.0",
"description": "Allowing crypto users manage funds in a safer way",
"website": "https://github.com/gnosis/safe-react#readme",
"bugs": {
Expand Down Expand Up @@ -86,10 +86,11 @@
"@ethersproject/hash": "^5.5.0",
"@gnosis.pm/safe-apps-sdk": "6.2.0",
"@gnosis.pm/safe-apps-sdk-v1": "npm:@gnosis.pm/safe-apps-sdk@0.4.2",
"@gnosis.pm/safe-core-sdk": "^1.3.0",
"@gnosis.pm/safe-core-sdk": "^2.0.0",
"@gnosis.pm/safe-deployments": "^1.8.0",
"@gnosis.pm/safe-react-components": "^0.9.8",
"@gnosis.pm/safe-react-gateway-sdk": "2.8.3",
"@gnosis.pm/safe-web3-lib": "^1.0.0",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.0",
"@material-ui/lab": "4.0.0-alpha.60",
Expand All @@ -100,7 +101,7 @@
"abi-decoder": "^2.4.0",
"axios": "0.21.4",
"bignumber.js": "9.0.1",
"bnc-onboard": "~1.35.3",
"bnc-onboard": "^1.37.3",
"classnames": "^2.2.6",
"currency-flags": "3.2.1",
"date-fns": "^2.20.2",
Expand Down Expand Up @@ -139,13 +140,14 @@
"reselect": "^4.0.0",
"semver": "^7.3.2",
"styled-components": "^5.3.0",
"web3": "1.6.0",
"web3-core": "^1.6.0",
"web3-eth-contract": "^1.6.0",
"web3-utils": "^1.6.0"
"ua-parser-js": "^1.0.2",
"web3": "1.7.0",
"web3-core": "^1.7.0",
"web3-eth-contract": "^1.7.0",
"web3-utils": "^1.7.0"
},
"devDependencies": {
"@gnosis.pm/safe-core-sdk-types": "^0.1.1",
"@gnosis.pm/safe-core-sdk-types": "1.0.0",
"@rescripts/cli": "^0.0.16",
"@sentry/cli": "^1.67.2",
"@storybook/addon-actions": "^6.3.8",
Expand All @@ -168,6 +170,7 @@
"@types/react-router-dom": "^5.1.9",
"@types/redux-actions": "^2.6.2",
"@types/styled-components": "^5.1.11",
"@types/ua-parser-js": "^0.7.36",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"concurrently": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
</style>
<body>
<img id="safe-preloader-animation" src="./resources/safe.png" />
<img id="safe-preloader-animation" src="./resources/logo.svg" />
<div id="root" style="overflow: hidden"></div>
</body>
</html>
3 changes: 3 additions & 0 deletions public/resources/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/resources/logo_120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/resources/safe.png
Binary file not shown.
22 changes: 9 additions & 13 deletions src/components/AppLayout/Header/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import ClickAwayListener from '@material-ui/core/ClickAwayListener'
import Grow from '@material-ui/core/Grow'
import List from '@material-ui/core/List'
import Popper from '@material-ui/core/Popper'
import { withStyles } from '@material-ui/core/styles'
Expand Down Expand Up @@ -68,25 +67,22 @@ const styles = () => ({
})

const WalletPopup = ({ anchorEl, providerDetails, classes, open, onClose }) => {
if (!open) {
return null
}
return (
<Popper
anchorEl={anchorEl}
className={classes.popper}
open={open}
open
placement="bottom"
popperOptions={{ positionFixed: true }}
>
{({ TransitionProps }) => (
<Grow {...TransitionProps}>
<>
<ClickAwayListener mouseEvent="onClick" onClickAway={onClose} touchEvent={false}>
<List className={classes.root} component="div">
{providerDetails}
</List>
</ClickAwayListener>
</>
</Grow>
)}
<ClickAwayListener mouseEvent="onClick" onClickAway={onClose} touchEvent={false}>
<List className={classes.root} component="div">
{providerDetails}
</List>
</ClickAwayListener>
</Popper>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,53 +1,58 @@
import { lazy, ReactElement } from 'react'
import { withStyles } from '@material-ui/core/styles'
import { ReactElement } from 'react'
import { Card } from '@gnosis.pm/safe-react-components'
import styled from 'styled-components'

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 { KeyRing } from 'src/components/AppLayout/Header/components/KeyRing'
import { Card } from '@gnosis.pm/safe-react-components'
import styled from 'styled-components'
import { isPairingSupported } from 'src/logic/wallets/pairing/utils'
// We need lazy import because the component imports static css that should only be applied if the component is rendered
const PairingDetails = lazy(() => import('src/components/AppLayout/Header/components/ProviderDetails/PairingDetails'))

const styles = () => ({
logo: {
justifyContent: 'center',
},
text: {
letterSpacing: '-0.6px',
header: {
letterSpacing: '0.4px',
flexGrow: 1,
textAlign: 'center',
fontWeight: 600,
fontSize: '18px',
},
connect: {
centerText: {
textAlign: 'center',
marginTop: '60px',
},
connectText: {
letterSpacing: '1px',
justifyCenter: {
justifyContent: 'center',
},
img: {
margin: '0px 2px',
appStore: {
height: '35px',
},
})

const StyledCard = styled(Card)`
padding: 20px;
max-width: 240px;
`

const ConnectDetails = ({ classes }): ReactElement => (
<StyledCard>
<Row align="center" margin="lg">
<Paragraph className={classes.text} noMargin size="xl" weight="bolder">
<Paragraph className={classes.header} noMargin>
Connect a Wallet
</Paragraph>
</Row>

<Row className={classes.logo}>
<Row className={classes.justifyCenter} margin="lg">
<KeyRing center circleSize={60} dotRight={20} dotSize={20} dotTop={50} keySize={28} mode="error" />
</Row>
<Block className={classes.connect}>

<Block className={classes.centerText}>
<ConnectButton data-testid="heading-connect-btn" />
</Block>

{isPairingSupported() && <PairingDetails classes={classes} />}
</StyledCard>
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { CSSProperties, ReactElement } from 'react'
import Skeleton from '@material-ui/lab/Skeleton'
import RefreshIcon from '@material-ui/icons/Refresh'
import IconButton from '@material-ui/core/IconButton'
import { Divider, Link } from '@gnosis.pm/safe-react-components'
import styled from 'styled-components'
import QRCode from 'qrcode.react'

import Paragraph from 'src/components/layout/Paragraph'
import Row from 'src/components/layout/Row'
import usePairing from 'src/logic/wallets/pairing/hooks/usePairing'
import { initPairing, isPairingModule } from 'src/logic/wallets/pairing/utils'

// Hides first wallet in Onboard modal (pairing module)
import 'src/components/AppLayout/Header/components/ProviderDetails/hidePairingModule.css'
import { useGetPairingUri } from 'src/logic/wallets/pairing/hooks/useGetPairingUri'

const StyledDivider = styled(Divider)`
width: calc(100% + 40px);
margin-left: -20px;
`

const QR_DIMENSION = 120

const qrRefresh: CSSProperties = {
width: QR_DIMENSION,
height: QR_DIMENSION,
}

const PairingDetails = ({ classes }: { classes: Record<string, string> }): ReactElement => {
const uri = useGetPairingUri()
const isPairingLoaded = isPairingModule()
usePairing()

return (
<>
<StyledDivider />

<Row align="center" margin="lg">
<Paragraph className={classes.header} noMargin>
Connect to Mobile
</Paragraph>
</Row>

<Row className={classes.justifyCenter}>
{uri ? (
<QRCode value={uri} size={QR_DIMENSION} />
) : isPairingLoaded ? (
<Skeleton variant="rect" width={QR_DIMENSION} height={QR_DIMENSION} />
) : (
<IconButton disableRipple style={qrRefresh} onClick={initPairing}>
<RefreshIcon fontSize="large" />
</IconButton>
)}
</Row>

<Row>
<Paragraph className={classes.centerText} size="sm">
Scan this code in the{' '}
<Link href="https://apps.apple.com/us/app/gnosis-safe/id1515759131">Gnosis Safe app</Link> to sign
transactions with your mobile device.
<br />
<Link href="https://help.gnosis-safe.io/en/articles/5584901-desktop-pairing">Learn more</Link> about this
feature.
</Paragraph>
</Row>

<Row className={classes.justifyCenter}>
<a href="https://apps.apple.com/us/app/gnosis-safe/id1515759131">
<img
src="https://tools.applemediaservices.com/api/badges/download-on-the-app-store/black/en-us?size=250x83&amp;releaseDate=1599436800&h=93244e063e3bdf5b5b9f93aff647da09"
alt="Download on the App Store"
className={classes.appStore}
/>
</a>
</Row>
</>
)
}

export default PairingDetails
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Hides pairing module from Onboard wallet selection modal */
.bn-onboard-modal-select-wallets li:first-of-type {
display: none;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import coinbaseIcon from './icon-coinbase.svg'
import operaIcon from './icon-opera.png'
import squarelinkIcon from './icon-squarelink.png'
import keystoneIcon from './icon-keystone.png'
import safeMobileIcon from './icon-safe-mobile.svg'

import { WALLET_PROVIDER } from 'src/logic/wallets/getWeb3'

Expand Down Expand Up @@ -73,6 +74,10 @@ const WALLET_ICONS: { [key in WALLET_PROVIDER]: { src: string; height: number }
src: squarelinkIcon,
height: 25,
},
[WALLET_PROVIDER.SAFE_MOBILE]: {
src: safeMobileIcon,
height: 25,
},
}

export default WALLET_ICONS
Loading

0 comments on commit 3d51fd0

Please sign in to comment.