-
Notifications
You must be signed in to change notification settings - Fork 118
feat: add activities page #678
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
22 commits
Select commit
Hold shift + click to select a range
9a27bae
feat: activities center
effie-ms bb44d56
refactor: final button
effie-ms 7ee767c
fix: deduplication
effie-ms 4877424
Merge branch 'main' into feat-activities
effie-ms 0b7a50e
refactor: update icon
effie-ms a9440f6
refactor: limit stored routes to the most recent 100
effie-ms 5714fd4
Merge branch 'main' into feat-activities
effie-ms 6b45880
refactor: move deduplication into history combine
effie-ms 34ced53
refactor: add bg to activities button
effie-ms 111d6dc
refactor: show store items before history api is loaded
effie-ms 5ad13cf
feat: add menu button to manage failed transactions
effie-ms 8eb68e7
feat: styled dialogs
effie-ms e136fbb
chore: merge main into feat-activities
chybisov f8b6013
feat: implement context menu
effie-ms 15051b9
fix: deduplication on render
effie-ms 9a243d8
fix: filter deleteRoutes by account addresses
effie-ms 4467f65
Merge branch 'main' into feat-activities
effie-ms 9aef27a
refactor: update transaction deletion label to 'clear', fix backdrop
effie-ms 21fdb87
fix: set minWidth of ErrorBadge to 16 for consistent styling
effie-ms ccad6db
Merge branch 'main' into feat-activities
effie-ms ea0a620
refactor: cleanup duplicate components
effie-ms 8e57519
Merge branch 'main' into feat-activities
effie-ms 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
112 changes: 0 additions & 112 deletions
112
packages/widget/src/components/ActiveTransactions/ActiveTransactionItem.tsx
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
packages/widget/src/components/ActiveTransactions/ActiveTransactions.style.ts
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
packages/widget/src/components/ActiveTransactions/ActiveTransactions.tsx
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { IconButton, styled } from '@mui/material' | ||
| import type React from 'react' | ||
|
|
||
| export const ContextMenuButton: React.FC< | ||
| React.ComponentProps<typeof IconButton> | ||
| > = styled(IconButton)(({ theme }) => ({ | ||
| position: 'absolute', | ||
| top: theme.spacing(1.75), | ||
| right: theme.spacing(2), | ||
| '&:hover': { | ||
| backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`, | ||
| }, | ||
| })) |
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,75 @@ | ||
| import MoreVertIcon from '@mui/icons-material/MoreVert' | ||
| import type { SxProps, Theme } from '@mui/material' | ||
| import { MenuItem } from '@mui/material' | ||
| import { type JSX, useId, useState } from 'react' | ||
| import { useTranslation } from 'react-i18next' | ||
| import { ContextMenuButton } from './ContextMenu.style.js' | ||
| import { Menu } from './Menu.js' | ||
|
|
||
| export interface ContextMenuItemConfig { | ||
| icon: React.ReactNode | ||
| label: string | ||
| onClick: () => void | ||
| } | ||
|
|
||
| interface ContextMenuProps { | ||
| items: ContextMenuItemConfig[] | ||
| disabled?: boolean | ||
| buttonSx?: SxProps<Theme> | ||
| } | ||
|
|
||
| export const ContextMenu = ({ | ||
| items, | ||
| disabled, | ||
| buttonSx, | ||
| }: ContextMenuProps): JSX.Element => { | ||
| const { t } = useTranslation() | ||
| const menuId = useId() | ||
| const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null) | ||
| const open = Boolean(anchorEl) | ||
|
|
||
| const handleOpen = (e: React.MouseEvent<HTMLButtonElement>) => { | ||
| setAnchorEl(e.currentTarget) | ||
| } | ||
|
|
||
| const closeMenu = () => { | ||
| setAnchorEl(null) | ||
| } | ||
|
|
||
| const handleItemClick = (onClick: () => void) => () => { | ||
| onClick() | ||
| closeMenu() | ||
| } | ||
|
|
||
| return ( | ||
| <> | ||
| <ContextMenuButton | ||
| aria-label={t('button.options')} | ||
| aria-controls={open ? menuId : undefined} | ||
| aria-haspopup="true" | ||
| aria-expanded={open ? 'true' : undefined} | ||
| onClick={handleOpen} | ||
| sx={{ opacity: disabled ? 0.5 : 1, ...buttonSx }} | ||
| disableRipple | ||
| > | ||
| <MoreVertIcon fontSize="small" /> | ||
| </ContextMenuButton> | ||
| <Menu | ||
| id={menuId} | ||
| elevation={0} | ||
| anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }} | ||
| transformOrigin={{ vertical: 'top', horizontal: 'right' }} | ||
| anchorEl={anchorEl} | ||
| open={open} | ||
| onClose={closeMenu} | ||
| > | ||
| {items.map((item) => ( | ||
| <MenuItem key={item.label} onClick={handleItemClick(item.onClick)}> | ||
| {item.icon} | ||
| {item.label} | ||
| </MenuItem> | ||
| ))} | ||
| </Menu> | ||
| </> | ||
| ) | ||
| } | ||
Oops, something went wrong.
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.
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.
see: CSS anchors. This may simplify the setup.
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.
Interesting. MUI's
MenuneedsanchorElthough. Plus browser support on Safari? Too new 😄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.
Yeah, yeah. MUI :)) right.