Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (g2c): qa changes to match figma #770

Merged
merged 4 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/libs/webforms/G2C/v202401.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const v202401: FormSchema = {
appendClassName: DefaultFieldGroupProps.appendClassName,
removeText: "Remove above population",
appendVariant: "default",
lastDivider: "border-primary border-b-[2px]",
},
fields: [
{
Expand All @@ -72,6 +73,7 @@ export const v202401: FormSchema = {
rhf: "Textarea",
label: "Eligibility group(s) included",
labelClassName: "font-bold text-black",
props: { className: "w-[40rem]" },
rules: {
required: "* Required",
pattern: {
Expand All @@ -88,7 +90,7 @@ export const v202401: FormSchema = {
{
name: "inc-greater-than",
rhf: "Input",
label: "Income greater than",
label: "Income greater than ($)",
labelClassName: "text-black",
rules: {
required: "* Required",
Expand All @@ -102,7 +104,7 @@ export const v202401: FormSchema = {
{
name: "inc-lesser-than",
rhf: "Input",
label: "Income less than or equal to",
label: "Income less than or equal to ($)",
labelClassName: "text-black",
rules: {
required: "* Required",
Expand Down
2 changes: 2 additions & 0 deletions lib/packages/shared-types/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export type RHFComponentMap = {
removeText?: string;
fieldArrayClassName?: string;
divider?: boolean;
lastDivider?: string;
appendClassName?: string;
appendVariant?: "default" | "outline" | "ghost" | "secondary";
};
Expand Down Expand Up @@ -189,6 +190,7 @@ export type FieldArrayProps<
removeText?: string;
fieldArrayClassName?: string;
divider?: boolean;
lastDivider?: string;
appendClassName?: string;
appendVariant?: "default" | "outline" | "ghost" | "secondary";
};
Expand Down
13 changes: 12 additions & 1 deletion react-app/src/components/RHF/FieldArray.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export const RHFFieldArray = <TFields extends FieldValues>(
{fieldArr.fields.map((FLD, index) => {
return (
<div
className={cn("flex flex-row gap-5", props.fieldArrayClassName)}
className={cn(
"flex flex-row gap-5 mb-4",
props.fieldArrayClassName,
)}
key={FLD.id}
>
{props.fields.map((SLOT, i) => {
Expand Down Expand Up @@ -70,6 +73,14 @@ export const RHFFieldArray = <TFields extends FieldValues>(
</div>
);
})}
{props.lastDivider && (
<div
className={cn(
"w-full border-slate-300 border-b-[1px] my-4",
props.lastDivider,
)}
/>
)}
<div className={cn("flex items-center mt-3", props.appendClassName)}>
<Button
type="button"
Expand Down
4 changes: 4 additions & 0 deletions react-app/src/components/RHF/RHFTextDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const RHFTextDisplay = (props: RHFTextDisplayProps) => {
return <b className={t.classname}>{t.text}</b>;
case "italic":
return <i className={t.classname}>{t.text}</i>;
case "numberedSet":
return (
<span className={t.classname}>{`${t.text} ${props.index + 1}`}</span>
);
case "link":
return (
<Link
Expand Down
Loading