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

fix(fuselage): Responsive CardControls #1443

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
9 changes: 9 additions & 0 deletions packages/fuselage/src/components/Card/Card.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,13 @@ $card-hero-padding: lengths.padding(28);
display: flex;
align-items: center;
}
&__controls{
flex-wrap: wrap;
}
&__horizontal &__controls{
flex-wrap: nowrap;
&--wrap{
flex-wrap: wrap;
}
}
}
17 changes: 14 additions & 3 deletions packages/fuselage/src/components/Card/CardControls.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
const CardControls = ({ ...props }) => (
<div className='rcx-card__controls' {...props} />
);
import { useBreakpoints } from '@rocket.chat/fuselage-hooks';
import Box from '../Box/Box';

const CardControls = ({...props }) => {
const breakpoints = useBreakpoints();
const isMobile = !breakpoints.includes('sm');
return (
<Box
rcx-card__controls
rcx-card__controls--wrap={isMobile}
{...props}
/>
)
}
Barrylimarti marked this conversation as resolved.
Show resolved Hide resolved

export default CardControls;