Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: GitHub Pages

on:
push:
branches:
- master
pull_request:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/[email protected]

- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
yarn
yarn build

- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: build # The folder the action should deploy.
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"scripts": {
"typechain": "typechain --target=web3-v1 ./src/abis/**/*.json --out-dir src/generated",
"start": "react-scripts start",
"build": "react-scripts build",
"build": "react-scripts --max_old_space_size=4096 build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"format": "prettier --write .",
Expand All @@ -51,20 +51,22 @@
},
"license": "UNLICENSED",
"dependencies": {
"@celo-tools/use-contractkit": "npm:@poofcash/use-contractkit@^1.0.1",
"@celo-tools/use-contractkit": "npm:@poofcash/use-contractkit@=1.0.11",
"@emotion/react": "^11.4.0",
"@emotion/styled": "^11.3.0",
"@nomspace/nomspace": "^1.0.5",
"@reduxjs/toolkit": "^1.6.0",
"@sentry/react": "^6.7.2",
"@sentry/tracing": "^6.7.2",
"@types/qrcode.react": "^1.0.2",
"@types/react-modal": "^3.13.1",
"@web3-react/injected-connector": "^6.0.7",
"ethers": "^5.4.1",
"phosphor-react": "^1.3.1",
"qrcode.react": "^1.0.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-modal": "^3.14.3",
"react-modal": "^3.14.4",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
Expand All @@ -78,7 +80,7 @@
"*.{html,md,graphql,json,yaml,yml}": "prettier --write"
},
"resolutions": {
"@celo/utils": "1.2.1"
"@celo/wallet-walletconnect": "1.2.0"
},
"eslintConfig": {
"extends": [
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ChainId } from "@celo-tools/use-contractkit";
import { toWei } from "web3-utils";

export const NOM = {
[ChainId.Mainnet]: "0xABf8faBbC071F320F222A526A2e1fBE26429344d",
export const NOM: Record<number, string> = {
[ChainId.Celo]: "0xABf8faBbC071F320F222A526A2e1fBE26429344d",
[ChainId.Alfajores]: "0x36C976Da6A6499Cad683064F849afa69CD4dec2e",
[ChainId.Baklava]: "",
};
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useCUSD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export const useCUSD = () => {
if (!address) {
return null;
}
const cUSD = await kit._web3Contracts.getStableToken(StableToken.cUSD);
const cUSD = await kit._web3Contracts.getStableToken(
StableToken.cUSD as any
);
const allowance = toBN(
await cUSD.methods.allowance(address, FEE_MODULE_V1).call()
);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useUserNoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const useUserNoms = () => {
if (!address) {
return null;
}
const nomKit = new NomKit(kit as any, NOM[network.chainId]);
const nomKit = new NomKit(kit as any, NOM[network.chainId]!);
return await nomKit.userNoms(address);
}, [kit, network.chainId, address]);

Expand Down
9 changes: 7 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import "@celo-tools/use-contractkit/lib/styles.css";
import "react-toastify/dist/ReactToastify.min.css";
import "src/index.css";

import { ContractKitProvider } from "@celo-tools/use-contractkit";
import {
Alfajores,
Celo,
ContractKitProvider,
} from "@celo-tools/use-contractkit";
import * as Sentry from "@sentry/react";
import { Integrations } from "@sentry/tracing";
import React from "react";
Expand All @@ -12,7 +16,7 @@ import { Provider } from "react-redux";
import store from "src/state";
import theme from "src/theme";
import { ThemeProvider } from "theme-ui";
import { BrowserRouter as Router } from "react-router-dom";
import { HashRouter as Router } from "react-router-dom";

import App from "./App";
import * as serviceWorker from "./serviceWorker";
Expand Down Expand Up @@ -46,6 +50,7 @@ ReactDOM.render(
description: "Protocol for name registration",
url: "https://app.nom.space",
icon: "https://www.nom.space/favicon-32x32.png",
supportedNetworks: [Celo, Alfajores],
}}
>
<ThemeProvider theme={theme}>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Extend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const Extend: React.FC = () => {
try {
setApproveLoading(true);
const cUSD = await kit._web3Contracts.getStableToken(
StableToken.cUSD
StableToken.cUSD as any
);
const tx = await cUSD.methods
.approve(FEE_MODULE_V1, MaxUint256.toString())
Expand All @@ -65,7 +65,7 @@ export const Extend: React.FC = () => {
});
toastTx(tx.transactionHash);
refetchCUSD();
} catch (e) {
} catch (e: any) {
toast(e.message);
} finally {
setApproveLoading(false);
Expand Down Expand Up @@ -99,7 +99,7 @@ export const Extend: React.FC = () => {
});
toastTx(tx.transactionHash);
refetchNom();
} catch (e) {
} catch (e: any) {
toast(e.message);
} finally {
setExtendLoading(false);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Request/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const Request: React.FC = () => {
if (!kit || !nom) {
return;
}
const cUSD = await kit.contracts.getStableToken(StableToken.cUSD);
const cUSD = await kit.contracts.getStableToken(StableToken.cUSD as any);
const tx = await cUSD
.transfer(nom.resolution, toWei(amount))
.send({ from: kit.defaultAccount, gasPrice: toWei("0.5", "gwei") });
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Reserve/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const Reserve: React.FC = () => {
try {
setApproveLoading(true);
const cUSD = await kit._web3Contracts.getStableToken(
StableToken.cUSD
StableToken.cUSD as any
);
const tx = await cUSD.methods
.approve(FEE_MODULE_V1, MaxUint256.toString())
Expand All @@ -65,7 +65,7 @@ export const Reserve: React.FC = () => {
});
toastTx(tx.transactionHash);
refetchCUSD();
} catch (e) {
} catch (e: any) {
toast(e.message);
} finally {
setApproveLoading(false);
Expand Down Expand Up @@ -99,7 +99,7 @@ export const Reserve: React.FC = () => {
});
toastTx(tx.transactionHash);
refetchNom();
} catch (e) {
} catch (e: any) {
toast(e.message);
} finally {
setReserveLoading(false);
Expand Down
6 changes: 3 additions & 3 deletions src/pages/SearchDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const SearchDetail: React.FC = () => {
});
toastTx(tx.transactionHash);
refetchNom();
} catch (e) {
} catch (e: any) {
toast(e.message);
} finally {
setChangeOwnerLoading(false);
Expand Down Expand Up @@ -191,7 +191,7 @@ export const SearchDetail: React.FC = () => {
<Button
sx={{ p: 1, fontSize: 1, ml: 2 }}
onClick={() => {
history.push(`/search/${name}/extend`);
history.push(`/${name}/extend`);
}}
>
Extend
Expand Down Expand Up @@ -254,7 +254,7 @@ export const SearchDetail: React.FC = () => {
{nom.owner === ZERO_ADDRESS ? (
<Button
onClick={() => {
history.push(`/search/${name}/reserve`);
history.push(`/${name}/reserve`);
}}
>
Reserve
Expand Down
Loading