Skip to content

Commit a1f8307

Browse files
authored
Merge pull request #532 from arun-s-aot/bugfix/FWF-4464-client-issues
FWF-4464 [Bugfix] Stlye corrections for client screen and added table button variations
2 parents dbf0781 + dab98ce commit a1f8307

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

forms-flow-components/src/components/CustomComponents/Button.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface DropdownItem {
1414

1515
interface CustomButtonProps {
1616
variant: string;
17-
size?: "sm" | "md" | "lg" ;
17+
size?: "sm" | "md" | "lg" | "table" | "table-sm";
1818
label: string;
1919
name?: string,
2020
onClick?: () => void;
@@ -29,8 +29,15 @@ interface CustomButtonProps {
2929
iconOnly?: boolean;
3030
}
3131

32-
const getButtonClassName = (size: string | undefined, className: string, iconOnly: boolean = false) =>
33-
`${size === "md" ? 'btn-md' : ''} ${className}`;
32+
const getButtonClassName = (size: string | undefined, className: string, iconOnly: boolean = false) => {
33+
const sizeClassMap: Record<string, string> = {
34+
md: "btn-md",
35+
table: "btn-table",
36+
"table-sm": "btn-table-sm"
37+
};
38+
39+
return `${size ? sizeClassMap[size] || '' : ''} ${className}`.trim();
40+
};
3441

3542
export const CustomButton: React.FC<CustomButtonProps> = ({
3643
variant,
@@ -49,7 +56,7 @@ export const CustomButton: React.FC<CustomButtonProps> = ({
4956
iconOnly = false,
5057
}) => {
5158
const classNameForButton = getButtonClassName(size, className, iconOnly);
52-
const sizeOfButton = size !== "md" ? size : undefined;
59+
const sizeOfButton = size !== "md" && size !== "table" && size !== "table-sm" ? size : undefined;
5360

5461
const buttonRef = useRef<HTMLButtonElement>(null);
5562
const toggleRef = useRef<HTMLButtonElement>(null);
@@ -88,7 +95,7 @@ export const CustomButton: React.FC<CustomButtonProps> = ({
8895
>
8996
<Button
9097
variant={variant}
91-
size={size !== "md" ? size : undefined}
98+
size={sizeOfButton}
9299
disabled={disabled}
93100
ref={buttonRef}
94101
data-testid={dataTestId}

forms-flow-theme/scss/_button.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,20 @@ $danger-color: var(--ff-danger);
237237
}
238238
}
239239

240-
&.btn-table {
240+
&.btn-table { // This is for the Btn-Action-Table in figma
241241
padding: var(--spacer-050) var(--spacer-100) !important;
242242
border-radius: var(--radius-sm) !important;
243243
line-height: var(--text-line-height);
244244
}
245245

246+
247+
&.btn-table-sm { // This is for the Btn-Action-Table-Small in figma
248+
font-size: var(--font-size-xs) !important;
249+
padding: var(--spacer-025) var(--spacer-075) !important;
250+
border-radius: var(--radius-sm) !important;
251+
line-height: var(--text-line-height);
252+
}
253+
246254
&.btn-sm {
247255
font-size: var(--font-size-xs) !important;
248256
padding: var(--spacer-075) var(--spacer-100) !important;

forms-flow-theme/scss/_forms.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,14 +628,13 @@ select option:hover {
628628
}
629629
}
630630
.user-form-container{
631-
max-height:94vh ;
632-
min-height: calc(100vh - 5.5625rem);
631+
height: calc(100vh - 7.5625rem - var(--client-nav));
633632
overflow-y: auto;
634633
overflow-x: hidden;
635634
gap: var(--spacer-100);
636635
padding: var(--spacer-200) var(--spacer-225);
637636
background-color: $white;
638-
border-radius: var(--radius-md) !important;
637+
border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
639638
}
640639
}
641640

forms-flow-theme/scss/_theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ $theme-colors: map-merge($theme-colors, $custom-colors);
9595
--default-font-family: "Roboto", sans-serif;
9696
--primary-font: var(--default-font-family);
9797
//font-size
98-
--font-size-xs: 0.875rem;
99-
--font-size-sm: var(--default-font-size);
98+
--font-size-xs: 0.875rem; // 14px
99+
--font-size-sm: var(--default-font-size);
100100
--font-size-md: 1.25rem;
101101
--font-size-lg: 1.5rem;
102102
--font-size-xl: 2rem;

0 commit comments

Comments
 (0)