Skip to content

Commit

Permalink
move the features list component to a dedicated file
Browse files Browse the repository at this point in the history
  • Loading branch information
nilscox committed Aug 29, 2024
1 parent 60db7bb commit e319df2
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 56 deletions.
57 changes: 57 additions & 0 deletions src/layouts/secondary/features-list.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { Translate } from 'src/intl/translate';

import Autoscaling from './images/autoscaling.svg?react';
import Deploy from './images/deploy.svg?react';
import Global from './images/global.svg?react';
import StartForFree from './images/start-for-free.svg?react';

const T = Translate.prefix('layouts.secondary');

export function FeaturesList() {
return (
<ul className="col max-w-sm gap-6 font-gilroy">
<FeatureItem
Image={StartForFree}
title={<T id="startForFree.title" />}
description={<T id="startForFree.description" />}
/>

<FeatureItem
Image={Deploy}
title={<T id="deploy.title" />}
description={<T id="deploy.description" />}
/>

<FeatureItem
Image={Global}
title={<T id="global.title" />}
description={<T id="global.description" />}
/>

<FeatureItem
Image={Autoscaling}
title={<T id="autoscaling.title" />}
description={<T id="autoscaling.description" />}
/>
</ul>
);
}

type FeatureItemProps = {
Image: React.ComponentType<React.SVGProps<SVGSVGElement>>;
title: React.ReactNode;
description: React.ReactNode;
};

function FeatureItem({ Image, title, description }: FeatureItemProps) {
return (
<li className="row items-start gap-4">
<Image width={40} height={40} className="rounded-lg bg-green p-2" />

<div className="col flex-1 gap-2">
<div className="text-lg">{title}</div>
<div className="text-base text-dim">{description}</div>
</div>
</li>
);
}
57 changes: 1 addition & 56 deletions src/layouts/secondary/secondary-layout-two-tones.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import clsx from 'clsx';

import { ThemeMode, useForceThemeMode } from 'src/hooks/theme';
import { Translate } from 'src/intl/translate';

import Autoscaling from './images/autoscaling.svg?react';
import { FeaturesList } from './features-list';
import BGGridDark from './images/bg-grid-dark.svg';
import BGGridLight from './images/bg-grid-light.svg';
import Deploy from './images/deploy.svg?react';
import Global from './images/global.svg?react';
import StartForFree from './images/start-for-free.svg?react';
import { SecondaryLayoutHeader } from './secondary-layout-header';

const T = Translate.prefix('layouts.secondary');

type SecondaryLayoutTwoTonesProps = {
className?: string;
contentClassName?: string;
Expand Down Expand Up @@ -50,52 +44,3 @@ export function SecondaryLayoutTwoTones({
</div>
);
}

function FeaturesList() {
return (
<ul className="col max-w-sm gap-6 font-gilroy">
<FeatureItem
Image={StartForFree}
title={<T id="startForFree.title" />}
description={<T id="startForFree.description" />}
/>

<FeatureItem
Image={Deploy}
title={<T id="deploy.title" />}
description={<T id="deploy.description" />}
/>

<FeatureItem
Image={Global}
title={<T id="global.title" />}
description={<T id="global.description" />}
/>

<FeatureItem
Image={Autoscaling}
title={<T id="autoscaling.title" />}
description={<T id="autoscaling.description" />}
/>
</ul>
);
}

type FeatureItemProps = {
Image: React.ComponentType<React.SVGProps<SVGSVGElement>>;
title: React.ReactNode;
description: React.ReactNode;
};

function FeatureItem({ Image, title, description }: FeatureItemProps) {
return (
<li className="row items-start gap-4">
<Image width={40} height={40} className="rounded-lg bg-green p-2" />

<div className="col flex-1 gap-2">
<div className="text-lg">{title}</div>
<div className="text-base text-dim">{description}</div>
</div>
</li>
);
}

0 comments on commit e319df2

Please sign in to comment.