diff --git a/web/avatars/edit-thread-avatar.css b/web/avatars/edit-thread-avatar.css new file mode 100644 --- /dev/null +++ b/web/avatars/edit-thread-avatar.css @@ -0,0 +1,8 @@ +.editThreadAvatarContainer { + position: relative; + height: 112px; + width: 112px; + display: flex; + justify-content: center; + align-items: center; +} diff --git a/web/avatars/edit-thread-avatar.react.js b/web/avatars/edit-thread-avatar.react.js new file mode 100644 --- /dev/null +++ b/web/avatars/edit-thread-avatar.react.js @@ -0,0 +1,35 @@ +// @flow + +import invariant from 'invariant'; +import * as React from 'react'; + +import { EditThreadAvatarContext } from 'lib/components/base-edit-thread-avatar-provider.react.js'; +import type { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js'; + +import css from './edit-thread-avatar.css'; +import ThreadAvatar from './thread-avatar.react.js'; + +type Props = { + +threadInfo: RawThreadInfo | ThreadInfo, + +disabled?: boolean, +}; +function EditThreadAvatar(props: Props): React.Node { + const editThreadAvatarContext = React.useContext(EditThreadAvatarContext); + invariant(editThreadAvatarContext, 'editThreadAvatarContext should be set'); + + const { threadAvatarSaveInProgress } = editThreadAvatarContext; + + const { threadInfo } = props; + + return ( +