Introduce accent for chips (#911)

* Introduce accent for chips

* Add top bar on Mobile on Settings pages

* Various fixes

* Fix according to peer review
This commit is contained in:
Charles Bochet
2023-07-24 16:49:33 -07:00
committed by GitHub
parent b2f4108d89
commit d6afbe8e8e
23 changed files with 166 additions and 279 deletions

View File

@ -1,20 +1,29 @@
import styled from '@emotion/styled';
import { useIsMobile } from '../../hooks/useIsMobile';
import { TopBar } from '../top-bar/components/TopBar';
import { RightDrawerContainer } from './RightDrawerContainer';
type OwnProps = {
children: JSX.Element | JSX.Element[];
title: string;
icon: React.ReactNode;
};
const StyledContainer = styled.div`
const StyledContainer = styled.div<{ isMobile: boolean }>`
display: flex;
padding-top: ${({ theme }) => theme.spacing(4)};
flex-direction: column;
padding-top: ${({ theme, isMobile }) => (!isMobile ? theme.spacing(4) : 0)};
width: 100%;
`;
export function SubMenuTopBarContainer({ children }: OwnProps) {
export function SubMenuTopBarContainer({ children, title, icon }: OwnProps) {
const isMobile = useIsMobile();
return (
<StyledContainer>
<StyledContainer isMobile={isMobile}>
{isMobile && <TopBar title={title} icon={icon} />}
<RightDrawerContainer topMargin={16}>{children}</RightDrawerContainer>
</StyledContainer>
);