From 382ea0e328554250e412116d8edb780d6f20bbef Mon Sep 17 00:00:00 2001 From: Vaggelis Yfantis Date: Sat, 17 Feb 2024 01:05:16 +0200 Subject: [PATCH] fix(clerk-js): Align some sections in User Profile with the designs (#2814) * fix(clerk-js): Align some sections in User Profile with the designs * chore(repo): Add Changeset * fix(clerk-js): Align some sections in User Profile with the designs * fix(clerk-js): Fix spacing issues to mach the designs * chore(clerk-js): Revert accidental change * fix(clerk-js): Fix spacing for MFA section --- .changeset/nine-mangos-look.md | 2 ++ .../components/OrganizationProfile/DomainList.tsx | 5 ++++- .../UserProfile/ActiveDevicesSection.tsx | 8 +++----- .../UserProfile/ConnectedAccountsSection.tsx | 5 ++++- .../ui/components/UserProfile/EmailsSection.tsx | 5 ++++- .../UserProfile/EnterpriseAccountsSection.tsx | 1 + .../src/ui/components/UserProfile/MfaSection.tsx | 15 ++++++++++++--- .../ui/components/UserProfile/PhoneSection.tsx | 5 ++++- .../src/ui/components/UserProfile/Web3Section.tsx | 1 + .../clerk-js/src/ui/elements/ArrowBlockButton.tsx | 1 + packages/clerk-js/src/ui/elements/Section.tsx | 14 +++++++++++--- .../clerk-js/src/ui/elements/ThreeDotsMenu.tsx | 5 +++-- 12 files changed, 50 insertions(+), 17 deletions(-) create mode 100644 .changeset/nine-mangos-look.md diff --git a/.changeset/nine-mangos-look.md b/.changeset/nine-mangos-look.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/nine-mangos-look.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/DomainList.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/DomainList.tsx index b476400f3f..b19a231405 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/DomainList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/DomainList.tsx @@ -111,7 +111,10 @@ export const DomainList = withProtect( {domainList.map(domain => { return ( - + ({ gap: t.space.$1 })}> {domain.name} diff --git a/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx index 1f0969048a..16a03f9f6d 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx @@ -53,12 +53,10 @@ const DeviceItem = ({ session }: { session: SessionWithActivitiesResource }) => id='activeDevices' elementDescriptor={descriptors.activeDeviceListItem} elementId={isCurrent ? descriptors.activeDeviceListItem.setId('current') : undefined} - sx={t => ({ + hoverable + sx={{ alignItems: 'flex-start', - padding: `${t.space.$1x5} ${t.space.$1x5} ${t.space.$1x5} ${t.space.$3}`, - borderRadius: t.radii.$lg, - ':hover': { backgroundColor: t.colors.$neutralAlpha50 }, - })} + }} > {status.isLoading && } {!status.isLoading && ( diff --git a/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx index e6cae3a617..1ce07a35a1 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx @@ -61,7 +61,10 @@ export const ConnectedAccountsSection = withCardStateProvider(() => { return ( - + ({ overflow: 'hidden', gap: t.space.$2 })}> { {user?.emailAddresses.sort(primaryIdentificationFirst(user.primaryEmailAddressId)).map(email => ( - + ({ overflow: 'hidden', gap: t.space.$1 })} diff --git a/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx index d8cd2536af..9ea9e0215b 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx @@ -28,6 +28,7 @@ export const EnterpriseAccountsSection = () => { gap: t.space.$2, justifyContent: 'start', })} + hoverable key={account.id} > { {showTOTP && ( - + ({ gap: t.space.$2, alignItems: 'center' })}> { const isDefault = !showTOTP && phone.defaultSecondFactor; return ( - + ({ gap: t.space.$2, alignItems: 'center' })}> { {showBackupCode && ( - + ({ gap: t.space.$2, alignItems: 'center' })}> { {user?.phoneNumbers.sort(primaryIdentificationFirst(user.primaryPhoneNumberId)).map(phone => ( - + { key={wallet.id} id='web3Wallets' align='start' + hoverable > ({ alignItems: 'center', gap: t.space.$2, width: '100%' })}> {strategyToDisplayData[strategy].iconUrl && ( diff --git a/packages/clerk-js/src/ui/elements/ArrowBlockButton.tsx b/packages/clerk-js/src/ui/elements/ArrowBlockButton.tsx index 6b1d8596a1..4c7543c622 100644 --- a/packages/clerk-js/src/ui/elements/ArrowBlockButton.tsx +++ b/packages/clerk-js/src/ui/elements/ArrowBlockButton.tsx @@ -62,6 +62,7 @@ export const ArrowBlockButton = React.forwardRef { ); }; -type ProfileSectionItemProps = Omit, 'id'> & { id: ProfileSectionId }; +type ProfileSectionItemProps = Omit, 'id'> & { + id: ProfileSectionId; + hoverable?: boolean; +}; const ProfileSectionItem = (props: ProfileSectionItemProps) => { - const { children, id, sx, ...rest } = props; + const { children, id, sx, hoverable, ...rest } = props; return ( { justifyContent: 'space-between', width: '100%', alignItems: 'center', - padding: `${t.space.$1x5} ${t.space.$none} ${t.space.$1x5} ${t.space.$4}`, + padding: `${t.space.$2} ${t.space.$3} ${t.space.$1x5} ${t.space.$2x5}`, gap: t.space.$2, + ...(hoverable && { + padding: `${t.space.$1} ${t.space.$1} ${t.space.$1} ${t.space.$2x5}`, + borderRadius: t.radii.$lg, + ':hover': { backgroundColor: t.colors.$neutralAlpha50 }, + }), }), sx, ]} diff --git a/packages/clerk-js/src/ui/elements/ThreeDotsMenu.tsx b/packages/clerk-js/src/ui/elements/ThreeDotsMenu.tsx index 2c29d8ef24..64d3036924 100644 --- a/packages/clerk-js/src/ui/elements/ThreeDotsMenu.tsx +++ b/packages/clerk-js/src/ui/elements/ThreeDotsMenu.tsx @@ -24,7 +24,8 @@ export const ThreeDotsMenu = (props: ThreeDotsMenuProps) => {