notification update

This commit is contained in:
Milan Paunovic
2024-11-19 11:54:16 +01:00
parent 8763be4613
commit 47f035708c
3 changed files with 38 additions and 35 deletions

View File

@ -1,4 +1,4 @@
import {FlatList, ScrollView, StyleSheet} from "react-native"; import {FlatList, StyleSheet} from "react-native";
import React from "react"; import React from "react";
import {Card, Text, View} from "react-native-ui-lib"; import {Card, Text, View} from "react-native-ui-lib";
import HeaderTemplate from "@/components/shared/HeaderTemplate"; import HeaderTemplate from "@/components/shared/HeaderTemplate";
@ -8,40 +8,37 @@ import {formatDistanceToNow} from "date-fns";
const NotificationsPage = () => { const NotificationsPage = () => {
const {data: notifications} = useGetNotifications() const {data: notifications} = useGetNotifications()
console.log(notifications?.[0]?.timestamp) console.log(notifications?.[0])
return ( return (
<View flexG height={"100%"}> <View flexG height={"100%"}>
<View flexG> <View flexG>
<ScrollView <View marginH-25>
showsVerticalScrollIndicator={false} <HeaderTemplate
showsHorizontalScrollIndicator={false} message={"Welcome to your notifications!"}
> isWelcome={false}
<View marginH-25> children={
<HeaderTemplate <Text
message={"Welcome to your notifications!"} style={{fontFamily: "Manrope_400Regular", fontSize: 14}}
isWelcome={false} >
children={ See your notifications here.
<Text </Text>
style={{fontFamily: "Manrope_400Regular", fontSize: 14}} }
> />
See your notifications here. </View>
</Text>
} <FlatList contentContainerStyle={{paddingBottom: 10, paddingHorizontal: 25}}
/> data={notifications ?? []}
<View> renderItem={({item}) => <Card padding-20 gap-10 marginB-10>
<FlatList data={notifications ?? []} renderItem={({item}) => <Card padding-20 gap-10> <Text text70>{item.content}</Text>
<Text text70>{item.content}</Text> <View row spread>
<View row spread> <Text
<Text text90>{formatDistanceToNow(new Date(item.timestamp), { addSuffix: true })}</Text> text90>{formatDistanceToNow(new Date(item.timestamp), {addSuffix: true})}</Text>
<Text text90>{item.timestamp.toLocaleDateString()}</Text> <Text text90>{item.timestamp.toLocaleDateString()}</Text>
</View> </View>
</Card>}/> </Card>}/>
</View> </View>
</View>
</ScrollView>
</View>
</View> </View>
); );
}; };

View File

@ -2468,6 +2468,8 @@ PODS:
- ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core - ReactCommon/turbomodule/core
- Yoga - Yoga
- react-native-menu (1.1.6):
- React
- react-native-safe-area-context (4.10.5): - react-native-safe-area-context (4.10.5):
- React-Core - React-Core
- React-nativeconfig (0.74.5) - React-nativeconfig (0.74.5)
@ -2879,6 +2881,7 @@ DEPENDENCIES:
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`) - React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
- react-native-app-auth (from `../node_modules/react-native-app-auth`) - react-native-app-auth (from `../node_modules/react-native-app-auth`)
- "react-native-blur (from `../node_modules/@react-native-community/blur`)" - "react-native-blur (from `../node_modules/@react-native-community/blur`)"
- "react-native-menu (from `../node_modules/@react-native-menu/menu`)"
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- React-nativeconfig (from `../node_modules/react-native/ReactCommon`) - React-nativeconfig (from `../node_modules/react-native/ReactCommon`)
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`) - React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
@ -3090,6 +3093,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-app-auth" :path: "../node_modules/react-native-app-auth"
react-native-blur: react-native-blur:
:path: "../node_modules/@react-native-community/blur" :path: "../node_modules/@react-native-community/blur"
react-native-menu:
:path: "../node_modules/@react-native-menu/menu"
react-native-safe-area-context: react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context" :path: "../node_modules/react-native-safe-area-context"
React-nativeconfig: React-nativeconfig:
@ -3269,6 +3274,7 @@ SPEC CHECKSUMS:
React-Mapbuffer: dce508662b995ffefd29e278a16b78217039d43d React-Mapbuffer: dce508662b995ffefd29e278a16b78217039d43d
react-native-app-auth: c4a3b4edc11100070d8d7bc48d55fb66668cead9 react-native-app-auth: c4a3b4edc11100070d8d7bc48d55fb66668cead9
react-native-blur: 68eda7d27e86b53ec96445fc59fe9e84f0921fea react-native-blur: 68eda7d27e86b53ec96445fc59fe9e84f0921fea
react-native-menu: b7e42b26d3014c993db0f0ae3d5fcc523d5585bd
react-native-safe-area-context: a240ad4b683349e48b1d51fed1611138d1bdad97 react-native-safe-area-context: a240ad4b683349e48b1d51fed1611138d1bdad97
React-nativeconfig: f326487bc61eba3f0e328da6efb2711533dcac46 React-nativeconfig: f326487bc61eba3f0e328da6efb2711533dcac46
React-NativeModulesApple: d89733f5baed8b9249ca5a8e497d63c550097312 React-NativeModulesApple: d89733f5baed8b9249ca5a8e497d63c550097312
@ -3314,4 +3320,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: ae388457578eb44dbbdba1451a584b59f3bc21dd PODFILE CHECKSUM: ae388457578eb44dbbdba1451a584b59f3bc21dd
COCOAPODS: 1.15.2 COCOAPODS: 1.16.2

View File

@ -450,11 +450,11 @@
); );
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
PRODUCT_BUNDLE_IDENTIFIER = com.cally.app; PRODUCT_BUNDLE_IDENTIFIER = com.cally.app;
PRODUCT_NAME = "Cally"; PRODUCT_NAME = Cally;
SWIFT_OBJC_BRIDGING_HEADER = "cally/cally-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "cally/cally-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1"; TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Debug; name = Debug;
@ -484,10 +484,10 @@
); );
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = com.cally.app; PRODUCT_BUNDLE_IDENTIFIER = com.cally.app;
PRODUCT_NAME = "Cally"; PRODUCT_NAME = Cally;
SWIFT_OBJC_BRIDGING_HEADER = "cally/cally-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "cally/cally-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1"; TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Release; name = Release;