diff --git a/client/components/file_management/FileTile.tsx b/client/components/file_management/FileTile.tsx index d454cf7..b0bb789 100644 --- a/client/components/file_management/FileTile.tsx +++ b/client/components/file_management/FileTile.tsx @@ -1,8 +1,11 @@ import React from 'react'; import { Text, View } from 'react-native'; +import { useNavigation } from '@react-navigation/native'; import { WebView } from 'react-native-webview'; +import { AppStackNavigation } from '../../navigation/types'; + interface FileTileProps { name: string; label: string; @@ -10,8 +13,12 @@ interface FileTileProps { } export function FileTile({ name, label, url }: FileTileProps): JSX.Element { + const navigation = useNavigation(); return ( - + navigation.navigate('SingleFile', { url, name, label })} + > - + View Files - - navigation.navigate('FileUploadScreen')} - > - + - + navigation.navigate('FileUploadScreen')} + > + + diff --git a/client/navigation/containers/ProfileNavigationContainer.tsx b/client/navigation/containers/ProfileNavigationContainer.tsx index 5b09630..25f0cb9 100644 --- a/client/navigation/containers/ProfileNavigationContainer.tsx +++ b/client/navigation/containers/ProfileNavigationContainer.tsx @@ -6,6 +6,7 @@ import FileViewScreen from '../../screens/FileViewScreen'; import PatientView from '../../screens/Profile/PatientView'; import Profile from '../../screens/Profile/Profile'; import Settings from '../../screens/Profile/Settings'; +import SingleFile from '../../screens/SingleFile'; import SingleTaskScreen from '../../screens/SingleTask'; import TaskList from '../../screens/TaskList'; import { AppStack } from '../types'; @@ -26,6 +27,7 @@ export function ProfileNavigationContainer() { + ); } diff --git a/client/navigation/types.ts b/client/navigation/types.ts index 15ee074..e21fc17 100644 --- a/client/navigation/types.ts +++ b/client/navigation/types.ts @@ -13,6 +13,7 @@ export type AppStackParamList = { FileUploadScreen: undefined; FileViewScreen: undefined; Landing: undefined; + SingleFile: { url: string; name: string; label: string }; Calendar: undefined; Notifications: undefined; TaskType: undefined; diff --git a/client/screens/SingleFile.tsx b/client/screens/SingleFile.tsx new file mode 100644 index 0000000..7ed9cde --- /dev/null +++ b/client/screens/SingleFile.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +import { SafeAreaView, Text, View } from 'react-native'; + +import { RouteProp } from '@react-navigation/native'; +import WebView from 'react-native-webview'; + +import { BackButton } from '../components/nav_buttons/BackButton'; +import { AppStackParamList } from '../navigation/types'; + +type SingleFileProps = RouteProp; + +export default function SingleFile({ route }: { route: SingleFileProps }) { + const { url } = route.params; + + return ( + + + + + View Files + + + + + + + ); +}