Skip to content

Commit d8ef795

Browse files
committed
feat : addresscopy 버튼 주소값으로 변경
1 parent c212ec1 commit d8ef795

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

src/shared/components/button/AddressCopy.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useState } from 'react';
66
import { Copy } from '@/shared/utils/copy';
77

88
const addressCopyStyle = cva(
9-
'flex items-center justify-start flex-shrink-0 rounded-full transition-all duration-200',
9+
'flex items-center justify-start flex-shrink-0 rounded-full transition-all duration-200 overflow-hidden',
1010
{
1111
variants: {
1212
variant: {
@@ -23,14 +23,14 @@ const addressCopyStyle = cva(
2323
interface AddressCopyProps
2424
extends React.HTMLAttributes<HTMLDivElement>,
2525
VariantProps<typeof addressCopyStyle> {
26-
label: string;
2726
value: string;
27+
truncate?: boolean;
2828
}
2929

3030
const AddressCopy = ({
31-
label = 'address copy',
32-
value = label,
31+
value,
3332
variant = 'gray',
33+
truncate = true,
3434
className,
3535
...props
3636
}: AddressCopyProps) => {
@@ -52,24 +52,29 @@ const AddressCopy = ({
5252
onClick={handleCopy}
5353
className={cn(
5454
addressCopyStyle({ variant }),
55-
'w-[35.4rem] h-[4rem] px-[1.3rem] py-[1rem] gap-[0.4rem]',
55+
'w-full h-[4rem] px-[1.3rem] py-[1rem] gap-[0.4rem]',
5656
'cursor-pointer select-none',
5757
className,
5858
)}
5959
{...props}
6060
>
61-
<Icon
62-
name='CopySimple'
63-
size={18}
64-
color={variant === 'mint' ? 'mint-400' : 'gray-400'}
65-
/>
61+
<div className='flex-shrink-0'>
62+
<Icon
63+
name={copied ? 'Check' : 'CopySimple'}
64+
size={18}
65+
color={variant === 'mint' ? 'mint-400' : 'gray-400'}
66+
/>
67+
</div>
6668
<span
6769
className={cn(
68-
'text-label-lg',
70+
'text-label-lg flex-1 min-w-0',
6971
variant === 'mint' ? 'text-mint-400' : 'text-gray-400',
72+
truncate &&
73+
'truncate whitespace-nowrap overflow-hidden text-ellipsis',
7074
)}
75+
title={value}
7176
>
72-
{label}
77+
{value}
7378
</span>
7479
</div>
7580
);

src/shared/components/container/Card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ const cardStyle = cva(
1111
},
1212
size: {
1313
medium:
14-
'w-[17rem] h-[17rem] flex-col items-center justify-center p-[1.2rem]',
14+
'w-full h-[17rem] flex-col items-center justify-center p-[1.2rem]',
1515
large:
16-
'w-[35.4rem] h-[12rem] flex-row items-start justify-start px-[1.3rem] pt-[1.1rem] pb-[3.3rem]',
16+
'w-full h-[12rem] flex-row items-start justify-start px-[1.3rem] pt-[1.1rem] pb-[3.3rem]',
1717
},
1818
},
1919
defaultVariants: {

0 commit comments

Comments
 (0)