Commit 98ec03cd authored by tom's avatar tom

withCopy to noCopy prop

parent bd94c0ee
...@@ -30,7 +30,7 @@ const TransactionTagListItem = ({ item, isLoading, onEditClick, onDeleteClick }: ...@@ -30,7 +30,7 @@ const TransactionTagListItem = ({ item, isLoading, onEditClick, onDeleteClick }:
<TxEntity <TxEntity
hash={ item.transaction_hash } hash={ item.transaction_hash }
isLoading={ isLoading } isLoading={ isLoading }
withCopy noCopy={ false }
fontWeight={ 600 } fontWeight={ 600 }
maxW="100%" maxW="100%"
/> />
......
...@@ -32,8 +32,8 @@ const TransactionTagTableItem = ({ item, isLoading, onEditClick, onDeleteClick } ...@@ -32,8 +32,8 @@ const TransactionTagTableItem = ({ item, isLoading, onEditClick, onDeleteClick }
<TxEntity <TxEntity
hash={ item.transaction_hash } hash={ item.transaction_hash }
isLoading={ isLoading } isLoading={ isLoading }
noCopy={ false }
fontWeight={ 600 } fontWeight={ 600 }
withCopy
/> />
</Td> </Td>
<Td> <Td>
......
...@@ -101,7 +101,6 @@ const Copy = (props: CopyProps) => { ...@@ -101,7 +101,6 @@ const Copy = (props: CopyProps) => {
<EntityBase.Copy <EntityBase.Copy
{ ...props } { ...props }
text={ props.address.hash } text={ props.address.hash }
withCopy={ props.withCopy ?? true }
/> />
); );
}; };
......
...@@ -24,8 +24,7 @@ export interface EntityBaseProps { ...@@ -24,8 +24,7 @@ export interface EntityBaseProps {
href?: string; href?: string;
query?: Record<string, string>; query?: Record<string, string>;
noIcon?: boolean; noIcon?: boolean;
// TODO @tom2drum rename to noCopy noCopy?: boolean;
withCopy?: boolean;
tailLength?: number; tailLength?: number;
truncation?: Truncation; truncation?: Truncation;
} }
...@@ -133,10 +132,10 @@ const Content = chakra(({ className, isLoading, asProp, text, truncation = 'dyna ...@@ -133,10 +132,10 @@ const Content = chakra(({ className, isLoading, asProp, text, truncation = 'dyna
); );
}); });
export type CopyBaseProps = Pick<CopyToClipboardProps, 'isLoading' | 'text'> & Pick<EntityBaseProps, 'withCopy'>; export type CopyBaseProps = Pick<CopyToClipboardProps, 'isLoading' | 'text'> & Pick<EntityBaseProps, 'noCopy'>;
const Copy = (props: CopyBaseProps) => { const Copy = (props: CopyBaseProps) => {
if (!props.withCopy) { if (props.noCopy) {
return null; return null;
} }
......
...@@ -122,7 +122,6 @@ const Copy = (props: CopyProps) => { ...@@ -122,7 +122,6 @@ const Copy = (props: CopyProps) => {
<EntityBase.Copy <EntityBase.Copy
{ ...props } { ...props }
text={ props.token.address } text={ props.token.address }
withCopy={ props.withCopy ?? true }
/> />
); );
}; };
......
...@@ -58,7 +58,7 @@ test('with copy +@dark-mode', async({ mount }) => { ...@@ -58,7 +58,7 @@ test('with copy +@dark-mode', async({ mount }) => {
<TestApp> <TestApp>
<TxEntity <TxEntity
hash={ hash } hash={ hash }
withCopy noCopy={ false }
/> />
</TestApp>, </TestApp>,
); );
......
...@@ -56,6 +56,8 @@ const Copy = (props: CopyProps) => { ...@@ -56,6 +56,8 @@ const Copy = (props: CopyProps) => {
<EntityBase.Copy <EntityBase.Copy
{ ...props } { ...props }
text={ props.hash } text={ props.hash }
// by default we don't show copy icon, maybe this should be revised
noCopy={ props.noCopy ?? true }
/> />
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment