From 99cb93ebaf646cf26945be00d4a3c581f2a6e116 Mon Sep 17 00:00:00 2001 From: Juraj Piar Date: Fri, 25 Oct 2024 10:11:57 +0100 Subject: [PATCH] refactor: move CopySvg to own file --- README.md | 5 ++--- src/components/Address/AddressOrAlias.tsx | 26 +++-------------------- src/components/CopySvg/CopySvg.tsx | 20 +++++++++++++++++ src/components/CopySvg/index.ts | 1 + 4 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 src/components/CopySvg/CopySvg.tsx create mode 100644 src/components/CopySvg/index.ts diff --git a/README.md b/README.md index bf610ad0..69b58cb9 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,11 @@ First, be sure that you are using Node Version 18+ Then update .env file with the correct data from respective files: + ``` .dev .testnet -.prod +.prod ``` the chosen set of variables depends on the targeted contract versions you planning to work with. `.dev` - same as the `.testnet` versions of the contract with an exception being reduced wait times of votingDelay, votingPeriod and timelockMinDelay for automation purposes. `.testnet` and `.mainnet` versions are aligned on time but target respective chains(chainIds) 31 and 30. @@ -99,8 +100,6 @@ Storybook has been configured to use Tailwind CSS. ## Unit testing -## Unit testing - The repository is configured to use [Jest as the Testing Framework](https://jestjs.io/). Please refer to the [Next.js official guide](https://nextjs.org/docs/app/building-your-application/testing/jest) for information on how to integrate Jest. To run the unit tests, use the following command: diff --git a/src/components/Address/AddressOrAlias.tsx b/src/components/Address/AddressOrAlias.tsx index c93da0d9..939d8440 100644 --- a/src/components/Address/AddressOrAlias.tsx +++ b/src/components/Address/AddressOrAlias.tsx @@ -1,33 +1,13 @@ -import { ADDRESS_ANIMATION_DURATION } from '@/lib/constants' import { useEffect, useState } from 'react' -import { Span } from '@/components/Typography' import { isAddress } from 'viem' +import { Span } from '@/components/Typography' +import { CopySvg } from '@/components/CopySvg' +import { ADDRESS_ANIMATION_DURATION } from '@/lib/constants' export interface AddressProps { addressOrAlias: string } -const CopySvg = ({ color = 'white' }) => { - return ( - - - - - - - - - - - ) -} - type CopyStatus = 'success' | 'error' export const AddressOrAlias: React.FC = ({ addressOrAlias }) => { diff --git a/src/components/CopySvg/CopySvg.tsx b/src/components/CopySvg/CopySvg.tsx new file mode 100644 index 00000000..f87afa45 --- /dev/null +++ b/src/components/CopySvg/CopySvg.tsx @@ -0,0 +1,20 @@ +export const CopySvg = ({ color = 'white' }) => { + return ( + + + + + + + + + + + ) +} diff --git a/src/components/CopySvg/index.ts b/src/components/CopySvg/index.ts new file mode 100644 index 00000000..778cee1b --- /dev/null +++ b/src/components/CopySvg/index.ts @@ -0,0 +1 @@ +export { CopySvg } from './CopySvg'