Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
0c73372
feat: spruce
Apr 19, 2023
17e4589
fixed issues after master merge
0xbarbs May 2, 2023
1094df1
fix: protocol data contract version issue
0xbarbs May 2, 2023
542899a
remove debug log
0xbarbs May 2, 2023
f5ea3b8
fix: factor in repay block number diff for versioned block number
0xbarbs May 2, 2023
8e43574
UNI-1045 Approval permit functionality (NEW) (#105)
0xbarbs May 4, 2023
07689ef
fix: rework owed balance margin calculation to prevent dust issues
0xbarbs May 4, 2023
0fa50d8
feat: locked stakers now link to contacts table with borrowing filter…
0xbarbs May 4, 2023
08eb9d6
feat: display contact modal on contacts page if clicked in active bor…
0xbarbs May 4, 2023
dda45f8
fix: responsive style issues
0xbarbs May 6, 2023
545a107
fix: repayment issues
0xbarbs May 6, 2023
5cc1fcf
fixed more review tweaks/changes
0xbarbs May 6, 2023
ec548e9
bump @unioncredit/ui version
0xbarbs May 6, 2023
8d91278
bump: @unioncredit/ui version
0xbarbs May 6, 2023
69994f1
UNI-1250 Add tooltip content #114
0xbarbs May 15, 2023
4432a88
UNI-1388 Cancel vouch functionality (#113)
0xbarbs May 16, 2023
a00444c
UNI-1380 Get started page fixes (#115)
0xbarbs May 18, 2023
4cec781
UNI-1409 Added navigation controls to contacts modal (#116)
0xbarbs May 18, 2023
0f43b09
proj: bump @unioncredit/ui version
0xbarbs May 18, 2023
e1f9045
Updated "Unavailable" credit tooltip copy
0xmurf May 19, 2023
42229a0
UNI-1435 Claim tokens button doesnt work on get started #117
0xbarbs May 22, 2023
f4fedf4
UNI-1434 Rework estimated reward calculations (#118)
0xbarbs May 22, 2023
2b0a6bd
UNI-1411 Segmented control animation (#119)
0xbarbs May 22, 2023
c897a02
UNI-1404 Tweaked segmented control transitions #120
0xbarbs May 22, 2023
b9d83f7
UNI-1358 Increased precision of max borrow calculation #122
0xbarbs May 22, 2023
700a2e2
UNI-908 Add transitions to modals (#123)
0xbarbs May 22, 2023
5aaf7e4
UNI-1430 Update button text when revoking vouch (#126)
0xbarbs May 22, 2023
88a31b4
UNI-1423 Update button text to specify it is cancelling the received …
0xbarbs May 22, 2023
9decbb4
UNI-1373 Add eslint to interface (#124)
0xbarbs May 22, 2023
9c1abce
added missing prop
0xbarbs May 22, 2023
54707c9
feat: added back buffer window var
0xbarbs May 22, 2023
00bcfaa
proj: only eslint the src directory
0xbarbs May 22, 2023
a210327
UNI-1448 Interest rates not calculating correctly #128
0xbarbs May 24, 2023
7ca8add
UNI-626 Improve display of proposal action items (#145)
0xbarbs May 26, 2023
2681426
feat: show mainnet leaderboard contacts for all networks (#146)
0xbarbs May 26, 2023
ec83699
feat: added truncating of ens names (#144)
0xbarbs May 26, 2023
73056f7
fix: added hover style to wallet/profile header buttons (#143)
0xbarbs May 26, 2023
2677fbe
fix: display network name in wallet balance text (#142)
0xbarbs May 26, 2023
9833df2
feat: fetch time to default and time to write-off values from the con…
0xbarbs May 26, 2023
41e2d6f
fix: bottom corners were overflowing parent container (#140)
0xbarbs May 26, 2023
c7cce2c
feat: updated tooltip icon to correct version (#139)
0xbarbs May 26, 2023
a357f5a
UNI-1424 Contact table top bar tweaks and adjustments (#138)
0xbarbs May 26, 2023
304814f
feat: tweaked contact numerical row font inline with design (#134)
0xbarbs May 26, 2023
12c8605
feat: added build info and links to the repository (#133)
0xbarbs May 26, 2023
80c6d6d
fix: remove hardcoding of app deployment (#130)
0xbarbs May 26, 2023
81b57e7
fix: active borrowers table overflows on smaller screens (#129)
0xbarbs May 26, 2023
e8f8918
feat: default v2 (#147)
May 26, 2023
8c24185
feat: loading screen when switching versions (#148)
May 26, 2023
a324f47
fix: event listeners (#149)
May 26, 2023
99b4b26
UNI-1427 Fixed loan status sort (#131)
0xbarbs May 26, 2023
b486407
UNI-1421 Add edit alias functionality to contact modal (#132)
0xbarbs May 26, 2023
15fbc3b
UNI-1416 Only show staked funds warning on V2 networks (#135)
0xbarbs May 26, 2023
195765b
UNI-1414 Incorrect spacing on modal input and input title #136
0xbarbs May 26, 2023
adb476e
UNI-1451 Added get started mobile progress list #137
0xbarbs May 26, 2023
3a41279
UNI-1452 Network switcher improvements #150
0xbarbs May 26, 2023
c0fc36f
UNI-1429 Styling issues with wallet activity modal #151
0xbarbs May 26, 2023
ce6c845
UNI-1428 Added minimum width to loan status column #152
0xbarbs May 26, 2023
fc865c1
UNI-1418 Made ENS label blue #153
0xbarbs May 26, 2023
ca78a1d
UNI-1425 Color issues on spruce #155
0xbarbs May 30, 2023
cf1d787
Arrow Glyph
0xmurf Jun 1, 2023
1681ebc
Merge branch 'develop' of https://github.com/unioncredit/union-interf…
0xmurf Jun 1, 2023
2a90de5
UNI-1469 Fixed last payment calculation on contacts table #160
0xbarbs Jun 2, 2023
580ef89
UNI-1450 Prevent contact navigation from overflowing the window #158
0xbarbs Jun 2, 2023
44f224e
UNI-1438 Reworked governance balances #157
0xbarbs Jun 2, 2023
03f72fd
UNI-1408 Correctly display dust and reduce minimum payment to 0.01 (#…
0xbarbs Jun 2, 2023
111935c
UNI-1262 Check there is enough uDAI balance when borrowing #161
0xbarbs Jun 2, 2023
7cf3754
UNI-1449 Fixed contact table crashing #162
0xbarbs Jun 5, 2023
f82a5f2
fix: borrowable sort
0xbarbs Jun 6, 2023
9e15f99
Merge remote-tracking branch 'origin/develop' into develop
0xbarbs Jun 6, 2023
5fdd4ec
UNI-1480 Fix get started page and network select options #163
0xbarbs Jun 7, 2023
4e853ae
UNI-1481 Correct contact not showing using URL param filter #164
0xbarbs Jun 7, 2023
9397415
UNI-1485 Updated max overdue days calculation #165
0xbarbs Jun 7, 2023
637d59c
UNI-1477 Added etherscan link to view bytecode button #166
0xbarbs Jun 7, 2023
7abe1e9
UNI-1441 Added optimism v2 banner #167
0xbarbs Jun 7, 2023
6d00fdb
UNI-1475 Added 404 page (#168)
0xbarbs Jun 9, 2023
99788b4
UNI-1419 Hide vouchee details if vouch is <= 0 #169
0xbarbs Jun 9, 2023
2250a61
UNI-1483 Providing and receving toggle style changes (#170)
0xbarbs Jun 9, 2023
114bbba
Revert "UNI-1419 Hide vouchee details if vouch is <= 0 #169" (#172)
0xbarbs Jun 12, 2023
7fdc7f0
fix: adjust info banner styles
0xbarbs Jun 12, 2023
662f5bf
Merge remote-tracking branch 'origin/develop' into feat/spruce-master…
0xbarbs Jun 13, 2023
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
31 changes: 31 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"react/react-in-jsx-scope": "off",
"no-case-declarations": "off",
"react/prop-types": "off",
"no-extra-boolean-cast": "off",
"react/no-unescaped-entities": "off"
},
"settings": {
"react": {
"version": "detect"
}
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.env
yalc.lock
.yalc/
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"tabWidth": 2,
"printWidth": 100,
"singleQuote": false,
"trailingComma": "es5"
}
18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,26 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@unioncredit/ui": "0.3.0-beta.29",
"@unioncredit/ui": "^0.4.22",
"add-event-to-calendar": "^1.0.7",
"buffer": "^6.0.3",
"classnames": "^2.3.2",
"date-fns": "^2.29.3",
"dayjs": "^1.11.6",
"eth-permit": "^0.2.3",
"ethereum-blockies-base64": "^1.0.2",
"ethers": "^5.7.2",
"graphql": "^16.6.0",
"graphql-request": "^5.0.0",
"js-confetti": "^0.11.0",
"lodash": "^4.17.21",
"prettier": "^2.7.1",
"qrcode.react": "^3.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-error-boundary": "^3.1.4",
"react-helmet": "^6.1.0",
"react-markdown": "5.0.3",
"react-minimal-pie-chart": "^8.4.0",
"react-router-dom": "^6.4.2",
"react-scripts": "5.0.1",
"sass": "^1.55.0",
Expand All @@ -32,12 +35,13 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "export REACT_APP_VERSION=$(git rev-parse HEAD) && react-scripts start",
"build": "export REACT_APP_VERSION=$(git rev-parse HEAD) && react-scripts build",
"start": "export REACT_APP_VERSION=$(git rev-parse HEAD) && export DISABLE_ESLINT_PLUGIN=true && react-scripts start",
"build": "export REACT_APP_VERSION=$(git rev-parse HEAD) && export DISABLE_ESLINT_PLUGIN=true && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"format": "prettier --write \"src/**/*.{js,scss,json,jsx}\"",
"serve": "serve build -l 3000"
"serve": "serve build -l 3000",
"lint": "eslint --ext .js,.jsx ./src"
},
"eslintConfig": {
"extends": []
Expand All @@ -53,5 +57,9 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"eslint": "^8.40.0",
"eslint-plugin-react": "^7.32.2"
}
}
3 changes: 3 additions & 0 deletions public/images/CheckIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 57 additions & 55 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { useEffect } from "react";
import { useAccount, useNetwork } from "wagmi";
import { Box, Label, Layout, Grid } from "@unioncredit/ui";
import { Box, Layout, Grid } from "@unioncredit/ui";
import { matchRoutes, useLocation } from "react-router-dom";
import { ErrorBoundary } from "react-error-boundary";

import Routes from "./Routes";

import ConnectPage from "pages/Connect";
import Header from "components/shared/Header";
import { general as generalRoutes } from "App.routes";
import { Header } from "components/shared/Header";
import { allRoutes, general as generalRoutes } from "App.routes";
import ScrollToTop from "components/misc/ScrollToTop";

import Cache from "providers/Cache";
Expand All @@ -22,6 +23,10 @@ import MemberData, { useMember } from "providers/MemberData";
import { isVersionSupported, useVersion } from "providers/Version";
import Settings from "providers/Settings";
import useChainParams from "hooks/useChainParams";
import ErrorPage from "pages/Error";
import { BuildInfo } from "components/shared/BuildInfo";
import LoadingPage from "pages/Loading";
import NotFoundPage from "pages/NotFoundPage";

/**
* Shim component that checks if the App is ready
Expand All @@ -30,7 +35,6 @@ function AppReadyShim({ children }) {
const location = useLocation();

const { chain } = useNetwork();
const { version } = useVersion();
const { isDisconnected } = useAccount();
const { data: member = {} } = useMember();
const { appReady, setAppReady } = useAppNetwork();
Expand All @@ -50,19 +54,6 @@ function AppReadyShim({ children }) {

if (chain && appReady && (isDisconnected || chain?.unsupported)) {
setAppReady(false);
return;
}

// If the user is a member, or we are accessing a general route, then
// skip the connect/ready page and auto connect straight into
// the credit page "/"
if (!appReady && member.isMember) {
// Check if the currently verions matches the network. Only if
// the version is set correctly can we proceed
if (isVersionSupported(version, chain.id)) {
setAppReady(true);
return;
}
}
}, [
appReady,
Expand All @@ -86,16 +77,21 @@ export default function App() {

const isGeneralRoute = Boolean(matchRoutes(generalRoutes, location));

const is404 = !allRoutes.some((r) => r.path === location.pathname);

if (!version || ((chain?.unsupported || !isConnected) && !isGeneralRoute)) {
return (
<AppReadyShim>
<Layout>
<ScrollToTop />
<Layout.Main>
<Header showNav={false} />
<Grid style={{ display: "flex", flexGrow: 1 }}>
<Grid.Row style={{ width: "100%", margin: 0 }}>
<Grid.Col>
<ConnectPage />
<ErrorBoundary FallbackComponent={ErrorPage}>
{is404 ? <NotFoundPage /> : <ConnectPage />}
</ErrorBoundary>
</Grid.Col>
</Grid.Row>
</Grid>
Expand All @@ -109,44 +105,50 @@ export default function App() {
<Layout>
<ScrollToTop />
<Layout.Main>
<Grid style={{ display: "flex", flexGrow: 1 }}>
<Grid.Row style={{ width: "100%", margin: 0 }}>
<Grid.Col>
<Settings>
<Cache>
<ProtocolData>
<GovernanceData>
<MemberData>
<VouchersData>
<VoucheesData>
<ModalManager>
<AppReadyShim>
{appReady ? (
<>
<Header />
<Routes />
</>
) : (
<ConnectPage />
)}
</AppReadyShim>
</ModalManager>
</VoucheesData>
</VouchersData>
</MemberData>
</GovernanceData>
</ProtocolData>
</Cache>
</Settings>
</Grid.Col>
</Grid.Row>
</Grid>
<Settings>
<Cache>
<ProtocolData>
<GovernanceData>
<MemberData>
<VouchersData>
<VoucheesData>
<ModalManager>
<AppReadyShim>
<Header />
{isVersionSupported(version, chain.id) ? (
<Grid style={{ display: "flex", flexGrow: 1 }}>
<Grid.Row style={{ width: "100%", margin: 0 }}>
<Grid.Col>
{is404 ? (
<NotFoundPage />
) : appReady ? (
<>
<ErrorBoundary FallbackComponent={ErrorPage}>
<Layout.Columned>
<Routes />
</Layout.Columned>
</ErrorBoundary>
</>
) : (
<ConnectPage />
)}
</Grid.Col>
</Grid.Row>
</Grid>
) : (
<LoadingPage />
)}
</AppReadyShim>
</ModalManager>
</VoucheesData>
</VouchersData>
</MemberData>
</GovernanceData>
</ProtocolData>
</Cache>
</Settings>
<Box mt="56px" mb="24px" w="100%">
<Box justify="center" fluid>
<Label as="p" size="small" grey={300} align="center">
Build: {process.env.REACT_APP_VERSION}
</Label>
</Box>
<BuildInfo />
</Box>
</Layout.Main>
</Layout>
Expand Down
25 changes: 13 additions & 12 deletions src/App.routes.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { ContactsType } from "constants";
import { Links } from "constants";

import ContactsPage from "pages/Contacts";
import GovernancePage from "pages/Governance";
import ProposalsPage from "pages/Proposals";
import ProposalPage from "pages/Proposal";
import ProfilePage from "pages/Profile";
import RegisterPage from "pages/Register";
import CreditPage from "pages/Credit";
import StakePage from "pages/Stake";
import CreditPages, { PAGES as CREDIT_PAGES } from "pages/CreditPages";
import DaoPages, { PAGES as DAO_PAGES } from "pages/DaoPages";

// prettier-ignore
export const member = [
{ path: "/", component: CreditPage, props: {} },
{ path: "/stake", component: StakePage, props: {} },
{ path: "/contacts", component: ContactsPage, props: { type: ContactsType.VOUCHEES } },
{ path: "/contacts/trusts-you", component: ContactsPage, props: { type: ContactsType.VOUCHERS } },
{ path: "/", component: CreditPages, props: { page: CREDIT_PAGES.BORROW } },
{ path: "/stake", component: CreditPages, props: { page: CREDIT_PAGES.STAKE } },
{ path: "/contacts", component: CreditPages, props: { page: CREDIT_PAGES.CONTACTS_PROVIDING } },
{ path: "/contacts/providing", component: CreditPages, props: { page: CREDIT_PAGES.CONTACTS_PROVIDING } },
{ path: "/contacts/receiving", component: CreditPages, props: { page: CREDIT_PAGES.CONTACTS_RECEIVING } },
]

// prettier-ignore
Expand All @@ -25,7 +23,10 @@ export const nonMember = [
// prettier-ignore
export const general = [
{ path: "/profile/:addressOrEns", component: ProfilePage, props: {} },
{ path: "/governance", component: GovernancePage, props: { type: ContactsType.VOUCHERS } },
{ path: "/governance/proposals", component: ProposalsPage, props: {} },
{ path: Links.GOVERNANCE, component: DaoPages, props: { page: DAO_PAGES.VOTING } },
{ path: Links.PROTOCOL, component: DaoPages, props: { page: DAO_PAGES.PROTOCOL } },
{ path: "/governance/proposals/:hash", component: ProposalPage, props: {} },
{ path: Links.LEADERBOARD, component: DaoPages, props: { page: DAO_PAGES.LEADERBOARD } },
]

export const allRoutes = [...member, ...nonMember, ...general];
Loading