Skip to content

Commit

Permalink
refactor(SalaryAndBenefits): inline Benefit.tsx in SalaryAndBenefits.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Aug 22, 2024
1 parent 617eff3 commit 9f418b6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 31 deletions.
19 changes: 11 additions & 8 deletions src/salaryAndBenefits/SalaryAndBenefits.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className={styles.wrapper}>
<Text type="h1">{salaryAndBenefits.basicTitle}</Text>
<div className={styles.benefits}>
{salaryAndBenefits.benefits.map((benefit) => (
<Benefit key={benefit._key} benefit={benefit} />
<div key={benefit._key} className={styles.benefitWrapper}>
<Text type="h2">{benefit.basicTitle}</Text>
<RichText value={benefit.richText} />
</div>
))}
</div>
</div>
)
}
);
};

export default SalaryAndBenefits;
export default SalaryAndBenefits;
18 changes: 0 additions & 18 deletions src/salaryAndBenefits/components/benefit/Benefit.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions src/salaryAndBenefits/components/benefit/benefit.module.css

This file was deleted.

6 changes: 6 additions & 0 deletions src/salaryAndBenefits/salaryAndBenefits.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@
flex-direction: column;
gap: 5rem;
max-width: var(--max-content-width-medium);
}

.benefitWrapper {
display: flex;
flex-direction: column;
gap: 1rem;
}

0 comments on commit 9f418b6

Please sign in to comment.