Skip to content

Commit

Permalink
pr-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
salman-neslit committed Dec 5, 2024
1 parent 85c9e05 commit 986f5fd
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
justify-content: left;
padding: 4px 0 4px 12px;
}

&.no-background {
background-color: transparent;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div
className={
communityInfo ? 'TruncatedAddress with-community' : 'TruncatedAddress'
}
className={clsx('TruncatedAddress', {
'with-community': communityInfo,
'no-background': showCommunityname,
})}
>
{communityInfo && (
<CWCommunityAvatar
Expand All @@ -32,7 +36,8 @@ export const CWTruncatedAddress = ({
size="small"
/>
)}
{formatAddressShort(address)}
{showCommunityname && communityInfo?.name}
{address && formatAddressShort(address)}
</div>
);
};

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -57,11 +56,12 @@ const AddressDetails = (props: AddressDetailsProps) => {

return (
<div className="AddressDetails">
<CWCommunityInfo
<CWTruncatedAddress
communityInfo={{
iconUrl: fetchedCommunity?.icon_url || '',
name: fetchedCommunity?.name || '',
}}
showCommunityname
/>
<PopoverMenu
menuItems={[
Expand All @@ -71,7 +71,7 @@ const AddressDetails = (props: AddressDetailsProps) => {
},
]}
renderTrigger={(onclick) => (
<CWIconButton iconName="dotsVertical" onClick={onclick} />
<CWIconButton iconName="dotsHorizontal" onClick={onclick} />
)}
/>
</div>
Expand Down

0 comments on commit 986f5fd

Please sign in to comment.