Skip to content

Commit

Permalink
Update breakpoint display to support style and flex shrink 0
Browse files Browse the repository at this point in the history
  • Loading branch information
calebjacob committed Nov 13, 2024
1 parent 4125314 commit 7be8a3c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-pagoda/ui",
"version": "2.0.14",
"version": "2.0.15",
"description": "A React component library that implements the official NEAR design system.",
"license": "MIT",
"repository": {
Expand Down
2 changes: 2 additions & 0 deletions src/components/BreakpointDisplay.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import '../styles/variables';

.breakpoint {
flex-shrink: 0;

&[data-show='sidebar-small-screen'],
&[data-show='smaller-than-desktop'] {
@media (min-width: calc(#{$tabletBreakpointMaxWidth} + 1px)) {
Expand Down
7 changes: 4 additions & 3 deletions src/components/BreakpointDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ReactNode } from 'react';
import { CSSProperties, type ReactNode } from 'react';

import s from './BreakpointDisplay.module.scss';

Expand All @@ -11,11 +11,12 @@ type Props = {
| 'smaller-than-tablet'
| 'larger-than-phone'
| 'larger-than-tablet';
style?: CSSProperties;
};

export const BreakpointDisplay = ({ children, className = '', show }: Props) => {
export const BreakpointDisplay = ({ children, className = '', show, ...props }: Props) => {
return (
<div className={`${s.breakpoint} ${className}`} data-show={show}>
<div className={`${s.breakpoint} ${className}`} data-show={show} {...props}>
{children}
</div>
);
Expand Down

0 comments on commit 7be8a3c

Please sign in to comment.