diff options
Diffstat (limited to 'src/screens')
| -rw-r--r-- | src/screens/profile/IndividualMoment.tsx | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx index 515cbacf..f7eb9c96 100644 --- a/src/screens/profile/IndividualMoment.tsx +++ b/src/screens/profile/IndividualMoment.tsx @@ -1,9 +1,12 @@ +import AsyncStorage from '@react-native-community/async-storage'; import {BlurView} from '@react-native-community/blur'; import {RouteProp} from '@react-navigation/native'; import {StackNavigationProp} from '@react-navigation/stack'; import React from 'react'; -import {FlatList, StyleSheet, View} from 'react-native'; +import {Alert, FlatList, StyleSheet, View} from 'react-native'; import {useSelector} from 'react-redux'; +import {MOMENT_TAGS_ENDPOINT} from 'src/constants/api'; +import {ERROR_SOMETHING_WENT_WRONG_REFRESH} from 'src/constants/strings'; import { IndividualMomentTitleBar, MomentPostContent, @@ -54,6 +57,24 @@ const IndividualMoment: React.FC<IndividualMomentProps> = ({ ); const initialIndex = momentData.findIndex((m) => m.moment_id === moment_id); + const loadMomentTags = async () => { + try { + const token = await AsyncStorage.getItem('token'); + const response = await fetch(MOMENT_TAGS_ENDPOINT + `/${moment_id}/`, { + method: 'GET', + headers: { + Authorization: 'Token ' + token, + }, + }); + const status = response.status; + if (status === 201) { + //create TaggDraggables with + } + } catch (error) { + Alert.alert(ERROR_SOMETHING_WENT_WRONG_REFRESH); + } + }; + const renderMomentPost = ({item}: {item: MomentType}) => ( <View style={styles.postContainer}> <MomentPostHeader |
