diff --git a/src/pages/profile/index.tsx b/src/pages/profile/index.tsx index 47087d1..14ddbb6 100644 --- a/src/pages/profile/index.tsx +++ b/src/pages/profile/index.tsx @@ -19,8 +19,8 @@ import { State } from '../../store/rootReducer' import { getRoboHashPicture, hexToNpub, shorten } from '../../utils' import { truncate } from 'lodash' import { getProfileSettingsRoute } from '../../routes' -import EditIcon from '@mui/icons-material/Edit'; -import LinkIcon from '@mui/icons-material/Link'; +import EditIcon from '@mui/icons-material/Edit' +import LinkIcon from '@mui/icons-material/Link' import { LoadingSpinner } from '../../components/LoadingSpinner' export const ProfilePage = () => { @@ -112,7 +112,11 @@ export const ProfilePage = () => { * @param sx props (MUI) to customize style * @returns HTML rendered text */ - const textElementWithCopyIcon = (text: string, sx?: SxProps, shortenOffset?: number) => { + const textElementWithCopyIcon = ( + text: string, + sx?: SxProps, + shortenOffset?: number + ) => { const onClick = () => { navigator.clipboard.writeText(text) @@ -153,8 +157,14 @@ export const ProfilePage = () => { {isLoading && } {pubkey && ( - - {profileMetadata && profileMetadata.banner ? : ''} + + {profileMetadata && profileMetadata.banner ? ( + + ) : ( + '' + )} @@ -175,64 +185,92 @@ export const ProfilePage = () => { - - {nostrJoiningBlock ? `On nostr since ${nostrJoiningBlock.block.toLocaleString()}` : 'On nostr since: unknown'} + target="_blank" + sx={{ color: '#7b7b7b', marginTop: '15px', display: 'block' }} + variant="caption" + > + {nostrJoiningBlock + ? `On nostr since ${nostrJoiningBlock.block.toLocaleString()}` + : 'On nostr since: unknown'} {isUsersOwnProfile && ( - navigate(getProfileSettingsRoute(pubkey))}> - + navigate(getProfileSettingsRoute(pubkey))} + > + )} - - + + {profileMetadata && ( + - {profileMetadata && - - {truncate( - profileMetadata.display_name || - profileMetadata.name || - hexToNpub(pubkey), - { - length: 16 - } - )} - } - - - {textElementWithCopyIcon(hexToNpub(pubkey) || '', { color: '#5e5e5e' }, 5)} - - - {profileMetadata?.nip05 && - textElementWithCopyIcon(profileMetadata.nip05, { color: '#5e5e5e' })} - - - {profileMetadata?.lud16 && - textElementWithCopyIcon(profileMetadata.lud16, { color: '#5e5e5e' })} - - - - - {profileMetadata?.website && ( - - {profileMetadata.website} - - - )} - + {truncate( + profileMetadata.display_name || + profileMetadata.name || + hexToNpub(pubkey), + { + length: 16 + } + )} + + )} + + {textElementWithCopyIcon( + hexToNpub(pubkey) || '', + { color: '#5e5e5e' }, + 5 + )} + + + {profileMetadata?.nip05 && + textElementWithCopyIcon(profileMetadata.nip05, { + color: '#5e5e5e' + })} + + + {profileMetadata?.lud16 && + textElementWithCopyIcon(profileMetadata.lud16, { + color: '#5e5e5e' + })} + + + + + {profileMetadata?.website && ( + + + {profileMetadata.website} + + + + )} + + {profileMetadata?.about && ( diff --git a/src/pages/settings/profile/index.tsx b/src/pages/settings/profile/index.tsx index 7bde460..9b68872 100644 --- a/src/pages/settings/profile/index.tsx +++ b/src/pages/settings/profile/index.tsx @@ -297,7 +297,9 @@ export const ProfileSettingsPage = () => { src={profileMetadata.banner} alt="Banner Image" /> - ): No banner found } + ) : ( + No banner found + )} {editItem('banner', 'Banner URL', undefined, undefined)}