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

Update Storybook stories with new sidenav display logic #696

Merged
merged 22 commits into from
Mar 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3c3c839
fix(sidenav): update react report storybook example
brentswisher Mar 1, 2024
2c6cf64
fix(sidenav): update web component reports storybook example
brentswisher Mar 1, 2024
aa5e71b
fix(layout): default sidenav layouts to open
brentswisher Mar 4, 2024
39f71ae
fix(sidenav): update storybook mobile breakpoint to match wc version
brentswisher Mar 4, 2024
45e802f
chore: add changeset
brentswisher Mar 4, 2024
374c8f1
fix(sidenav): default stories to use close button
brentswisher Mar 5, 2024
eb988ad
fix(sidenav): update import syntax
brentswisher Mar 5, 2024
7872a6b
Merge branch 'release/14.0.0' into bugfix/storybook-side-navigation
brentswisher Mar 6, 2024
75a5450
refactor: update sidenav stories to use a ResizeObserver
brentswisher Mar 6, 2024
9513276
chore: trigger new build
daneah Mar 7, 2024
030561c
chore(deps-dev): bump vite from 4.3.9 to 4.5.2 (#672)
dependabot[bot] Jan 20, 2024
df1137e
DropdownMenuNav: Add pharos-elevation-level-3 token (#670)
mtorres3 Jan 22, 2024
e526157
Update link, dropdown-menu-nav, and popover to use a11y-label (#675)
sirrah-tam Jan 23, 2024
c9fdffb
Fix the all-contributors badge (#680)
daneah Feb 6, 2024
5812187
Icon: Add "add to folder" icon (#678)
mariadevadoss Feb 13, 2024
3b5432b
chore: version packages (#685)
github-actions[bot] Feb 13, 2024
4fe4245
chore(deps): bump ip from 1.1.8 to 1.1.9 (#687)
dependabot[bot] Feb 21, 2024
3246aed
fix(icon): add media query style for WHCM (#689)
sirrah-tam Feb 22, 2024
826086f
chore(deps): bump es5-ext from 0.10.62 to 0.10.64 (#692)
dependabot[bot] Feb 27, 2024
d958675
chore(deps): upgrade to Yarn 4 (#694)
daneah Mar 1, 2024
73369cb
fix: prevent report example from being tree-shaken
brentswisher Mar 7, 2024
bca6eeb
Merge branch 'release/14.0.0' into bugfix/storybook-side-navigation
daneah Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(sidenav): update storybook mobile breakpoint to match wc version
  • Loading branch information
brentswisher committed Mar 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 39f71aea90185e94e0cf0bc629a0d687282d6135
7 changes: 4 additions & 3 deletions packages/pharos/src/pages/reports/react/ReportExample.tsx
Original file line number Diff line number Diff line change
@@ -17,14 +17,15 @@ import {
} from '../../../react-components';

export const ReportExample: FC = () => {
const [isMobile, setIsMobile] = useState<boolean>(window.innerWidth < 1000);
const mobileBreakpoint = 1055;
const [isMobile, setIsMobile] = useState<boolean>(window.innerWidth < mobileBreakpoint);
const [isSidenavDisplayed, setIsSidenavDisplayed] = useState<boolean>(!isMobile);

useEffect(() => {
const handleResize = () => {
const windowWidth = window.innerWidth;
setIsSidenavDisplayed(windowWidth >= 1000);
setIsMobile(windowWidth < 1000);
setIsSidenavDisplayed(windowWidth >= mobileBreakpoint);
setIsMobile(windowWidth < mobileBreakpoint);
};

window.addEventListener('resize', handleResize);