Skip to content

Commit ea7b7d5

Browse files
committed
PROD-2675 #comment Fix issues with the buttons on the bottom of the form in mobile
1 parent d18c47d commit ea7b7d5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src-ts/lib/form/form-button.model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { ButtonSize, ButtonStyle, ButtonType } from '../button'
55
export interface FormButton {
66
readonly buttonStyle?: ButtonStyle
77
hidden?: boolean,
8-
readonly icon?: FC<SVGProps<SVGSVGElement>>
8+
icon?: FC<SVGProps<SVGSVGElement>>
99
readonly isReset?: boolean
1010
readonly isSubmit?: boolean
11-
readonly label?: string
11+
label?: string
1212
readonly notTabble?: boolean
1313
onClick?: (event?: any) => void
1414
readonly route?: string

src-ts/tools/work/work-self-service/intake-forms/bug-hunt/BugHuntIntakeForm.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import IntakeFormsBreadcrumb from '../intake-forms-breadcrumb/IntakeFormsBreadcr
3535
import { BugHuntFormConfig } from './bug-hunt.form.config'
3636
import styles from './BugHunt.module.scss'
3737
import { DeliverablesInfoCard } from './deliverables-info-card'
38+
import { ReactComponent as SaveForLaterIcon } from "../../../../../../src/assets/images/save-for-later-icon.svg";
3839

3940
const BugHuntIntakeForm: React.FC = () => {
4041

@@ -55,6 +56,16 @@ const BugHuntIntakeForm: React.FC = () => {
5556
BugHuntFormConfig.buttons.secondaryGroup[0].onClick = () => { navigate(selfServiceStartRoute) }
5657
}
5758

59+
if (isMobile) {
60+
BugHuntFormConfig.buttons.primaryGroup[0].icon = SaveForLaterIcon;
61+
BugHuntFormConfig.buttons.primaryGroup[0].label = '';
62+
BugHuntFormConfig.buttons.primaryGroup[1].label = 'Submit';
63+
} else {
64+
BugHuntFormConfig.buttons.primaryGroup[0].icon = undefined;
65+
BugHuntFormConfig.buttons.primaryGroup[0].label = 'Save for later';
66+
BugHuntFormConfig.buttons.primaryGroup[1].label = 'Complete and pay';
67+
}
68+
5869
const [challenge, setChallenge]: [Challenge | undefined, Dispatch<SetStateAction<Challenge | undefined>>] = useState()
5970
const [formDef]: [FormDefinition, Dispatch<SetStateAction<FormDefinition>>]
6071
= useState<FormDefinition>({ ...BugHuntFormConfig })

0 commit comments

Comments
 (0)