From 06cea95ec9463f1c010187973f401a68cce7b68d Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Wed, 13 Jan 2021 02:59:52 -0500 Subject: [TMA-556] Temporary Fix for Re-ordering Categories (#178) * done * moved icon placement and added correct asset * new icons * moved things around resolved a bug * Deleting existing predefined moment categories * Revert "Deleting existing predefined moment categories" This reverts commit f5f4464b5392902208ec548de1c189f4639261a5. * Hit backend Co-authored-by: Shravya Ramesh Co-authored-by: Ashm Walia Co-authored-by: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> --- src/components/profile/Content.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/components/profile') diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx index 227e6783..61a08d49 100644 --- a/src/components/profile/Content.tsx +++ b/src/components/profile/Content.tsx @@ -19,7 +19,7 @@ import { UserType, } from '../../types'; import {COVER_HEIGHT, TAGG_TEXT_LIGHT_BLUE} from '../../constants'; -import {fetchUserX, SCREEN_HEIGHT, userLogin} from '../../utils'; +import {fetchUserX, moveCategory, SCREEN_HEIGHT, userLogin} from '../../utils'; import TaggsBar from '../taggs/TaggsBar'; import {Moment} from '../moments'; import ProfileBody from './ProfileBody'; @@ -142,6 +142,12 @@ const Content: React.FC = ({y, userXId, screenType}) => { createImagesMap(); }, [createImagesMap]); + const move = (direction: 'up' | 'down', title: string) => { + let categories = [...momentCategories]; + categories = moveCategory(categories, title, direction === 'up'); + dispatch(updateMomentCategories(categories)); + }; + /** * Prompt user to perform an activity based on their profile completion stage * To fire 2 seconds after the screen comes in focus @@ -379,6 +385,9 @@ const Content: React.FC = ({y, userXId, screenType}) => { screenType={screenType} handleMomentCategoryDelete={handleCategoryDeletion} shouldAllowDeletion={momentCategories.length > 1} + showUpButton={index !== 0} + showDownButton={index !== momentCategories.length - 1} + move={move} /> ), )} -- cgit v1.2.3-70-g09d2