-
Notifications
You must be signed in to change notification settings - Fork 34
[MKT-834]:feat: account popover new design #1943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
e892e86
88ce551
bfb1f4e
06b4f99
7dab121
877b9f8
aa6d615
15252f1
15e5d4e
2d881fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { UserSettings } from '@internxt/sdk/dist/shared/types/userSettings'; | ||
| import { useTranslationContext } from 'app/i18n/provider/TranslationProvider'; | ||
| import { Desktop, SignOut, Gear, Gift } from '@phosphor-icons/react'; | ||
| import { Desktop, SignOut, Gear, Gift, User, Megaphone } from '@phosphor-icons/react'; | ||
| import i18next from 'i18next'; | ||
| import { ReactNode } from 'react'; | ||
| import { Popover } from '@internxt/ui'; | ||
|
|
@@ -44,14 +44,16 @@ export default function AccountPopover({ className = '', user, plan }: Readonly< | |
|
|
||
| const percentageUsed = Math.round((usage / limit) * 100) || 0; | ||
|
|
||
| const separator = <div className="border-translate mx-3 my-0.5 border-gray-10" />; | ||
| const separator = <div className="border-translate mx-3 my-0.5 bg-gray-10 h-[1px]" />; | ||
|
|
||
| const FEEDBACK_URL = 'https://internxt.userjot.com/'; | ||
|
|
||
| function onLogout() { | ||
| dispatch(userThunks.logoutThunk()); | ||
| } | ||
|
|
||
| const panel = ( | ||
| <div className="w-52"> | ||
| <div className="w-56"> | ||
| <div className="flex items-center p-3"> | ||
| {avatarWrapper} | ||
| <div className="ml-2 min-w-0"> | ||
|
|
@@ -76,7 +78,7 @@ export default function AccountPopover({ className = '', user, plan }: Readonly< | |
| </p> | ||
| {plan.showUpgrade && ( | ||
| <button | ||
| className="w-full cursor-pointer text-sm font-medium text-primary no-underline" | ||
| className="w-min whitespace-nowrap cursor-pointer text-sm font-medium text-primary no-underline" | ||
| onClick={() => { | ||
| navigationService.openPreferencesDialog({ | ||
| section: 'account', | ||
|
|
@@ -91,10 +93,20 @@ export default function AccountPopover({ className = '', user, plan }: Readonly< | |
| )} | ||
| </div> | ||
| {separator} | ||
| <Item onClick={() => desktopService.openDownloadAppUrl(translate)}> | ||
| <Desktop size={20} /> | ||
| <p className="ml-3 truncate">{translate('views.account.popover.downloadApp')}</p> | ||
| </Item> | ||
| <button | ||
| className="flex w-full cursor-pointer items-center px-3 py-2 text-gray-80 no-underline hover:bg-gray-1 hover:text-gray-80 dark:hover:bg-gray-10" | ||
| onClick={() => { | ||
| navigationService.openPreferencesDialog({ | ||
| section: 'account', | ||
| subsection: 'account', | ||
| workspaceUuid: selectedWorkspace?.workspaceUser.workspaceId, | ||
| }); | ||
| dispatch(uiActions.setIsPreferencesDialogOpen(true)); | ||
| }} | ||
| > | ||
| <User size={20} /> | ||
| <p className="ml-3">{translate('views.account.popover.account')}</p> | ||
| </button> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replaced! |
||
| <button | ||
| className="flex w-full cursor-pointer items-center px-3 py-2 text-gray-80 no-underline hover:bg-gray-1 hover:text-gray-80 dark:hover:bg-gray-10" | ||
| onClick={() => { | ||
|
|
@@ -109,6 +121,11 @@ export default function AccountPopover({ className = '', user, plan }: Readonly< | |
| <Gear size={20} /> | ||
| <p className="ml-3">{translate('views.account.popover.settings')}</p> | ||
| </button> | ||
| <Item onClick={() => desktopService.openDownloadAppUrl(translate)}> | ||
| <Desktop size={20} /> | ||
| <p className="ml-3 truncate">{translate('views.account.popover.downloadApp')}</p> | ||
| </Item> | ||
| {separator} | ||
| {isReferralEligible && ( | ||
| <Item | ||
| onClick={() => { | ||
|
|
@@ -127,6 +144,10 @@ export default function AccountPopover({ className = '', user, plan }: Readonly< | |
| <p className="ml-3 truncate">{translate('views.account.popover.referAndEarn')}</p> | ||
| </Item> | ||
| )} | ||
| <Item onClick={() => window.open(FEEDBACK_URL, '_blank', 'noopener,noreferrer')}> | ||
| <Megaphone size={20} className="-scale-x-100" /> | ||
| <p className="ml-3 truncate">{translate('views.account.popover.giveFeedback')}</p> | ||
| </Item> | ||
| {separator} | ||
| <Item onClick={onLogout}> | ||
| <SignOut size={20} /> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The symbols for ‘spaceUsed’ are no longer the same as before, is this change correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the text because it was too long and threw off the layout quite a bit there was a line break that caused the {{space}} text to appear below it, making it look a bit odd. Everything was too cramped. The literal translations change is “Used storage space” -> “Used storage”