Skip to content

Commit

Permalink
refactor: move CopySvg to own file
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajpiar committed Oct 25, 2024
1 parent de388ab commit 99cb93e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
26 changes: 3 additions & 23 deletions src/components/Address/AddressOrAlias.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clipPath="url(#clip0_4759_1391)">
<path
d="M5.33334 5.33301V3.46634C5.33334 2.7196 5.33334 2.34624 5.47867 2.06102C5.6065 1.81014 5.81047 1.60616 6.06136 1.47833C6.34657 1.33301 6.71994 1.33301 7.46668 1.33301H12.5333C13.2801 1.33301 13.6534 1.33301 13.9387 1.47833C14.1895 1.60616 14.3935 1.81014 14.5214 2.06102C14.6667 2.34624 14.6667 2.7196 14.6667 3.46634V8.53301C14.6667 9.27974 14.6667 9.65311 14.5214 9.93833C14.3935 10.1892 14.1895 10.3932 13.9387 10.521C13.6534 10.6663 13.2801 10.6663 12.5333 10.6663H10.6667M3.46668 14.6663H8.53334C9.28008 14.6663 9.65345 14.6663 9.93866 14.521C10.1895 14.3932 10.3935 14.1892 10.5214 13.9383C10.6667 13.6531 10.6667 13.2797 10.6667 12.533V7.46634C10.6667 6.7196 10.6667 6.34624 10.5214 6.06102C10.3935 5.81014 10.1895 5.60616 9.93866 5.47833C9.65345 5.33301 9.28008 5.33301 8.53334 5.33301H3.46668C2.71994 5.33301 2.34657 5.33301 2.06136 5.47833C1.81047 5.60616 1.6065 5.81014 1.47867 6.06102C1.33334 6.34624 1.33334 6.7196 1.33334 7.46634V12.533C1.33334 13.2797 1.33334 13.6531 1.47867 13.9383C1.6065 14.1892 1.81047 14.3932 2.06136 14.521C2.34657 14.6663 2.71994 14.6663 3.46668 14.6663Z"
stroke={color}
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_4759_1391">
<rect width="16" height="16" fill={color} />
</clipPath>
</defs>
</svg>
)
}

type CopyStatus = 'success' | 'error'

export const AddressOrAlias: React.FC<AddressProps> = ({ addressOrAlias }) => {
Expand Down
20 changes: 20 additions & 0 deletions src/components/CopySvg/CopySvg.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const CopySvg = ({ color = 'white' }) => {
return (
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clipPath="url(#clip0_4759_1391)">
<path
d="M5.33334 5.33301V3.46634C5.33334 2.7196 5.33334 2.34624 5.47867 2.06102C5.6065 1.81014 5.81047 1.60616 6.06136 1.47833C6.34657 1.33301 6.71994 1.33301 7.46668 1.33301H12.5333C13.2801 1.33301 13.6534 1.33301 13.9387 1.47833C14.1895 1.60616 14.3935 1.81014 14.5214 2.06102C14.6667 2.34624 14.6667 2.7196 14.6667 3.46634V8.53301C14.6667 9.27974 14.6667 9.65311 14.5214 9.93833C14.3935 10.1892 14.1895 10.3932 13.9387 10.521C13.6534 10.6663 13.2801 10.6663 12.5333 10.6663H10.6667M3.46668 14.6663H8.53334C9.28008 14.6663 9.65345 14.6663 9.93866 14.521C10.1895 14.3932 10.3935 14.1892 10.5214 13.9383C10.6667 13.6531 10.6667 13.2797 10.6667 12.533V7.46634C10.6667 6.7196 10.6667 6.34624 10.5214 6.06102C10.3935 5.81014 10.1895 5.60616 9.93866 5.47833C9.65345 5.33301 9.28008 5.33301 8.53334 5.33301H3.46668C2.71994 5.33301 2.34657 5.33301 2.06136 5.47833C1.81047 5.60616 1.6065 5.81014 1.47867 6.06102C1.33334 6.34624 1.33334 6.7196 1.33334 7.46634V12.533C1.33334 13.2797 1.33334 13.6531 1.47867 13.9383C1.6065 14.1892 1.81047 14.3932 2.06136 14.521C2.34657 14.6663 2.71994 14.6663 3.46668 14.6663Z"
stroke={color}
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</g>
<defs>
<clipPath id="clip0_4759_1391">
<rect width="16" height="16" fill={color} />
</clipPath>
</defs>
</svg>
)
}
1 change: 1 addition & 0 deletions src/components/CopySvg/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { CopySvg } from './CopySvg'

0 comments on commit 99cb93e

Please sign in to comment.