Skip to content
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

Implement the v2 assets/transactions pages using PenumbraUI #1607

Merged
merged 29 commits into from
Aug 8, 2024

Conversation

jessepinho
Copy link
Contributor

@jessepinho jessepinho commented Jul 31, 2024

This PR creates the first two v2 pages! I started with the simplest ones (assets/transactions) even though they're not 100% ready yet in Figma, because I wanted to just get something shipped.

Note that the layouts are a bit narrow at the moment. But I'm just following Figma designs, so please direct design feedback to Sam 😆 That said, these can be merged as a work in progress, because we're still building out the v2 layouts.

Screen.Recording.2024-08-05.at.9.54.18.PM.mov

In this PR

  • Create v2-prefixed routes for the new pages, and add them to the main router.
  • Implement the assets and transactions pages.
  • Create a hexOpacity() helper so I can stop making TEN_PERCENT_OPACITY_IN_HEX consts.
  • Create a<Display /> component that handles page max widths and horizontal margins.
  • Fix some sizing issues with <Dialog />
    • Sam pointed out the the sizing of the <Dialog /> component should be based on a grid, just like the sizing of regular components on the page. So I had to rework the <Dialog /> component a bit so that the dialog is wrapped in a <Display /> and a <Grid /> and fits the specs in Figma.
  • Add some missing values to the theme, and update some others, per Figma.
  • Make it possible to use a fixed-layout table.

Copy link

changeset-bot bot commented Jul 31, 2024

⚠️ No Changeset found

Latest commit: 207028b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Jul 31, 2024

Visit the preview URL for this PR (updated for commit 207028b):

https://penumbra-ui-preview--pr1607-jessepinho-assets-tr-ck5qw87m.web.app

(expires Thu, 15 Aug 2024 17:51:01 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 709d729610ef7a6369b23f1cb2b820a60cc685b1

@jessepinho jessepinho force-pushed the jessepinho/assets-transactions branch 2 times, most recently from 501cf1f to b9f13a6 Compare August 1, 2024 16:33
Base automatically changed from jessepinho/card-2 to jessepinho/card August 1, 2024 16:59
Base automatically changed from jessepinho/card to main August 1, 2024 17:10
@jessepinho jessepinho force-pushed the jessepinho/assets-transactions branch 3 times, most recently from 6012e7a to 0d10fc4 Compare August 2, 2024 20:33
@jessepinho jessepinho changed the base branch from main to jessepinho/more-components August 2, 2024 21:47
@jessepinho jessepinho force-pushed the jessepinho/assets-transactions branch from 607ef0e to 8924ade Compare August 3, 2024 00:29
Base automatically changed from jessepinho/more-components to main August 5, 2024 18:02
@jessepinho jessepinho force-pushed the jessepinho/assets-transactions branch from e9b2d2d to 85b47a7 Compare August 5, 2024 18:03
@jessepinho jessepinho changed the title WIP: Implement the assets/transactions tables using PenumbraUI WIP: Implement the assets/transactions pages using PenumbraUI Aug 6, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used here/here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used here/here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

[v2PathPrefix(PagePath.TRANSACTIONS)]: <TransactionsCardTitle />,
};

export const DashboardLayout = () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied almost verbatim from the original, except this one references the new <ValueViewComponent /> and adds the context='table' prop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Comment on lines +16 to +17
/** @todo: Remove next line after we switch to v2 layout */
str = str.replace('/v2', '');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed this to make page path matching work with v2 paths

@@ -28,7 +35,7 @@ export interface CardProps {
* ```
*/
as?: WebTarget;
title?: string;
title?: ReactNode;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Card titles can now be rich content

import * as RadixDialog from '@radix-ui/react-dialog';
import { Text } from '../Text';
import { Icon } from '../Icon';
import { X } from 'lucide-react';
import { ButtonGroup, ButtonGroupProps } from '../ButtonGroup';

const gradualBlur = (blur: string) => keyframes`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This animation was causing problems with the backdrop-filter of the dialog background, so I nixed it for now. Apparently this is a known limitation of backdrop-filter in Chrome.

@@ -66,6 +50,8 @@ const DialogContent = styled(RadixDialog.Content)`
display: flex;
flex-direction: column;
gap: ${props => props.theme.spacing(6)};

pointer-events: auto;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had to add pointer-events: auto here because we're using pointer-events: none on DialogContent above, so that clicks on DialogContent are passed through to the Overlay and thus close the dialog.

@jessepinho jessepinho force-pushed the jessepinho/assets-transactions branch 2 times, most recently from f030fc9 to f998dc3 Compare August 6, 2024 04:50
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jessepinho jessepinho changed the title WIP: Implement the assets/transactions pages using PenumbraUI Implement the assets/transactions pages using PenumbraUI Aug 6, 2024
@jessepinho jessepinho force-pushed the jessepinho/assets-transactions branch from 5a85e8b to 2e3af3c Compare August 8, 2024 01:01
<Grid tablet={8} desktop={6} xl={4}>
<Card title={CARD_TITLE_BY_PATH[v2PathPrefix(pagePath)]}>
<div className='flex flex-col gap-4'>
<Tabs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (a11y, yet non-blocking): i noticed the Tabs are a little off with the designs:

  1. When hovered, there's no border-radius, the tabs are squared
  2. Using tab key on the assets pages doesn't show the outlines on some elements, so i didn't know where my focus is. It would be good to outline or apply hover styles on the focused tabs.
  3. tab doesn't focus the "info" icon next to the "Asset balances" title. It more of the issue with Button iconOnly component
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, this is not exactly related to this page, so feel free to just not forget to fix the issues in other PRs :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. A more annoying issue. On the video, i use tab a couple of times. Firstly, there are no outline described in points 2-3, but then tab goes to the assets swap link. Notice how it takes two tabs to focus out of the asset.
kqp.mp4

packages/ui/src/ValueViewComponent/index.tsx Show resolved Hide resolved
Copy link
Contributor

@VanishMax VanishMax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the code structure and the how easy it it to read it. Only one blocking issue

packages/ui/src/Button/index.tsx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants