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

Don't show menu when there's only one viewport or browser #72

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Sep 4, 2023

This yields a more minimalist UI if there is only one viewport and/or browser:

Screenshot 2023-09-04 at 17 02 56

(here we have one viewport, one browser)

Compare to the UI when we do have multiple viewports / browsers:

Screenshot 2023-09-04 at 17 03 18

I also renamed "viewport" to "mode" and updated the icon.

With tooltips:

Screen Recording 2023-09-04 at 19.20.25
📦 Published PR as canary version: 0.0.55--canary.72.51f5eed.0

✨ Test out this PR locally via:

npm install @chromaui/addon-visual-tests@0.0.55--canary.72.51f5eed.0
# or 
yarn add @chromaui/addon-visual-tests@0.0.55--canary.72.51f5eed.0

@linear
Copy link

linear bot commented Sep 4, 2023

AP-3554 When only a single item in a dropdown, convert to presentational version

What I am seeing:

image.png

What I expect:

I would expect to see something like what we do with the browser select:

image.png

  1. Remove the arrow
  2. Only have a hover state (no click) that shows "View mode: 1200px"

Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

LGTM! Very minor comments

src/components/BrowserSelector.tsx Outdated Show resolved Hide resolved
src/components/ModeSelector.tsx Outdated Show resolved Hide resolved
@ghengeveld ghengeveld merged commit e8515ba into main Sep 5, 2023
6 checks passed
@ghengeveld ghengeveld deleted the ghengeveld/ap-3554-when-only-a-single-item-in-a-dropdown-convert-to branch September 5, 2023 11:04
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