Skip to content

Commit 223fa20

Browse files
authored
Merge pull request #70 from celo-tools/1.3.6
- Fix proposal fetching bug - Add ramp to funding options - Upgrade walletconnect to 17.beta.3 - Rebrand account key to recovery phrase
2 parents f6a0a25 + 7c4d371 commit 223fa20

33 files changed

Lines changed: 364 additions & 212 deletions

electron/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function setCspHeader() {
6767
...details.responseHeaders,
6868
// Should match header in /netlify/_headers and build.sh
6969
'Content-Security-Policy': [
70-
"default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org wss://walletconnect.celo.org https://api.github.com; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'",
70+
"default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org wss://walletconnect.celo.org wss://relay.walletconnect.org https://api.github.com; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'",
7171
],
7272
},
7373
})

netlify/_headers

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Configure Netlify custom headers
22
# CSP header should match electron copy in /electron/main.js
33
/*
4-
Content-Security-Policy: default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org wss://walletconnect.celo.org; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'
5-
X-Frame-Options: DENY
4+
Content-Security-Policy: default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org wss://walletconnect.celo.org wss://relay.walletconnect.org; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'
5+
X-Frame-Options: DENY
6+
X-Content-Type-Options: nosniff

package-electron.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "celo-web-wallet",
3-
"version": "1.3.5",
3+
"version": "1.3.6",
44
"description": "A lightweight web and desktop wallet for the Celo network",
55
"main": "main.js",
66
"keywords": [

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "celo-web-wallet",
3-
"version": "1.3.5",
3+
"version": "1.3.6",
44
"description": "A lightweight web and desktop wallet for the Celo network",
55
"keywords": [
66
"Celo",
@@ -38,7 +38,7 @@
3838
"@ledgerhq/hw-transport-webusb": "^5.51.1",
3939
"@metamask/jazzicon": "https://github.com/jmrossy/jazzicon#7a8df28",
4040
"@reduxjs/toolkit": "^1.6.1",
41-
"@walletconnect/client": "2.0.0-beta.10",
41+
"@walletconnect/client": "2.0.0-beta.17.3",
4242
"buffer": "^6.0.3",
4343
"electron-updater": "^4.3.9",
4444
"ethers": "^5.3.0",

src/app/logout/useLogoutModal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export async function showLogoutModal(
1717
const answer = await showModalAsync({
1818
head: 'WALLET RESET WARNING',
1919
subHead: 'Are you sure you want to logout?',
20-
body: 'All keys and information for ALL OF YOUR ACCOUNTS will be completely removed from this device. If you have local accounts, back up their Account Keys first.',
20+
body: 'All keys and information for ALL OF YOUR ACCOUNTS will be completely removed from this device. If you have local accounts, back up their recovery (seed) phrase first.',
2121
actions: [
2222
{ key: 'cancel', label: 'Cancel', color: Color.primaryWhite },
2323
{ key: 'logout', label: 'Log me out', color: Color.primaryRed },

src/components/FundWalletModal.tsx

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ import Bittrex from 'src/components/icons/logos/bittrex.svg'
33
import Coinbase from 'src/components/icons/logos/coinbase.svg'
44
import Coinlist from 'src/components/icons/logos/coinlist.svg'
55
import Okcoin from 'src/components/icons/logos/okcoin.svg'
6+
import Okex from 'src/components/icons/logos/okex.svg'
7+
import Ramp from 'src/components/icons/logos/ramp.svg'
68
import Simplex from 'src/components/icons/logos/simplex.svg'
7-
import { ModalLinkGrid } from 'src/components/modal/ModalLinkGrid'
9+
import { Box } from 'src/components/layout/Box'
10+
import { ModalLinkGrid, SmallGridLink } from 'src/components/modal/ModalLinkGrid'
811
import { useModal } from 'src/components/modal/useModal'
12+
import { RAMP_PROJECT_ID } from 'src/consts'
913

1014
export function useFundWalletModal() {
1115
const { showModalWithContent } = useModal()
@@ -19,12 +23,25 @@ export function useFundWalletModal() {
1923
}
2024

2125
export function FundWalletModal({ address }: { address: string }) {
22-
const links = [
26+
const bigLinks = [
27+
{
28+
url: `https://buy.ramp.network/?hostAppName=CeloWallet&hostLogoUrl=https%3A%2F%2Fcelowallet.app%2Fstatic%2Ficon.png&defaultAsset=CELO&userAddress=${address}&hostApiKey=${RAMP_PROJECT_ID}`,
29+
imgSrc: Ramp,
30+
text: 'Ramp',
31+
subText: 'No Fees!',
32+
},
2333
{
2434
url: 'https://www.coinbase.com/earn/celo',
2535
imgSrc: Coinbase,
2636
text: 'Coinbase',
2737
},
38+
{
39+
url: `https://valoraapp.com/simplex?address=${address}`,
40+
imgSrc: Simplex,
41+
text: 'Simplex',
42+
},
43+
]
44+
const smallLinks = [
2845
{
2946
url: 'https://global.bittrex.com/Market/Index?MarketName=USD-CELO',
3047
imgSrc: Bittrex,
@@ -41,15 +58,24 @@ export function FundWalletModal({ address }: { address: string }) {
4158
text: 'Binance',
4259
},
4360
{
44-
url: `https://valoraapp.com/simplex?address=${address}`,
45-
imgSrc: Simplex,
46-
text: 'Simplex',
61+
url: 'https://www.okex.com/markets/spot-info/celo-usdt',
62+
imgSrc: Okex,
63+
text: 'Okex',
4764
},
4865
{
4966
url: 'https://coinlist.co/asset/celo',
5067
imgSrc: Coinlist,
5168
text: 'Coinlist',
5269
},
5370
]
54-
return <ModalLinkGrid links={links} />
71+
return (
72+
<div>
73+
<ModalLinkGrid links={bigLinks} />
74+
<Box align="center" justify="center" wrap margin="1em 0 1em 0">
75+
{smallLinks.map((link, index) => (
76+
<SmallGridLink link={link} key={`ModalLinkGridSm-link-${index}`} />
77+
))}
78+
</Box>
79+
</div>
80+
)
5581
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/components/modal/ModalLinkGrid.tsx

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@ import { Color } from 'src/styles/Color'
33
import { mq } from 'src/styles/mediaQueries'
44
import { Stylesheet } from 'src/styles/types'
55

6+
interface GridLink {
7+
url: string
8+
imgSrc: string
9+
text: string
10+
subText?: string
11+
altText?: string
12+
}
13+
614
interface ModalLinkGridProps {
7-
links: Array<{ url: string; imgSrc: string; text: string; altText?: string }>
15+
links: Array<GridLink>
816
}
917

1018
export function ModalLinkGrid({ links }: ModalLinkGridProps) {
@@ -18,19 +26,38 @@ export function ModalLinkGrid({ links }: ModalLinkGridProps) {
1826
wrap
1927
>
2028
{links.map((link, index) => (
21-
<Box key={`ModalLinkGrid-link-${index}`} align="center" justify="center">
22-
<a css={style.link} href={link.url} target="_blank" rel="noopener noreferrer">
23-
<Box direction="column" align="center" justify="center" styles={style.linkContent}>
24-
<img src={link.imgSrc} css={style.icon} alt={link.altText || link.text} />
25-
<div>{link.text}</div>
26-
</Box>
27-
</a>
28-
</Box>
29+
<BigGridLink link={link} key={`ModalLinkGrid-link-${index}`} />
2930
))}
3031
</Box>
3132
)
3233
}
3334

35+
function BigGridLink({ link }: { link: GridLink }) {
36+
return (
37+
<Box align="center" justify="center">
38+
<a css={style.link} href={link.url} target="_blank" rel="noopener noreferrer">
39+
<Box direction="column" align="center" justify="center" styles={style.linkContent}>
40+
<img src={link.imgSrc} css={style.icon} alt={link.altText || link.text} />
41+
<div>{link.text}</div>
42+
{link.subText && <div css={style.subText}>{link.subText}</div>}
43+
</Box>
44+
</a>
45+
</Box>
46+
)
47+
}
48+
49+
export function SmallGridLink({ link }: { link: GridLink }) {
50+
return (
51+
<Box align="center" justify="center">
52+
<a css={style.link} href={link.url} target="_blank" rel="noopener noreferrer">
53+
<Box direction="column" align="center" justify="center" styles={styleSm.linkContent}>
54+
<img src={link.imgSrc} css={styleSm.icon} alt={link.altText || link.text} />
55+
</Box>
56+
</a>
57+
</Box>
58+
)
59+
}
60+
3461
const style: Stylesheet = {
3562
container: {
3663
maxWidth: '30em',
@@ -68,4 +95,34 @@ const style: Stylesheet = {
6895
width: '3em',
6996
},
7097
},
98+
subText: {
99+
fontSize: '0.8em',
100+
color: Color.primaryGreen,
101+
marginTop: '0.3em',
102+
},
103+
}
104+
105+
const styleSm: Stylesheet = {
106+
linkContent: {
107+
...style.linkContent,
108+
width: '2.8em',
109+
height: '2.8em',
110+
margin: '0 0.4em',
111+
[mq[480]]: {
112+
width: '2.9em',
113+
height: '2.9em',
114+
margin: '0 0.5em',
115+
},
116+
[mq[768]]: {
117+
width: '3em',
118+
height: '3em',
119+
margin: '0 0.7em',
120+
},
121+
},
122+
icon: {
123+
width: '1.8em',
124+
[mq[768]]: {
125+
width: '2em',
126+
},
127+
},
71128
}

src/consts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ export const DONATION_ADDRESS = '0xE3791A4a231D026c9567BEDbAb977617f2900383' //
5757

5858
export const GOVERNANCE_GITHUB_BASEURL =
5959
'https://api.github.com/repos/celo-org/governance/contents/CGPs/'
60+
61+
export const RAMP_PROJECT_ID = 'jg2gy6y7o35np2w7npw9jnszaz962z3dxhpso4hq'

0 commit comments

Comments
 (0)