From 495f2f9663c518feec4e38641441df3127dac72e Mon Sep 17 00:00:00 2001 From: neokry Date: Thu, 23 Mar 2023 14:57:48 -0700 Subject: [PATCH 1/5] Add founders allocation to about page --- .../modules/dao/components/About/About.tsx | 23 ++++++++--- .../modules/dao/components/About/Founder.tsx | 41 +++++++++++++++++++ 2 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 apps/web/src/modules/dao/components/About/Founder.tsx diff --git a/apps/web/src/modules/dao/components/About/About.tsx b/apps/web/src/modules/dao/components/About/About.tsx index 400af4c41..2c285903b 100644 --- a/apps/web/src/modules/dao/components/About/About.tsx +++ b/apps/web/src/modules/dao/components/About/About.tsx @@ -1,4 +1,4 @@ -import { Box, Flex, Text } from '@zoralabs/zord' +import { Box, Flex, Grid, Text } from '@zoralabs/zord' import HtmlReactParser from 'html-react-parser' import { getFetchableUrl } from 'ipfs-service' import Image from 'next/legacy/image' @@ -18,6 +18,7 @@ import { formatCryptoVal } from 'src/utils/numbers' import { useDaoStore } from '../../stores' import { parseContractURI } from '../../utils' import { ExternalLinks } from './ExternalLinks' +import { Founder } from './Founder' import { Statistic } from './Statistic' export const About: React.FC = () => { @@ -38,16 +39,15 @@ export const About: React.FC = () => { contracts: [ { ...tokenContractParams, functionName: 'name' }, { ...tokenContractParams, functionName: 'totalSupply' }, + { ...tokenContractParams, functionName: 'getFounders' }, { ...metadataContractParams, functionName: 'contractImage' }, { ...metadataContractParams, functionName: 'description' }, { ...metadataContractParams, functionName: 'contractURI' }, ], }) - const [name, totalSupply, daoImage, description, contractURI] = unpackOptionalArray( - contractData, - 5 - ) + const [name, totalSupply, founders, daoImage, description, contractURI] = + unpackOptionalArray(contractData, 6) const parsedContractURI = parseContractURI(contractURI) const { data: balance } = useBalance({ address: treasury as Address }) @@ -127,6 +127,19 @@ export const About: React.FC = () => { ) : null} + {typeof founders !== 'undefined' && founders.length > 0 ? ( + <> + + Founders + + + {founders.map((founder) => ( + + ))} + + + ) : null} + = ({ wallet, ownershipPct }) => { + const { displayName, ensAvatar } = useEnsData(wallet as string) + return ( + + + + + {displayName} + + + {ownershipPct}% + + ) +} From fa240bfbbaf3f25066b662496fea7dd1241f4b57 Mon Sep 17 00:00:00 2001 From: neokry Date: Thu, 23 Mar 2023 15:26:05 -0700 Subject: [PATCH 2/5] Fix layout for mobile --- .../src/modules/dao/components/About/About.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/web/src/modules/dao/components/About/About.tsx b/apps/web/src/modules/dao/components/About/About.tsx index 2c285903b..ae29a2c9c 100644 --- a/apps/web/src/modules/dao/components/About/About.tsx +++ b/apps/web/src/modules/dao/components/About/About.tsx @@ -11,6 +11,7 @@ import { CHAIN } from 'src/constants/network' import SWR_KEYS from 'src/constants/swrKeys' import { metadataAbi, tokenAbi } from 'src/data/contract/abis' import { sdk } from 'src/data/graphql/client' +import { useLayoutStore } from 'src/stores' import { about, daoDescription, daoInfo, daoName } from 'src/styles/About.css' import { unpackOptionalArray } from 'src/utils/helpers' import { formatCryptoVal } from 'src/utils/numbers' @@ -25,6 +26,7 @@ export const About: React.FC = () => { const { addresses: { token, treasury, metadata }, } = useDaoStore() + const { isMobile } = useLayoutStore() const tokenContractParams = { abi: tokenAbi, @@ -127,25 +129,25 @@ export const About: React.FC = () => { ) : null} + + + + {typeof founders !== 'undefined' && founders.length > 0 ? ( <> Founders - + {founders.map((founder) => ( ))} ) : null} - - - - ) } From 950de286e14e44872462a93b2b175aa6c49f643a Mon Sep 17 00:00:00 2001 From: neokry Date: Fri, 24 Mar 2023 12:05:06 -0700 Subject: [PATCH 3/5] Add vesting tooltip to founder component --- .../src/components/Icon/assets/info-16.svg | 11 ++++++++++ apps/web/src/components/Icon/icons.ts | 2 ++ .../modules/dao/components/About/Founder.tsx | 20 ++++++++++++++++--- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 apps/web/src/components/Icon/assets/info-16.svg diff --git a/apps/web/src/components/Icon/assets/info-16.svg b/apps/web/src/components/Icon/assets/info-16.svg new file mode 100644 index 000000000..743c277a2 --- /dev/null +++ b/apps/web/src/components/Icon/assets/info-16.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/apps/web/src/components/Icon/icons.ts b/apps/web/src/components/Icon/icons.ts index f82ce104b..26d8ddb1d 100644 --- a/apps/web/src/components/Icon/icons.ts +++ b/apps/web/src/components/Icon/icons.ts @@ -22,6 +22,7 @@ import External from './assets/external-16.svg' import Github from './assets/github.svg' import Globe from './assets/globe.svg' import HandlebarCircle from './assets/handlebar-circle.svg' +import Info16 from './assets/info-16.svg' import Move from './assets/move.svg' import NewWindow from './assets/new-window.svg' import NounsConnect from './assets/nouns-connect.svg' @@ -56,6 +57,7 @@ export const icons = { github: Github, eth: Eth, handlebarCircle: HandlebarCircle, + 'info-16': Info16, globe: Globe, move: Move, newWindow: NewWindow, diff --git a/apps/web/src/modules/dao/components/About/Founder.tsx b/apps/web/src/modules/dao/components/About/Founder.tsx index 18fe88de1..16e26b4ce 100644 --- a/apps/web/src/modules/dao/components/About/Founder.tsx +++ b/apps/web/src/modules/dao/components/About/Founder.tsx @@ -1,6 +1,7 @@ -import { Flex, Text } from '@zoralabs/zord' +import { Box, Flex, Text } from '@zoralabs/zord' import { Avatar } from 'src/components/Avatar' +import { Icon } from 'src/components/Icon' import { ETHERSCAN_BASE_URL } from 'src/constants/etherscan' import { useEnsData } from 'src/hooks' import { AddressType } from 'src/typings' @@ -8,10 +9,16 @@ import { AddressType } from 'src/typings' interface FounderProps { wallet: AddressType ownershipPct: number + vestExpiry: number } -export const Founder: React.FC = ({ wallet, ownershipPct }) => { +export const Founder: React.FC = ({ wallet, ownershipPct, vestExpiry }) => { const { displayName, ensAvatar } = useEnsData(wallet as string) + const vestDate = new Date(vestExpiry * 1000).toLocaleDateString(undefined, { + year: 'numeric', + month: 'short', + day: 'numeric', + }) return ( = ({ wallet, ownershipPct }) => { {displayName} - {ownershipPct}% + + + {ownershipPct}% + + + + + ) } From 36fa62ac62cb3904511de25c4a36024c5c628d11 Mon Sep 17 00:00:00 2001 From: neokry Date: Fri, 24 Mar 2023 15:42:01 -0700 Subject: [PATCH 4/5] Change link to address --- .../modules/dao/components/About/Founder.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/web/src/modules/dao/components/About/Founder.tsx b/apps/web/src/modules/dao/components/About/Founder.tsx index 16e26b4ce..f205c1970 100644 --- a/apps/web/src/modules/dao/components/About/Founder.tsx +++ b/apps/web/src/modules/dao/components/About/Founder.tsx @@ -21,10 +21,6 @@ export const Founder: React.FC = ({ wallet, ownershipPct, vestExpi }) return ( = ({ wallet, ownershipPct, vestExpi p="x4" px="x6" > - + - {displayName} + + {displayName} + {ownershipPct}% - + From 4841a87d060d3e0966858238398721380791c6db Mon Sep 17 00:00:00 2001 From: neokry Date: Fri, 24 Mar 2023 16:26:36 -0700 Subject: [PATCH 5/5] Fix tooltop for mobile --- .../src/modules/dao/components/About/Founder.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/web/src/modules/dao/components/About/Founder.tsx b/apps/web/src/modules/dao/components/About/Founder.tsx index f205c1970..2f2dc36e0 100644 --- a/apps/web/src/modules/dao/components/About/Founder.tsx +++ b/apps/web/src/modules/dao/components/About/Founder.tsx @@ -1,4 +1,5 @@ -import { Box, Flex, Text } from '@zoralabs/zord' +import { Box, Flex, PopUp, Text } from '@zoralabs/zord' +import { useState } from 'react' import { Avatar } from 'src/components/Avatar' import { Icon } from 'src/components/Icon' @@ -13,6 +14,7 @@ interface FounderProps { } export const Founder: React.FC = ({ wallet, ownershipPct, vestExpiry }) => { + const [showTooltip, setShowTooltip] = useState(false) const { displayName, ensAvatar } = useEnsData(wallet as string) const vestDate = new Date(vestExpiry * 1000).toLocaleDateString(undefined, { year: 'numeric', @@ -50,9 +52,17 @@ export const Founder: React.FC = ({ wallet, ownershipPct, vestExpi {ownershipPct}% - + setShowTooltip(true)} + onMouseLeave={() => setShowTooltip(false)} + > + }> + {`In effect until ${vestDate}`} + )