diff --git a/packages/components/src/api/weights/UpdateWeight.ts b/packages/components/src/api/weights/UpdateWeight.ts index d73e3c3721..378f536c26 100644 --- a/packages/components/src/api/weights/UpdateWeight.ts +++ b/packages/components/src/api/weights/UpdateWeight.ts @@ -1,7 +1,7 @@ import MakeRequest from "../MakeRequest"; export interface UpdateWeightRequest { - cover_image_media_file_token: string; + cover_image_media_file_token?: string; description_markdown: string, description_rendered_html: string, title: string, diff --git a/packages/fakeyou.com/src/components/common/CoverImageInput/CoverImageInput.tsx b/packages/fakeyou.com/src/components/common/CoverImageInput/CoverImageInput.tsx new file mode 100644 index 0000000000..23d6bbfe62 --- /dev/null +++ b/packages/fakeyou.com/src/components/common/CoverImageInput/CoverImageInput.tsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; +import { a, useTransition } from "@react-spring/web"; +import { FetchStatus } from "@storyteller/components/src/api/_common/SharedFetchTypes"; +import { Button, ImageInput } from "components/common"; +import { WorkIndicator } from "components/svg"; +import { faImage } from "@fortawesome/pro-solid-svg-icons"; +import { basicTransition } from "resources"; + +interface Props { + currentPath?: string, + onClick: (x: any) => any, + status: FetchStatus +} + +interface UploadCtrlProps { + onClick: (x: any) => any, + status: FetchStatus +} + +const UploadControl = ({ onClick, status }: UploadCtrlProps) => { + const failure = status === FetchStatus.error; + const success = status === FetchStatus.success; + + return status === FetchStatus.ready ?