From e69f190ca4fb5de46111a6cf4d75362e62a67df8 Mon Sep 17 00:00:00 2001 From: Zukron Alviandy Date: Wed, 20 May 2026 12:53:51 +0700 Subject: [PATCH 1/2] [CCUBE-2379] add itemGap props for review box --- src/components/custom/review/review.styles.ts | 14 +++++++++++++ src/components/custom/review/review.tsx | 6 ++++-- src/components/custom/review/types.ts | 2 ++ .../5-custom/review/review-box.stories.tsx | 21 +++++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 src/components/custom/review/review.styles.ts diff --git a/src/components/custom/review/review.styles.ts b/src/components/custom/review/review.styles.ts new file mode 100644 index 000000000..3fed56465 --- /dev/null +++ b/src/components/custom/review/review.styles.ts @@ -0,0 +1,14 @@ +import { UneditableSection } from "@lifesg/react-design-system/uneditable-section"; +import styled from "styled-components"; + +interface IBoxUneditableSectionProps { + $itemGap?: string | undefined; +} + +export const BoxUneditableSection = styled(UneditableSection)` + ${({ $itemGap }) => + $itemGap && + `ul { + row-gap: ${$itemGap}; + }`} +`; diff --git a/src/components/custom/review/review.tsx b/src/components/custom/review/review.tsx index a03d13384..ab3a8489b 100644 --- a/src/components/custom/review/review.tsx +++ b/src/components/custom/review/review.tsx @@ -16,6 +16,7 @@ import { TReviewSchema, TReviewSchemaItem, } from "./types"; +import { BoxUneditableSection } from "./review.styles"; export const Review = (props: IGenericCustomElementProps) => { // ============================================================================= @@ -202,10 +203,11 @@ export const Review = (props: IGenericCustomElementProps) => { }; const renderBox = (schema: IReviewSchemaBox) => { - const { label, description, topSection, bottomSection, ...otherSchema } = schema; + const { label, description, topSection, bottomSection, itemGap, ...otherSchema } = schema; return ( - ("review-custom-item-gap").bind({}); +WithCustomItemGap.storyName = "Custom Item Gap"; +WithCustomItemGap.args = { + referenceKey: "review", + label: "Your personal information", + description: "Retrieved on 27 Jun 2023", + items: SAMPLE_ITEMS, + itemGap: "4rem", +}; From 868a93ec2c069c9ea3594e16236f63bce57e2307 Mon Sep 17 00:00:00 2001 From: Zukron Alviandy Date: Fri, 22 May 2026 11:12:23 +0700 Subject: [PATCH 2/2] [CCUBE-2379] rename itemGap to rowGap for review box variant --- src/components/custom/review/review.styles.ts | 8 ++++---- src/components/custom/review/review.tsx | 4 ++-- src/components/custom/review/types.ts | 4 ++-- src/stories/5-custom/review/review-box.stories.tsx | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/custom/review/review.styles.ts b/src/components/custom/review/review.styles.ts index 3fed56465..aff8a3bd0 100644 --- a/src/components/custom/review/review.styles.ts +++ b/src/components/custom/review/review.styles.ts @@ -2,13 +2,13 @@ import { UneditableSection } from "@lifesg/react-design-system/uneditable-sectio import styled from "styled-components"; interface IBoxUneditableSectionProps { - $itemGap?: string | undefined; + $rowGap?: string | undefined; } export const BoxUneditableSection = styled(UneditableSection)` - ${({ $itemGap }) => - $itemGap && + ${({ $rowGap }) => + $rowGap && `ul { - row-gap: ${$itemGap}; + row-gap: ${$rowGap}; }`} `; diff --git a/src/components/custom/review/review.tsx b/src/components/custom/review/review.tsx index ab3a8489b..7155b1899 100644 --- a/src/components/custom/review/review.tsx +++ b/src/components/custom/review/review.tsx @@ -203,11 +203,11 @@ export const Review = (props: IGenericCustomElementProps) => { }; const renderBox = (schema: IReviewSchemaBox) => { - const { label, description, topSection, bottomSection, itemGap, ...otherSchema } = schema; + const { label, description, topSection, bottomSection, rowGap, ...otherSchema } = schema; return ( ("review-custom-item-gap").bind({}); -WithCustomItemGap.storyName = "Custom Item Gap"; -WithCustomItemGap.args = { +export const WithCustomRowGap = DefaultStoryTemplate("review-custom-row-gap").bind({}); +WithCustomRowGap.storyName = "Custom Row Gap"; +WithCustomRowGap.args = { referenceKey: "review", label: "Your personal information", description: "Retrieved on 27 Jun 2023", items: SAMPLE_ITEMS, - itemGap: "4rem", + rowGap: "4rem", };