diff options
Diffstat (limited to 'src/components/profile/Content.tsx')
-rw-r--r-- | src/components/profile/Content.tsx | 11 |
1 files changed, 10 insertions, 1 deletions
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<ContentProps> = ({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<ContentProps> = ({y, userXId, screenType}) => { screenType={screenType} handleMomentCategoryDelete={handleCategoryDeletion} shouldAllowDeletion={momentCategories.length > 1} + showUpButton={index !== 0} + showDownButton={index !== momentCategories.length - 1} + move={move} /> ), )} |