♻️(app-desk) replace classname spacings

Replace the classname spacings with the new
spacing system based on props.
This commit is contained in:
Anthony LC
2024-05-02 17:18:03 +02:00
committed by Anthony LC
parent d8e7f29072
commit 88109623ba
13 changed files with 36 additions and 24 deletions

View File

@@ -20,7 +20,7 @@ export const TextErrors = ({
causes.map((cause, i) => ( causes.map((cause, i) => (
<Text <Text
key={`causes-${i}`} key={`causes-${i}`}
className="mt-s" $margin={{ top: 'small' }}
$theme="danger" $theme="danger"
$textAlign="center" $textAlign="center"
{...textProps} {...textProps}
@@ -31,7 +31,7 @@ export const TextErrors = ({
{!causes && ( {!causes && (
<Text <Text
className="mt-s" $margin={{ top: 'small' }}
$theme="danger" $theme="danger"
$textAlign="center" $textAlign="center"
{...textProps} {...textProps}

View File

@@ -40,7 +40,7 @@ export const Header = () => {
<StyledHeader> <StyledHeader>
<RedStripe /> <RedStripe />
<Box <Box
className="ml-bx mr-bx" $margin={{ horizontal: 'xbig' }}
$align="center" $align="center"
$justify="space-between" $justify="space-between"
$direction="row" $direction="row"
@@ -55,7 +55,7 @@ export const Header = () => {
/> />
<Box $align="center" $gap="1rem" $direction="row"> <Box $align="center" $gap="1rem" $direction="row">
<Image priority src={IconImpress} alt={t('Impress Logo')} /> <Image priority src={IconImpress} alt={t('Impress Logo')} />
<Text className="m-0" as="h2" $theme="primary"> <Text $margin="none" as="h2" $theme="primary">
{t('Impress')} {t('Impress')}
</Text> </Text>
</Box> </Box>

View File

@@ -14,12 +14,13 @@ export const Menu = () => {
return ( return (
<Box <Box
as="menu" as="menu"
className="m-0 p-0" $padding="none"
$margin="none"
$background={colorsTokens()['primary-800']} $background={colorsTokens()['primary-800']}
$height="100%" $height="100%"
$justify="space-between" $justify="space-between"
> >
<Box className="pt-l" $direction="column" $gap="0.8rem"> <Box $padding={{ top: 'large' }} $direction="column" $gap="0.8rem">
<MenuItem Icon={IconPad} label={t('Pad')} href="/" alias={['/pads/']} /> <MenuItem Icon={IconPad} label={t('Pad')} href="/" alias={['/pads/']} />
</Box> </Box>
</Box> </Box>

View File

@@ -52,7 +52,8 @@ const MenuItem = ({ Icon, label, href, alias }: MenuItemProps) => {
style={{ display: 'block' }} style={{ display: 'block' }}
> >
<Box <Box
className="m-st p-t" $margin="xtiny"
$padding="tiny"
as="li" as="li"
$justify="center" $justify="center"
$css={` $css={`

View File

@@ -26,7 +26,8 @@ export const Tooltip = ({
<Popover parentRef={parentRef} onClickOutside={() => ''} borderless> <Popover parentRef={parentRef} onClickOutside={() => ''} borderless>
<Box <Box
aria-label="tooltip" aria-label="tooltip"
className="ml-t p-t" $padding="tiny"
$margin={{ left: 'tiny' }}
$background={backgroundColor} $background={backgroundColor}
$radius="4px" $radius="4px"
$css={` $css={`

View File

@@ -43,7 +43,7 @@ export const PadToolBox = ({ pad }: PadToolBoxProps) => {
return ( return (
<Box <Box
className="m-b" $margin="big"
$align="center" $align="center"
$direction="row" $direction="row"
$gap="1rem" $gap="1rem"

View File

@@ -15,7 +15,12 @@ export const PadEditor = ({ pad }: PadEditorProps) => {
return ( return (
<> <>
<PadToolBox pad={pad} /> <PadToolBox pad={pad} />
<Card className="m-b p-b" $css="margin-top:0;flex:1;" $overflow="auto"> <Card
$margin={{ top: 'none', all: 'big' }}
$padding="big"
$css="flex:1;"
$overflow="auto"
>
<Text as="h2" $align="center"> <Text as="h2" $align="center">
{pad.title} {pad.title}
</Text> </Text>

View File

@@ -30,7 +30,7 @@ export const CardCreatePad = () => {
return ( return (
<Card <Card
className="p-b" $padding="big"
$height="70%" $height="70%"
$justify="space-between" $justify="space-between"
$width="100%" $width="100%"

View File

@@ -55,7 +55,7 @@ export const PadItem = ({ pad }: PadItemProps) => {
return ( return (
<Box <Box
className="m-0" $margin="none"
as="li" as="li"
$css={` $css={`
transition: all 0.2s ease-in; transition: all 0.2s ease-in;

View File

@@ -22,7 +22,7 @@ const PadListState = ({ isLoading, isError, pads }: PanelTeamsStateProps) => {
if (isError) { if (isError) {
return ( return (
<Box $justify="center" className="mb-b"> <Box $justify="center" $margin={{ bottom: 'big' }}>
<Text $theme="danger" $align="center" $textAlign="center"> <Text $theme="danger" $align="center" $textAlign="center">
{t('Something bad happens, please refresh the page.')} {t('Something bad happens, please refresh the page.')}
</Text> </Text>
@@ -32,7 +32,7 @@ const PadListState = ({ isLoading, isError, pads }: PanelTeamsStateProps) => {
if (isLoading) { if (isLoading) {
return ( return (
<Box $align="center" className="m-l"> <Box $align="center" $margin="large">
<Loader /> <Loader />
</Box> </Box>
); );
@@ -40,8 +40,13 @@ const PadListState = ({ isLoading, isError, pads }: PanelTeamsStateProps) => {
if (!pads?.length) { if (!pads?.length) {
return ( return (
<Box $justify="center" className="m-s"> <Box $justify="center" $margin="small">
<Text as="p" className="mb-0 mt-0" $theme="greyscale" $variation="500"> <Text
as="p"
$margin={{ vertical: 'none' }}
$theme="greyscale"
$variation="500"
>
{t('0 group to display.')} {t('0 group to display.')}
</Text> </Text>
<Text as="p" $theme="greyscale" $variation="500"> <Text as="p" $theme="greyscale" $variation="500">
@@ -85,7 +90,8 @@ export const PadList = () => {
}} }}
scrollContainer={containerRef.current} scrollContainer={containerRef.current}
as="ul" as="ul"
className="p-0 mt-0" $padding="none"
$margin={{ top: 'none' }}
role="listbox" role="listbox"
> >
<PadListState isLoading={isLoading} isError={isError} pads={pads} /> <PadListState isLoading={isLoading} isError={isError} pads={pads} />

View File

@@ -61,13 +61,11 @@ export const Panel = () => {
`} `}
> >
<Box <Box
className="pr-l pl-s pt-s pb-s" $padding={{ all: 'small', right: 'large' }}
$direction="row" $direction="row"
$align="center" $align="center"
$justify="space-between" $justify="space-between"
$css={` $css={`border-bottom: 1px solid ${colorsTokens()['primary-300']};`}
border-bottom: 1px solid ${colorsTokens()['primary-300']};
`}
> >
<Text $weight="bold" $size="1.25rem"> <Text $weight="bold" $size="1.25rem">
{t('Recents')} {t('Recents')}

View File

@@ -18,7 +18,7 @@ const Page: NextPageWithLayout = () => {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<Box $align="center" className="m-auto" $height="70vh" $gap="2rem"> <Box $align="center" $margin="auto" $height="70vh" $gap="2rem">
<Icon404 aria-label="Image 404" role="img" /> <Icon404 aria-label="Image 404" role="img" />
<Text $size="h2" $weight="700" $theme="greyscale" $variation="900"> <Text $size="h2" $weight="700" $theme="greyscale" $variation="900">
@@ -31,7 +31,7 @@ const Page: NextPageWithLayout = () => {
)} )}
</Text> </Text>
<Box className="mt-l"> <Box $margin={{ top: 'large' }}>
<StyledLink href="/"> <StyledLink href="/">
<StyledButton>{t('Back to home page')}</StyledButton> <StyledButton>{t('Back to home page')}</StyledButton>
</StyledLink> </StyledLink>

View File

@@ -7,7 +7,7 @@ import { NextPageWithLayout } from '@/types/next';
const Page: NextPageWithLayout = () => { const Page: NextPageWithLayout = () => {
return ( return (
<Box className="p-l" $justify="center" $align="start" $height="inherit"> <Box $padding="large" $justify="center" $align="start" $height="inherit">
<CardCreatePad /> <CardCreatePad />
</Box> </Box>
); );