From 641b7fe7db4e57a1214d1174acb22d39d9e538e6 Mon Sep 17 00:00:00 2001 From: moxitech Date: Sun, 1 Sep 2024 19:43:58 +0700 Subject: [PATCH] group screen, server update && note img --- frontend/.gitignore | 6 + frontend/app/(tabs)/_layout.tsx | 11 +- frontend/app/(tabs)/explore.tsx | 70 +---- frontend/app/(tabs)/group.tsx | 107 -------- frontend/app/(tabs)/groups.tsx | 232 ++++++++++++++++ frontend/app/(tabs)/index.tsx | 127 +++++++-- frontend/assets/images/partial-react-logo.png | Bin 5075 -> 24845 bytes frontend/package-lock.json | 9 + frontend/package.json | 1 + server/App/go.mod | 3 + server/App/go.sum | 6 + server/App/internal/fiber/fiber.go | 251 ++++++++++++++---- server/App/internal/websocket/websocket.go | 2 + 13 files changed, 575 insertions(+), 250 deletions(-) create mode 100644 frontend/.gitignore delete mode 100644 frontend/app/(tabs)/group.tsx create mode 100644 frontend/app/(tabs)/groups.tsx diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..5873d9a --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,6 @@ + +# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb +# The following patterns were generated by expo-cli + +expo-env.d.ts +# @end expo-cli \ No newline at end of file diff --git a/frontend/app/(tabs)/_layout.tsx b/frontend/app/(tabs)/_layout.tsx index 79cd584..57aee00 100644 --- a/frontend/app/(tabs)/_layout.tsx +++ b/frontend/app/(tabs)/_layout.tsx @@ -17,12 +17,21 @@ export default function TabLayout() { ( ), }} /> + ( + + ), + }} + /> Settings - This code can be help you. - - - This app has two screens:{' '} - app/(tabs)/index.tsx and{' '} - app/(tabs)/explore.tsx - - - The layout file in app/(tabs)/_layout.tsx{' '} - sets up the tab navigator. - - - Learn more - - - - - You can open this project on Android, iOS, and the web. To open the web version, press{' '} - w in the terminal running this project. - - - - - For static images, you can use the @2x and{' '} - @3x suffixes to provide files for - different screen densities - - - - Learn more - - - - - Open app/_layout.tsx to see how to load{' '} - - custom fonts such as this one. - - - - Learn more - - - - - This template has light and dark mode support. The{' '} - useColorScheme() hook lets you inspect - what the user's current color scheme is, and so you can adjust UI colors accordingly. - - - Learn more - - - - - This template includes an example of an animated component. The{' '} - components/HelloWave.tsx component uses - the powerful react-native-reanimated library - to create a waving hand animation. - - {Platform.select({ - ios: ( - - The components/ParallaxScrollView.tsx{' '} - component provides a parallax effect for the header image. - - ), - })} - + ); } diff --git a/frontend/app/(tabs)/group.tsx b/frontend/app/(tabs)/group.tsx deleted file mode 100644 index 3773e80..0000000 --- a/frontend/app/(tabs)/group.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import { Image, StyleSheet, Platform, Button, ActivityIndicator } from 'react-native'; - -import ParallaxScrollView from '@/components/ParallaxScrollView'; -import { ThemedText } from '@/components/ThemedText'; -import { ThemedView } from '@/components/ThemedView'; -import { useEffect, useState } from 'react'; - -interface Message { - title: string; - type: string; - additionally: { - payload: string; - }; -} - -interface Data { - users: string[]; - messages: Message[]; -} - -export default function GroupScreen() { - const [groupData, setGroupData] = useState(null); - - useEffect(() => { - fetch("http://127.0.0.1:8099/grouphash:1/reloadDataFromServer") - .then(v => v.json()) - .then((data: Data) => { - setGroupData(data); - }) - .catch(e => { - console.log(e); - }); - }, []); - - return ( - - }> - - - Пользователи - {groupData?.users.map((user, index) => ( - {user} - ))} - - - - { groupData === null ? - : - groupData?.messages.map((message, index) => ( - - {message.title} - { message.type === "text" ? - {message.additionally.payload} : - !!! Please Update Program !!! - } - - - )) - } - - -