diff --git a/web/avatars/emoji-avatar-selection-modal.react.js b/web/avatars/emoji-avatar-selection-modal.react.js --- a/web/avatars/emoji-avatar-selection-modal.react.js +++ b/web/avatars/emoji-avatar-selection-modal.react.js @@ -14,13 +14,24 @@ import Avatar from './avatar.react.js'; import css from './emoji-avatar-selection-modal.css'; import Button, { buttonThemes } from '../components/button.react.js'; -import Tabs from '../components/tabs-legacy.react.js'; +import Tabs, { type TabData } from '../components/tabs.react.js'; import LoadingIndicator from '../loading-indicator.react.js'; import Modal from '../modals/modal.react.js'; import ColorSelector from '../modals/threads/color-selector.react.js'; type TabType = 'emoji' | 'color'; +const tabsData: $ReadOnlyArray> = [ + { + id: 'emoji', + header: 'Emoji', + }, + { + id: 'color', + header: 'Color', + }, +]; + type Props = { +currentAvatar: ClientAvatar, +defaultAvatar: ClientEmojiAvatar, @@ -103,6 +114,43 @@ const [currentTabType, setCurrentTabType] = React.useState('emoji'); + const tabs = React.useMemo( + () => ( + + ), + [currentTabType], + ); + + const tabContent = React.useMemo(() => { + if (currentTabType === 'emoji') { + return ( +
+
+ +
+
+ ); + } + return ( +
+ +
+ ); + }, [currentTabType, onEmojiSelect, onColorSelection, pendingAvatarColor]); + return (
@@ -113,29 +161,8 @@ showSpinner={avatarSaveInProgress} />
- - -
-
- -
-
-
- -
- -
-
-
+ {tabs} + {tabContent}