Skip to content

Commit

Permalink
♻️ Pass props to SmileyBox component
Browse files Browse the repository at this point in the history
  • Loading branch information
petterhh committed Dec 12, 2024
1 parent 3e50ed2 commit 794d4e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/components/sections/learning/Learning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ export default function Learning({ section }: LearningProps) {
{section.basicTitle}
</Text>
<div className={styles.content}>
<SmileyBox description={section.description} />
<SmileyBox
description={section.description}
smileySide="right"
smileyType="shock"
backgroundColor="blue"
/>
<div className={styles.image}>
<SanityImage image={section.image} />
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/components/smileyBox/SmileyBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@ const backgroundColors = {
} as const;

type SmileyBoxProps = {
background?: "dark" | "light";
backgroundColor?: keyof typeof backgroundColors;
smileyType?: keyof typeof smileys;
smileySide?: "left" | "right";
description: string;
};

export default function SmileyBox({
description,
backgroundColor,
smileySide,
smileyType,
description,
}: SmileyBoxProps) {
const smiley = smileys[smileyType ?? "happy"];
const cssVariables = {
Expand Down

0 comments on commit 794d4e7

Please sign in to comment.