diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.scss b/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.scss index c530021eb7c..c55917063ab 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.scss +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.scss @@ -18,4 +18,8 @@ justify-content: left; padding: 4px 0 4px 12px; } + + &.no-background { + background-color: transparent; + } } diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.tsx index 61273826628..385f369d192 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_truncated_address.tsx @@ -2,26 +2,30 @@ import React from 'react'; import './cw_truncated_address.scss'; +import clsx from 'clsx'; import { formatAddressShort } from '../../../helpers'; import { CWCommunityAvatar } from './cw_community_avatar'; type TruncatedAddressProps = { - address: string; + address?: string; communityInfo?: { iconUrl: string; name: string; }; + showCommunityname?: boolean; }; export const CWTruncatedAddress = ({ address, communityInfo, + showCommunityname, }: TruncatedAddressProps) => { return (
{communityInfo && ( )} - {formatAddressShort(address)} + {showCommunityname && communityInfo?.name} + {address && formatAddressShort(address)}
); }; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunityInfo/CWCommunityInfo.scss b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunityInfo/CWCommunityInfo.scss deleted file mode 100644 index e6a1af46786..00000000000 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunityInfo/CWCommunityInfo.scss +++ /dev/null @@ -1,10 +0,0 @@ -.CommunityInfo { - width: 136px; - gap: 8px; - justify-content: left; - padding: 4px 0 4px 12px; - display: flex; - align-items: center; - font-weight: 500; - font-size: 14px; -} diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunityInfo/CWCommunityInfo.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunityInfo/CWCommunityInfo.tsx deleted file mode 100644 index 781a3a7ec83..00000000000 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunityInfo/CWCommunityInfo.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; - -import { CWCommunityAvatar } from '../../cw_community_avatar'; -import './CWCommunityInfo.scss'; - -type CommunityAddressProps = { - communityInfo?: { - iconUrl: string; - name: string; - }; -}; - -export const CWCommunityInfo = ({ communityInfo }: CommunityAddressProps) => { - return ( -
- {communityInfo && ( - - )} - {communityInfo?.name} -
- ); -}; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunityInfo/index.ts b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunityInfo/index.ts deleted file mode 100644 index ff9ba079efa..00000000000 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWCommunityInfo/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CWCommunityInfo } from './CWCommunityInfo'; - -export default CWCommunityInfo; diff --git a/packages/commonwealth/client/scripts/views/components/linked_addresses.tsx b/packages/commonwealth/client/scripts/views/components/linked_addresses.tsx index 37160d26361..18b3c90eee8 100644 --- a/packages/commonwealth/client/scripts/views/components/linked_addresses.tsx +++ b/packages/commonwealth/client/scripts/views/components/linked_addresses.tsx @@ -10,7 +10,6 @@ import type NewProfile from '../../models/NewProfile'; import { DeleteAddressModal } from '../modals/delete_address_modal'; import { CWIconButton } from './component_kit/cw_icon_button'; import { CWTruncatedAddress } from './component_kit/cw_truncated_address'; -import CWCommunityInfo from './component_kit/new_designs/CWCommunityInfo'; import { CWModal } from './component_kit/new_designs/CWModal'; import { CWTable } from './component_kit/new_designs/CWTable'; import { CWTableColumnInfo } from './component_kit/new_designs/CWTable/CWTable'; @@ -57,11 +56,12 @@ const AddressDetails = (props: AddressDetailsProps) => { return (
- { }, ]} renderTrigger={(onclick) => ( - + )} />