From 9f418b63e9a2ab1f26a99e9bc2ea81b5ab4da51c Mon Sep 17 00:00:00 2001 From: Mathias Oterhals Myklebust Date: Thu, 22 Aug 2024 09:48:12 +0200 Subject: [PATCH] refactor(SalaryAndBenefits): inline Benefit.tsx in SalaryAndBenefits.tsx --- src/salaryAndBenefits/SalaryAndBenefits.tsx | 19 +++++++++++-------- .../components/benefit/Benefit.tsx | 18 ------------------ .../components/benefit/benefit.module.css | 5 ----- .../salaryAndBenefits.module.css | 6 ++++++ 4 files changed, 17 insertions(+), 31 deletions(-) delete mode 100644 src/salaryAndBenefits/components/benefit/Benefit.tsx delete mode 100644 src/salaryAndBenefits/components/benefit/benefit.module.css diff --git a/src/salaryAndBenefits/SalaryAndBenefits.tsx b/src/salaryAndBenefits/SalaryAndBenefits.tsx index a462e8086..4f1278efd 100644 --- a/src/salaryAndBenefits/SalaryAndBenefits.tsx +++ b/src/salaryAndBenefits/SalaryAndBenefits.tsx @@ -1,23 +1,26 @@ import styles from "./salaryAndBenefits.module.css"; import Text from "src/components/text/Text"; -import {SalaryAndBenefits as SalaryAndBenefitsPayload} from "studio/lib/payloads/salaryAndBenefits"; -import Benefit from './components/benefit/Benefit'; +import { SalaryAndBenefits as SalaryAndBenefitsPayload } from "studio/lib/payloads/salaryAndBenefits"; +import { RichText } from "src/components/richText/RichText"; interface SalaryAndBenefitsProps { - salaryAndBenefits: SalaryAndBenefitsPayload + salaryAndBenefits: SalaryAndBenefitsPayload; } -const SalaryAndBenefits = ({salaryAndBenefits}: SalaryAndBenefitsProps) => { +const SalaryAndBenefits = ({ salaryAndBenefits }: SalaryAndBenefitsProps) => { return (
{salaryAndBenefits.basicTitle}
{salaryAndBenefits.benefits.map((benefit) => ( - +
+ {benefit.basicTitle} + +
))}
- ) -} + ); +}; -export default SalaryAndBenefits; \ No newline at end of file +export default SalaryAndBenefits; diff --git a/src/salaryAndBenefits/components/benefit/Benefit.tsx b/src/salaryAndBenefits/components/benefit/Benefit.tsx deleted file mode 100644 index ca31af62f..000000000 --- a/src/salaryAndBenefits/components/benefit/Benefit.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import Text from "src/components/text/Text"; -import { RichText } from '../../../components/richText/RichText'; -import {Benefit as BenefitPayload} from 'studio/lib/payloads/salaryAndBenefits'; -import styles from "./benefit.module.css"; - - -interface BenefitProps { - benefit: BenefitPayload; -} - -export default function Benefit({benefit}: BenefitProps) { - return ( -
- {benefit.basicTitle} - -
- ) -} \ No newline at end of file diff --git a/src/salaryAndBenefits/components/benefit/benefit.module.css b/src/salaryAndBenefits/components/benefit/benefit.module.css deleted file mode 100644 index e6df59537..000000000 --- a/src/salaryAndBenefits/components/benefit/benefit.module.css +++ /dev/null @@ -1,5 +0,0 @@ -.wrapper { - display: flex; - flex-direction: column; - gap: 1rem; -} \ No newline at end of file diff --git a/src/salaryAndBenefits/salaryAndBenefits.module.css b/src/salaryAndBenefits/salaryAndBenefits.module.css index e07e765c4..c53fdbc23 100644 --- a/src/salaryAndBenefits/salaryAndBenefits.module.css +++ b/src/salaryAndBenefits/salaryAndBenefits.module.css @@ -10,4 +10,10 @@ flex-direction: column; gap: 5rem; max-width: var(--max-content-width-medium); +} + +.benefitWrapper { + display: flex; + flex-direction: column; + gap: 1rem; } \ No newline at end of file