Refactor settings > data model section (#2031)

This commit is contained in:
Charles Bochet
2023-10-15 19:00:07 +02:00
committed by GitHub
parent e9d0c8a928
commit b128d53b58
21 changed files with 160 additions and 164 deletions

View File

@ -0,0 +1,45 @@
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
const StyledContainer = styled.div`
align-items: center;
display: flex;
gap: ${({ theme }) => theme.spacing(3)};
padding: ${({ theme }) => theme.spacing(1)};
`;
const StyledSubContainer = styled.div`
align-items: center;
display: flex;
gap: ${({ theme }) => theme.spacing(1)};
`;
const StyledItemLabel = styled.div`
color: ${({ theme }) => theme.font.color.secondary};
font-size: ${({ theme }) => theme.font.size.sm};
font-style: normal;
font-weight: ${({ theme }) => theme.font.size.md};
line-height: ${({ theme }) => theme.text.lineHeight.md};
`;
type SettingsObjectIconWithLabelProps = {
Icon: IconComponent;
label: string;
};
export const SettingsObjectIconWithLabel = ({
Icon,
label,
}: SettingsObjectIconWithLabelProps) => {
const theme = useTheme();
return (
<StyledContainer>
<StyledSubContainer>
<Icon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />
<StyledItemLabel>{label}</StyledItemLabel>
</StyledSubContainer>
</StyledContainer>
);
};