From 02ce1213329d22c71712e15056eb4d79bdaf5fcb Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Mon, 2 Dec 2019 06:48:59 -0800 Subject: [PATCH] Refactor the MediaComponent and move the upload logic to SupportFormV2 comp Summary: This diff refactors the MediaComponent and moves it's upload logic to the support component. Also the state of the media component is stored in the redux store, so this solves the caching issue. Reviewed By: mweststrate Differential Revision: D18754736 fbshipit-source-id: b937f34180405025a6eb437bf2c2d589743e341b --- src/reducers/supportForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/reducers/supportForm.tsx b/src/reducers/supportForm.tsx index 9ef6eea17..5ac340c2a 100644 --- a/src/reducers/supportForm.tsx +++ b/src/reducers/supportForm.tsx @@ -8,7 +8,11 @@ */ import {Actions} from './'; -export type MediaType = Array<{uri: string; description: string}>; +type SubmediaType = + | {uploadID: number; status: 'Uploaded'} + | {status: 'NotUploaded' | 'Uploading'}; +type MediaObject = SubmediaType & {description: string; path: string}; +export type MediaType = Array; export type SupportFormV2State = { title: string; description: string;