-
Notifications
You must be signed in to change notification settings - Fork 11
fix: APP-582 User dropdown and "my orders" using Wallet Connect #2610
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
33cec16
fix: show account profile when connected with wc
blushi 8dd073e
fix: orders page available with credit card hidden warning
blushi b77cb85
fix: disable admin nav items
blushi 4fdfbcf
chore: rm unused imports
blushi bb1caab
chore: use h2 for CreditCardHidden title
blushi a08b656
fix: set walletConnect to false on disconnect
blushi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
web-marketplace/src/components/organisms/AdminNavigation/AdminNavigation.ListItem.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { useLingui } from '@lingui/react'; | ||
| import { | ||
| ListItem, | ||
| ListItemButton, | ||
| ListItemIcon, | ||
| ListItemText, | ||
| } from '@mui/material'; | ||
|
|
||
| import { cn } from 'web-components/src/utils/styles/cn'; | ||
|
|
||
| import { AdminNavigationItem } from './AdminNavigation.types'; | ||
| import { isSelected } from './AdminNavigation.utils'; | ||
|
|
||
| type AdminNavigationListItemProps = { | ||
| onNavItemClick: (sectionName: string) => void; | ||
| currentPath: string; | ||
| item: AdminNavigationItem; | ||
| }; | ||
| export const AdminNavigationListItem = ({ | ||
| onNavItemClick, | ||
| currentPath, | ||
| item, | ||
| }: AdminNavigationListItemProps) => { | ||
| const { _ } = useLingui(); | ||
|
|
||
| return ( | ||
| <ListItem disablePadding className="pb-1"> | ||
| <ListItemButton | ||
| disableRipple | ||
| className={cn( | ||
| 'flex p-2', | ||
| item.disabled | ||
| ? 'text-bc-neutral-400 cursor-default' | ||
| : 'cursor-pointer', | ||
| )} | ||
| onClick={() => { | ||
| if (!item.disabled) onNavItemClick(item.path); | ||
| }} | ||
| selected={isSelected(item.path, currentPath)} | ||
| sx={theme => ({ | ||
| '&.Mui-selected, &.Mui-selected:hover': { | ||
| backgroundColor: theme.palette.info.light, | ||
| borderRadius: '5px', | ||
| }, | ||
| '&:hover': { | ||
| backgroundColor: theme.palette.info.light, | ||
| borderRadius: '5px', | ||
| }, | ||
| })} | ||
| > | ||
| <ListItemIcon className="min-w-[40px]">{item.icon}</ListItemIcon> | ||
| <ListItemText className="w-full">{_(item.name)}</ListItemText> | ||
| </ListItemButton> | ||
| </ListItem> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
web-marketplace/src/components/organisms/RegistryLayout/RegistryLayout.utils.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,39 @@ | ||
| import { truncate } from 'web-components/src/utils/truncate'; | ||
|
|
||
| import { Account, Maybe } from 'generated/graphql'; | ||
| import { TranslatorType } from 'lib/i18n/i18n.types'; | ||
| import { PrivateAccount } from 'lib/queries/react-query/registry-server/getAccounts/getAccountsQuery.types'; | ||
|
|
||
| import { DEFAULT_NAME } from 'pages/ProfileEdit/ProfileEdit.constants'; | ||
| import { getDefaultAvatar } from 'pages/ProfileEdit/ProfileEdit.utils'; | ||
|
|
||
| type GetAddressParams = { | ||
| walletAddress?: string | null; | ||
| email?: string | null; | ||
| }; | ||
|
|
||
| export const getAddress = ({ walletAddress, email }: GetAddressParams) => | ||
| walletAddress ? truncate(walletAddress) : email; | ||
|
|
||
| type GetProfileParams = { | ||
| account?: Maybe<Pick<Account, 'id' | 'name' | 'image' | 'addr' | 'type'>>; | ||
| privActiveAccount?: PrivateAccount; | ||
| _: TranslatorType; | ||
| }; | ||
| export const getProfile = ({ | ||
| account, | ||
| privActiveAccount, | ||
| _, | ||
| }: GetProfileParams) => | ||
| account | ||
| ? { | ||
| id: account.id, | ||
| name: account.name ? account.name : _(DEFAULT_NAME), | ||
| profileImage: account.image ? account.image : getDefaultAvatar(account), | ||
| address: getAddress({ | ||
| walletAddress: account.addr, | ||
| email: privActiveAccount?.email, | ||
| }), | ||
| selected: true, | ||
| } | ||
| : undefined; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.