From 3d0a4922d571f9f045e4ada72e787343fb306d33 Mon Sep 17 00:00:00 2001 From: Jord <53406838+jordanlesich@users.noreply.github.com> Date: Thu, 22 Sep 2022 10:15:53 -0700 Subject: [PATCH] Action display (#888) * Publish new lib versions. (#412) * fix/fix-table-types (#354) * removed the any types from hub * renamed Table to DaoTable and DataTable to DaoTable to be more consistent with DaoCard * removed commented out DaoData type * one more comment -- thought i got both before * Fix/355 summon params mixup (#356) * more ignore * fixes bad init params order in summon tx * Feature/tag component (#349) * Created basic tag component * Added dynamic color selections for tags * Bumped versions fixed filer * Added icon support to tag component Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Jonathan Prozzi * Feature/delegate play (#357) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * refactors filter into query helper * Spencer's Summon tooltip suggestions (#370) * Spencer's Summon tooltip suggestions - Summon portion of #365 * Delimiter references #368 For now, just referencing spaces. But if tabs, commas, or other delimiters are also supported, those should be references in the tooltips as well. * Address Jord's comments Co-authored-by: Sam Kuhlmann * Fix/summon poll (#375) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * adds schema field to tx entity * updates poll for tx entity made before dao entity * Feature/alpha baal update (#376) * new abis * updates summoner tx logic and contract addresses * fixes transaction entity creation location; * fixes some test * Feature/unit utils (#380) * create custom d.ts for human-format * type and convert unit fn from V2 * readableNumber util accepts number strings, throws error if string but number string * fix 0 to 1 utils, extend MaxDecimals to shorten decimal places * refine spacer and unit symbol placement * update new card to handle new params * update table * corrections * alter d.ts file * potential solutions to ts bug * implement keating's d.ts fix * fix comment * Fix/network switcher (#381) * better error handling * fix bug * remove log * get react-table TS to stop yelling (#382) Co-authored-by: Sam Kuhlmann * Feature/hub sort (#383) * wip * gets query working on dao entity after lots of subgraph updates * updates front end for sort * fixes type issue * fixes build issue * reviewing v3 monorepo and saw some networks missing (#399) * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * adds search (#401) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error Co-authored-by: Alexander Keating Co-authored-by: Rowdy Co-authored-by: Brian Rossetti * Release/12072022 (#411) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error * feature bump Co-authored-by: Jonathan Prozzi Co-authored-by: Rowdy Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti Co-authored-by: Alexander Keating * Revert "Publish new lib versions. (#412)" This reverts commit bab7077ded01a2e5e0e4cd8ef59c4fd0fb9e4b96. * develop to master (#482) * UI/layout cleanup (#438) * run generator * import connect, theme libs. Add eindow.global. Ensure main.tsx uses React 17 API. * deletes app test * updates favicon and title * remove nx defaults * rough in layout box, target DH connect nav with class * remove even more css. World's dubest layout component * switches to connect class padding for mobile * extract base layout component to storybook * hook export chain, change name to outerlayout * extract formSegment from summon-app; replace in all instances in summon * extract split-column, replace all instances in summon * document future changes in comments * fix exports * switch core-app to nx default project * fix spacing * Fix/split column bug (#444) - fix bug * Layouts/subnav (#447) * clear out extra app.t.tsx * build sub-nav * style sub-nav * test subnav * extract subNavLink into component * subnavlink story * build subnavlink story * fix broken as prop * add mobile view, icon button trigger * add tsc command to core-app * adds human-format, removes profanity * Fix summon (#446) * Fix summon * clear out extra app.t.tsx * build sub-nav * style sub-nav * test subnav * extract subNavLink into component * subnavlink story * build subnavlink story * fix broken as prop * Fix summon * add mobile view, icon button trigger * add tsc command to core-app * adds human-format, removes profanity * add human-format to dao-data * move dts file Co-authored-by: jordan Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> * Haus layout (#451) * Publish new lib versions. (#412) * fix/fix-table-types (#354) * removed the any types from hub * renamed Table to DaoTable and DataTable to DaoTable to be more consistent with DaoCard * removed commented out DaoData type * one more comment -- thought i got both before * Fix/355 summon params mixup (#356) * more ignore * fixes bad init params order in summon tx * Feature/tag component (#349) * Created basic tag component * Added dynamic color selections for tags * Bumped versions fixed filer * Added icon support to tag component Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Jonathan Prozzi * Feature/delegate play (#357) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * refactors filter into query helper * Spencer's Summon tooltip suggestions (#370) * Spencer's Summon tooltip suggestions - Summon portion of #365 * Delimiter references #368 For now, just referencing spaces. But if tabs, commas, or other delimiters are also supported, those should be references in the tooltips as well. * Address Jord's comments Co-authored-by: Sam Kuhlmann * Fix/summon poll (#375) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * adds schema field to tx entity * updates poll for tx entity made before dao entity * Feature/alpha baal update (#376) * new abis * updates summoner tx logic and contract addresses * fixes transaction entity creation location; * fixes some test * Feature/unit utils (#380) * create custom d.ts for human-format * type and convert unit fn from V2 * readableNumber util accepts number strings, throws error if string but number string * fix 0 to 1 utils, extend MaxDecimals to shorten decimal places * refine spacer and unit symbol placement * update new card to handle new params * update table * corrections * alter d.ts file * potential solutions to ts bug * implement keating's d.ts fix * fix comment * Fix/network switcher (#381) * better error handling * fix bug * remove log * get react-table TS to stop yelling (#382) Co-authored-by: Sam Kuhlmann * Feature/hub sort (#383) * wip * gets query working on dao entity after lots of subgraph updates * updates front end for sort * fixes type issue * fixes build issue * reviewing v3 monorepo and saw some networks missing (#399) * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * adds search (#401) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error Co-authored-by: Alexander Keating Co-authored-by: Rowdy Co-authored-by: Brian Rossetti * Release/12072022 (#411) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error * feature bump Co-authored-by: Jonathan Prozzi Co-authored-by: Rowdy Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti Co-authored-by: Alexander Keating * Revert "Publish new lib versions. (#412)" This reverts commit bab7077ded01a2e5e0e4cd8ef59c4fd0fb9e4b96. * build formLayout Component * type correction * build formLayout story * rough in bicolumn layout * handle bicolumn mobile switch, finish bicolumn * fix mainlayout naming * build story for bi-column layout * build dh layout one shot? * yes, one shot * fix import * change prop name Co-authored-by: Jonathan Prozzi Co-authored-by: Alexander Keating Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti * bumping packages that were published pre revert last week - causing fialures with package publishing (#460) * removing period from info content which casues confusing tooltip (#453) Co-authored-by: Sam Kuhlmann * Feature/hub profile menu fix (#480) * fixes profile link and layout * dao list style * adds toast to share link * Readme tables preferred (#483) * adjusting breakdown of apps and libs to tables * adding additoonal app references and libs * adding timestamp and address fields to many events (#468) * adding timestamps and address fields to many events * addressing code review * shortening naming convention on proposals, top level txHash defined as txHash going forward * update version * deploy subgraph and generate query types Co-authored-by: skuhlmann Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Alexander Keating Co-authored-by: jordan Co-authored-by: Jonathan Prozzi Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy Co-authored-by: Spencer Graham * Revert "develop to master (#482)" (#492) This reverts commit 5f7d121f9c49b9559d352bb17fce3c1ec598dfbe. Co-authored-by: Sam Kuhlmann * Develop into master (#577) * Feature/form builder (#553) * Publish new lib versions. (#412) * fix/fix-table-types (#354) * removed the any types from hub * renamed Table to DaoTable and DataTable to DaoTable to be more consistent with DaoCard * removed commented out DaoData type * one more comment -- thought i got both before * Fix/355 summon params mixup (#356) * more ignore * fixes bad init params order in summon tx * Feature/tag component (#349) * Created basic tag component * Added dynamic color selections for tags * Bumped versions fixed filer * Added icon support to tag component Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Jonathan Prozzi * Feature/delegate play (#357) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * refactors filter into query helper * Spencer's Summon tooltip suggestions (#370) * Spencer's Summon tooltip suggestions - Summon portion of #365 * Delimiter references #368 For now, just referencing spaces. But if tabs, commas, or other delimiters are also supported, those should be references in the tooltips as well. * Address Jord's comments Co-authored-by: Sam Kuhlmann * Fix/summon poll (#375) * more ignore * fixes bad init params order in summon tx * delegate testing and subgraph field updates * finishes mapping * update dao-data query and transformer * adds delegate tag to list view and hooks up delegate filtering * adds schema field to tx entity * updates poll for tx entity made before dao entity * Feature/alpha baal update (#376) * new abis * updates summoner tx logic and contract addresses * fixes transaction entity creation location; * fixes some test * Feature/unit utils (#380) * create custom d.ts for human-format * type and convert unit fn from V2 * readableNumber util accepts number strings, throws error if string but number string * fix 0 to 1 utils, extend MaxDecimals to shorten decimal places * refine spacer and unit symbol placement * update new card to handle new params * update table * corrections * alter d.ts file * potential solutions to ts bug * implement keating's d.ts fix * fix comment * Fix/network switcher (#381) * better error handling * fix bug * remove log * get react-table TS to stop yelling (#382) Co-authored-by: Sam Kuhlmann * Feature/hub sort (#383) * wip * gets query working on dao entity after lots of subgraph updates * updates front end for sort * fixes type issue * fixes build issue * reviewing v3 monorepo and saw some networks missing (#399) * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * adds search (#401) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error Co-authored-by: Alexander Keating Co-authored-by: Rowdy Co-authored-by: Brian Rossetti * Release/12072022 (#411) * adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error * feature bump Co-authored-by: Jonathan Prozzi Co-authored-by: Rowdy Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti Co-authored-by: Alexander Keating * Revert "Publish new lib versions. (#412)" This reverts commit bab7077ded01a2e5e0e4cd8ef59c4fd0fb9e4b96. * build formLayout Component * type correction * build formLayout story * rough in bicolumn layout * handle bicolumn mobile switch, finish bicolumn * fix mainlayout naming * build story for bi-column layout * scaffold formBuilder library * rough in formBuilder * restructure types * refactor component structure * test render inputs * add core fields to builder enum * add row layout to builder * built logger, fix logger bug * add disable all functionality * handle asynchronous callback as props to form builder * remove some comments * put submit button in form footer * fix code based on review * build validation pipeline * clean form and field types * revise types again, simplify rules API * commit after refactor carnage * roll back to react-hook-form v6, finally get some traction * found source of bug, trying new rhf version * ...and the bug was slain, returned to that cold, miserable shit heap from whence it came. * reintroduce devtool and logger * build metadata form, form segment subForm component * clean, add custom submit btn text * clean * build string validations * derive validation type from function obj * wrestled types into validation system * rebuild form builder as context * build formBuilder hook, use it in the factory * create sample test * update form placement * more post merge corrections * write validation updaters and add to pipeline, test required updaters, test validation, test pipeline * try jest testing * ensure field state updates on formState change * more cleaning * reorg files * build metadata form * tweak button styles, add defaultValues to formBuilder * good place to stop * remove comments * fix Jest errors * fix field wrapper stories, update lock * may have fixed jest errors Co-authored-by: Jonathan Prozzi Co-authored-by: Alexander Keating Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti * Fix build (#563) * Fix build * Almost * More changes Co-authored-by: Jord <53406838+jordanlesich@users.noreply.github.com> Co-authored-by: Jonathan Prozzi Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti * Revert "Develop into master (#577)" This reverts commit b8644d3afa3204e0e4275b62a8e360109aac11cd. * gets member profile menu setup * left column fits content * render flat level data * error display, value display * clean * remove test data * adds env Co-authored-by: Jonathan Prozzi Co-authored-by: Alexander Keating Co-authored-by: Sam Kuhlmann Co-authored-by: Rowdy Co-authored-by: Spencer Graham Co-authored-by: Brian Rossetti --- .github/workflows/ci_develop.yaml | 1 + .../core-app/src/components/ActionDisplay.tsx | 143 ++++++++++++++++++ .../src/components/ProposalDetailsGuts.tsx | 1 + apps/core-app/src/pages/ProposalDetails.tsx | 13 +- libs/tx-builder-feature/src/utils/decoding.ts | 14 +- .../AddressDisplay/AddressDisplay.styles.tsx | 4 +- .../AddressDisplay/AddressDisplay.tsx | 10 +- 7 files changed, 174 insertions(+), 12 deletions(-) create mode 100644 apps/core-app/src/components/ActionDisplay.tsx diff --git a/.github/workflows/ci_develop.yaml b/.github/workflows/ci_develop.yaml index 24d10513d..c2db7b6c9 100644 --- a/.github/workflows/ci_develop.yaml +++ b/.github/workflows/ci_develop.yaml @@ -56,6 +56,7 @@ jobs: echo NX_RIVET_KEY=${{ secrets.RIVET_KEY }} >> .env echo VITE_RIVET_KEY=${{ secrets.RIVET_KEY }} >> .env echo VITE_INFURA_PROJECT_ID=${{ secrets.INFURA_PROJECT_ID }} >> .env + echo VITE_ETHERSCAN_KEY=${{ secrets.ETHERSCAN_KEY }} >> .env echo CERAMIC_NETWORK=testnet-clay >> .env echo NODE_ENV=production >> .env - run: yarn install --frozen-lockfile diff --git a/apps/core-app/src/components/ActionDisplay.tsx b/apps/core-app/src/components/ActionDisplay.tsx new file mode 100644 index 000000000..6b8d3ea38 --- /dev/null +++ b/apps/core-app/src/components/ActionDisplay.tsx @@ -0,0 +1,143 @@ +import { + ArgType, + isEthAddress, + isValidNetwork, + ValidNetwork, +} from '@daohaus/common-utilities'; +import { DecodedMultiTX, isActionError } from '@daohaus/tx-builder-feature'; +import { AddressDisplay, Bold, DataSm, Divider, H4 } from '@daohaus/ui'; +import React from 'react'; +import { useParams } from 'react-router-dom'; +import styled from 'styled-components'; + +const DisplayContainer = styled.div` + margin-top: 2rem; + + .display-segment { + display: flex; + flex-direction: column; + } + + .data { + word-break: break-all; + margin-bottom: 2rem; + .space, + .address-display { + margin-bottom: 2rem; + } + } + .value-box { + display: flex; + } +`; + +export const ActionDisplay = ({ actions }: { actions: DecodedMultiTX }) => { + const { daochain } = useParams(); + const network = isValidNetwork(daochain) ? daochain : undefined; + return ( + + {actions.map((action, index) => { + if (isActionError(action)) { + return ( +
+

Action {index + 1}: Error

+ {action.message} + + + HEX DATA: + + {action.data} +
+ ); + } + return ( +
+
+

+ Action {index + 1}: {action.name} +

+ + TARGET + + + + VALUE + + {action.value} + +
+ {action.params.map((arg, index) => { + return ( +
+ + + PARAM + {index + 1}:{' '} + + {arg.name} + + + TYPE: + {arg.type} + + + + VALUE: + + + +
+ ); + })} +
+ ); + })} +
+ ); +}; + +const ValueDisplay = ({ + argValue, + network, +}: { + argValue: ArgType; + network?: ValidNetwork; +}) => { + if (Array.isArray(argValue)) { + return ( + <> + {argValue.map((value, index) => { + return ( +
+ + {index + 1 < argValue?.length && } +
+ ); + })} + + ); + } + if (isEthAddress(argValue)) { + return ( + + ); + } + if (typeof argValue === 'boolean') { + return {`${argValue}`}; + } + if (typeof argValue === 'string' || typeof argValue === 'number') { + return {argValue}; + } + + return {argValue.toString()}; +}; diff --git a/apps/core-app/src/components/ProposalDetailsGuts.tsx b/apps/core-app/src/components/ProposalDetailsGuts.tsx index 87a0aede4..f10b8997a 100644 --- a/apps/core-app/src/components/ProposalDetailsGuts.tsx +++ b/apps/core-app/src/components/ProposalDetailsGuts.tsx @@ -22,6 +22,7 @@ const OverviewContainer = styled.div` gap: 1.2rem; width: 100%; padding: 2.8rem 3.6rem; + border-radius: ${border.radius}; border: 1px ${({ theme }: { theme: Theme }) => theme.card.border} solid; background-color: ${({ theme }: { theme: Theme }) => theme.card.hoverBg}; diff --git a/apps/core-app/src/pages/ProposalDetails.tsx b/apps/core-app/src/pages/ProposalDetails.tsx index 29e84e5dc..92ab654ed 100644 --- a/apps/core-app/src/pages/ProposalDetails.tsx +++ b/apps/core-app/src/pages/ProposalDetails.tsx @@ -23,16 +23,21 @@ import { getProposalTypeLabel } from '../utils/general'; import { ProposalActions } from '../components/proposalCards/ProposalActions'; import { CancelProposal } from '../components/CancelProposal'; import { - ActionError, - DecodedAction, + DecodedMultiTX, decodeProposalActions, } from '@daohaus/tx-builder-feature'; +import { ActionDisplay } from '../components/ActionDisplay'; + +// generate a random hex string that is 900 characters long const OverviewCard = styled(Card)` + display: flex; + flex-direction: column; width: 64rem; padding: 2rem; border: none; margin-bottom: 3.4rem; + height: fit-content; @media ${widthQuery.md} { max-width: 100%; min-width: 0; @@ -59,7 +64,8 @@ export function ProposalDetails() { ITransformedProposalQuery['proposal'] | undefined >(); const [proposalLoading, setProposalLoading] = useState(false); - const [, setActionData] = useState<(DecodedAction | ActionError)[] | null>(); + const [actionData, setActionData] = useState(); + const fetchProposal = useCallback(() => { const shouldUpdate = true; if (!daochain || !daoid || !proposalId) return; @@ -123,6 +129,7 @@ export function ProposalDetails() { left={ {proposal && } + {actionData && } } right={ diff --git a/libs/tx-builder-feature/src/utils/decoding.ts b/libs/tx-builder-feature/src/utils/decoding.ts index 5b7ddfe2f..9f7f11c7d 100644 --- a/libs/tx-builder-feature/src/utils/decoding.ts +++ b/libs/tx-builder-feature/src/utils/decoding.ts @@ -1,5 +1,6 @@ import { BigNumber, utils } from 'ethers'; import { + ArgType, CONTRACTS, ValidNetwork, ZERO_ADDRESS, @@ -29,16 +30,23 @@ export type DecodedAction = { params: { name: string; type: string; - value: string; + value: ArgType; }[]; }; export type ActionError = { - error?: boolean; - message?: string; + error: boolean; + message: string; data: string; }; +export type DecodedMultiTX = (DecodedAction | ActionError)[]; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export const isActionError = (action: any): action is ActionError => { + return action.error; +}; + const getMultisendHex = ({ chainId, actionData }: MultisendArgs) => { const multisendAddr = CONTRACTS.GNOSIS_MULTISEND[chainId]; if (!multisendAddr) throw new Error('Invalid chainId'); diff --git a/libs/ui/src/components/molecules/AddressDisplay/AddressDisplay.styles.tsx b/libs/ui/src/components/molecules/AddressDisplay/AddressDisplay.styles.tsx index 7d911d29c..4606f9a63 100644 --- a/libs/ui/src/components/molecules/AddressDisplay/AddressDisplay.styles.tsx +++ b/libs/ui/src/components/molecules/AddressDisplay/AddressDisplay.styles.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components'; import { Theme } from '../../../types/theming'; -import { DataMd } from '../../atoms'; +import { DataSm } from '../../atoms'; export const AddressContainer = styled.div` display: flex; @@ -10,7 +10,7 @@ export const AddressContainer = styled.div` gap: 1rem; `; -export const AddressDataMd = styled(DataMd)` +export const AddressDataSm = styled(DataSm)` color: ${({ theme }: { theme: Theme }) => theme.tint.secondary}; `; diff --git a/libs/ui/src/components/molecules/AddressDisplay/AddressDisplay.tsx b/libs/ui/src/components/molecules/AddressDisplay/AddressDisplay.tsx index f9699ef5d..f4f37b5e1 100644 --- a/libs/ui/src/components/molecules/AddressDisplay/AddressDisplay.tsx +++ b/libs/ui/src/components/molecules/AddressDisplay/AddressDisplay.tsx @@ -10,7 +10,7 @@ import { Theme } from '../../../types/theming'; import { AddressContainer, AddressCopyIcon, - AddressDataMd, + AddressDataSm, } from './AddressDisplay.styles'; import { Icon, Link } from '../../atoms'; import { useCopyToClipboard } from '../../../hooks'; @@ -23,6 +23,7 @@ type AddressDisplayProps = { truncate?: boolean; txHash?: boolean; textOverride?: string; + className?: string; }; export const AddressDisplay = ({ @@ -32,6 +33,7 @@ export const AddressDisplay = ({ truncate, txHash, textOverride, + className, ...props }: AddressDisplayProps) => { const theme = useTheme() as Theme; @@ -57,10 +59,10 @@ export const AddressDisplay = ({ const displayAddress = truncate ? truncateAddress(address) : address; return ( - - + + {textOverride ? textOverride : displayAddress} - + {copy && (