aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Content.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@thetaggid.com>2021-01-13 02:59:52 -0500
committerGitHub <noreply@github.com>2021-01-13 02:59:52 -0500
commit06cea95ec9463f1c010187973f401a68cce7b68d (patch)
tree290bc590b6a002f83888bad3bbe9da2a48074e30 /src/components/profile/Content.tsx
parent353c1ec685698bb86e0ff96a346d88205ee389cf (diff)
[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 <shravs1208@gmail.com> Co-authored-by: Ashm Walia <ashmwalia@outlook.com> Co-authored-by: Ashm Walia <40498934+ashmgarv@users.noreply.github.com>
Diffstat (limited to 'src/components/profile/Content.tsx')
-rw-r--r--src/components/profile/Content.tsx11
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}
/>
),
)}