Skip to content

Commit

Permalink
Release 2.0.0 (#154)
Browse files Browse the repository at this point in the history
Co-authored-by: Adnan Khan <[email protected]>
Co-authored-by: Aaron Cook <[email protected]>
Co-authored-by: James Mealy <[email protected]>
Co-authored-by: Usame Algan <[email protected]>
  • Loading branch information
5 people authored Apr 19, 2024
1 parent 1cec226 commit 8c804e8
Show file tree
Hide file tree
Showing 168 changed files with 6,812 additions and 1,555 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"extends": ["next/core-web-vitals", "prettier"],
"plugins": ["prettier", "@typescript-eslint"],
"plugins": ["unused-imports", "prettier", "@typescript-eslint"],
"rules": {
"@next/next/no-img-element": "off",
"no-constant-condition": "warn"
"no-constant-condition": "warn",
"unused-imports/no-unused-imports-ts": "error"
},
"ignorePatterns": ["node_modules/", ".next/", ".github/", "src/types/contracts"]
}
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# branch should not be protected
branch: 'main'
# user names of users allowed to contribute without CLA
allowlist: lukasschor,mikheevm,rmeissner,germartinez,Uxio0,dasanra,francovenica,tschubotz,luarx,bot*,DaniSomoza,iamacook,yagopv,usame-algan,schmanu,DiogoSoaress,JagoFigueroa
allowlist: lukasschor,mikheevm,rmeissner,germartinez,Uxio0,dasanra,francovenica,tschubotz,luarx,bot*,DaniSomoza,iamacook,yagopv,usame-algan,schmanu,DiogoSoaress,JagoFigueroa,jmealy

# the followings are the optional inputs - If the optional inputs are not given, then default values will be taken
# enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ jobs:
- name: Extract version
if: github.event.pull_request.merged == true
id: version
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: |
NEW_VERSION=$(node -p 'require("./package.json").version')
echo "version=v$NEW_VERSION" >> $GITHUB_OUTPUT
echo "${{ github.event.pull_request.body }}" > CHANGELOG.md
echo "$PR_BODY" > CHANGELOG.md
- name: Create a git tag
if: github.event.pull_request.merged == true
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# misc
.DS_Store
*.pem
.idea

# debug
npm-debug.log*
Expand All @@ -27,7 +28,8 @@ yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
.env
*.local

# vercel
.vercel
Expand Down
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ const customJestConfig = {
testEnvironment: 'jest-environment-jsdom',
}

module.exports = createJestConfig(customJestConfig)
module.exports = async () => ({
...(await createJestConfig(customJestConfig)()),
transformIgnorePatterns: ['node_modules/(?!(isows)/)'],
})
4 changes: 4 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ jest.mock('@web3-onboard/core', () => () => ({
get: () => mockOnboardState,
},
}))

const { TextEncoder, TextDecoder } = require('util')
global.TextEncoder = TextEncoder
global.TextDecoder = TextDecoder
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "safe-dao-governance-app",
"homepage": "https://github.com/safe-global/safe-dao-governance-app",
"license": "GPL-3.0",
"version": "1.2.2",
"version": "2.0.0",
"scripts": {
"build": "next build && next export",
"lint": "tsc && next lint",
Expand All @@ -24,10 +24,11 @@
"@emotion/react": "^11.10.5",
"@emotion/server": "^11.10.0",
"@emotion/styled": "^11.10.5",
"@gnosis.pm/safe-apps-provider": "^0.15.1",
"@gnosis.pm/safe-apps-react-sdk": "^4.6.2",
"@mui/icons-material": "^5.11.0",
"@mui/icons-material": "^5.15.15",
"@mui/material": "^5.11.5",
"@mui/x-date-pickers": "^7.1.1",
"@safe-global/safe-apps-provider": "^0.18.2",
"@safe-global/safe-apps-react-sdk": "^4.7.1",
"@safe-global/safe-gateway-typescript-sdk": "^3.5.6",
"@web3-onboard/coinbase": "^2.2.4",
"@web3-onboard/core": "2.20.4",
Expand All @@ -40,12 +41,14 @@
"bezier-easing": "^2.1.0",
"clsx": "^1.2.1",
"date-fns": "^2.29.3",
"dayjs": "^1.11.10",
"ethereum-blockies-base64": "^1.0.2",
"ethers": "^5.7.2",
"next": "13.1.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"swr": "^2.1.0"
"swr": "^2.1.0",
"victory": "^36.9.2"
},
"devDependencies": {
"@svgr/webpack": "^6.5.1",
Expand All @@ -62,6 +65,7 @@
"eslint-config-next": "13.1.2",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-unused-imports": "^3.1.0",
"hardhat": "^2.12.6",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
Expand Down
17 changes: 11 additions & 6 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import SafeProvider from '@gnosis.pm/safe-apps-react-sdk'
import SafeProvider from '@safe-global/safe-apps-react-sdk'
import { useEffect, useMemo } from 'react'
import { CacheProvider } from '@emotion/react'
import {
Experimental_CssVarsProvider as CssVarsProvider,
experimental_extendTheme as extendMuiTheme,
} from '@mui/material/styles'
import { useMediaQuery, CssBaseline } from '@mui/material'
import { CssBaseline } from '@mui/material'
import { setBaseUrl as setGatewayBaseUrl } from '@safe-global/safe-gateway-typescript-sdk'
import { useRouter } from 'next/router'
import type { EmotionCache } from '@emotion/react'
Expand All @@ -22,12 +22,14 @@ import { useIsTokenPaused } from '@/hooks/useIsTokenPaused'
import { useInitWallet } from '@/hooks/useWallet'
import { EnsureWalletConnection } from '@/components/EnsureWalletConnection'
import { createEmotionCache } from '@/styles/emotion'
import { GATEWAY_URL } from '@/config/constants'
import { isDashboard } from '@/utils/routes'
import { useSafeSnapshot } from '@/hooks/useSafeSnapshot'
import { usePendingDelegations } from '@/hooks/usePendingDelegations'

import '@/styles/globals.css'
import { useSafeTokenBalance } from '@/hooks/useSafeTokenBalance'
import { useLockHistory } from '@/hooks/useLockHistory'
import { GATEWAY_URL } from '@/config/constants'

const InitApp = (): null => {
setGatewayBaseUrl(GATEWAY_URL)
Expand All @@ -38,12 +40,16 @@ const InitApp = (): null => {

usePendingDelegations()

// Populate caches
// Populate claiming app caches
useChain()
useDelegatesFile()
useIsTokenPaused()
useSafeSnapshot()

// Populate locking app caches
useSafeTokenBalance()
useLockHistory()

return null
}

Expand All @@ -58,10 +64,9 @@ const App = ({
emotionCache?: EmotionCache
}): ReactElement => {
const { pathname, query } = useRouter()
const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)')

// Workaround for dark mode widgets
const isDarkMode = query.theme ? query.theme === 'dark' : prefersDarkMode
const isDarkMode = query.theme ? query.theme !== 'light' : true

useEffect(() => {
if (typeof document !== 'undefined') {
Expand Down
2 changes: 2 additions & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import createEmotionServer from '@emotion/server/create-instance'

import { Favicons } from '@/components/Favicons'
import { createEmotionCache } from '@/styles/emotion'
import { IS_PRODUCTION } from '@/config/constants'

export default class MyDocument extends Document {
render() {
return (
<Html lang="en">
<Head>
<meta name="robots" content={IS_PRODUCTION ? 'nofollow' : 'noindex,nofollow'} />
<meta name="emotion-insertion-point" content="" />
{(this.props as any).emotionStyleTags}
<Favicons />
Expand Down
9 changes: 9 additions & 0 deletions pages/activity-program.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { NextPage } from 'next'

import Activities from '@/components/Activities'

const ActivityProgramPage: NextPage = () => {
return <Activities />
}

export default ActivityProgramPage
9 changes: 9 additions & 0 deletions pages/activity.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { NextPage } from 'next'

import TokenLocking from '@/components/TokenLocking'

const LockPage: NextPage = () => {
return <TokenLocking />
}

export default LockPage
15 changes: 13 additions & 2 deletions pages/claim.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import type { NextPage } from 'next'

import { Claim } from '@/components/Claim'
import SuccessfulClaim from '@/components/Claim/SuccessfulClaim'
import { useRouter, useSearchParams } from 'next/navigation'
import { AppRoutes } from '@/config/routes'
import MediumPaper from '@/components/MediumPaper'

const ClaimPage: NextPage = () => {
return <Claim />
const router = useRouter()
const query = useSearchParams()
const claimedAmount = query.get('claimedAmount') || ''

return (
<MediumPaper>
<SuccessfulClaim data={{ claimedAmount }} onNext={() => router.push(AppRoutes.governance)} />
</MediumPaper>
)
}

export default ClaimPage
9 changes: 9 additions & 0 deletions pages/governance.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { NextPage } from 'next'

import { GovernanceAndClaiming } from '@/components/GovernanceAndClaiming'

const GovernanceAndClaimingPage: NextPage = () => {
return <GovernanceAndClaiming />
}

export default GovernanceAndClaimingPage
10 changes: 2 additions & 8 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import type { NextPage } from 'next'

import { useWallet } from '@/hooks/useWallet'
import { ConnectWallet } from '@/components/ConnectWallet'
import { Intro } from '@/components/Intro'
import { useIsSafeApp } from '@/hooks/useIsSafeApp'
import { SplashScreen } from '@/components/SplashScreen'

const IndexPage: NextPage = () => {
const isSafeApp = useIsSafeApp()
const wallet = useWallet()

return !isSafeApp && !wallet ? <ConnectWallet /> : <Intro />
return <SplashScreen />
}

export default IndexPage
9 changes: 0 additions & 9 deletions pages/safedao.tsx

This file was deleted.

9 changes: 9 additions & 0 deletions pages/splash.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { NextPage } from 'next'

import { SplashScreen } from '@/components/SplashScreen'

const SplashPage: NextPage = () => {
return <SplashScreen />
}

export default SplashPage
9 changes: 9 additions & 0 deletions pages/unlock.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { NextPage } from 'next'

import TokenUnlocking from '@/components/TockenUnlocking'

const UnlockPage: NextPage = () => {
return <TokenUnlocking />
}

export default UnlockPage
Binary file added public/images/assets-stored.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/images/asterix.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions public/images/barcode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/images/clock-alt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/images/clock.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/images/diamond.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 added public/images/empty-activity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8c804e8

Please sign in to comment.