diff --git a/src/reducers/supportForm.tsx b/src/reducers/supportForm.tsx index abf2ab14e..37a8fb459 100644 --- a/src/reducers/supportForm.tsx +++ b/src/reducers/supportForm.tsx @@ -8,13 +8,26 @@ */ import {Actions} from './'; +export type SupportFormV2State = { + title: string; + description: string; + commitHash: string; + appName: string; +}; + export type State = { webState: NTUsersFormData | null; + supportFormV2: SupportFormV2State; }; -export type Action = { - type: 'SET_SUPPORT_FORM_STATE'; - payload: NTUsersFormData | null; -}; +export type Action = + | { + type: 'SET_SUPPORT_FORM_STATE'; + payload: NTUsersFormData | null; + } + | { + type: 'SET_SUPPORT_FORM_V2_STATE'; + payload: SupportFormV2State; + }; export type NTUsersFormData = { flipper_trace: string | null; @@ -22,6 +35,21 @@ export type NTUsersFormData = { export const initialState: () => State = () => ({ webState: null, + supportFormV2: { + title: '', + description: [ + '## Context', + 'What are you trying to accomplish at a high level? Feel free to include mocks and tasks.', + '', + '## Problem', + "What's blocking you?", + '', + "## Workarounds I've Tried", + '', + ].join('\n'), + commitHash: '', + appName: '', + }, }); export default function reducer( state: State | undefined, @@ -33,6 +61,11 @@ export default function reducer( ...state, webState: action.payload, }; + } else if (action.type === 'SET_SUPPORT_FORM_V2_STATE') { + return { + ...state, + supportFormV2: action.payload, + }; } else { return state; } @@ -44,3 +77,8 @@ export const setSupportFormState = ( type: 'SET_SUPPORT_FORM_STATE', payload, }); + +export const setSupportFormV2State = (payload: SupportFormV2State): Action => ({ + type: 'SET_SUPPORT_FORM_V2_STATE', + payload, +});