-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic medical emergency page #16
Merged
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9a40335
Working copy of feature that adjusts title when ID is changed in Home…
r800360 a62facb
Implemented the rest of the dynamic emergency page layout
eshaan-s18 d4ef936
Implemented recursive dynamic header rendering as discussed in 2-15 m…
r800360 a714136
Resolved package.json merge conflict
r800360 f9d24a2
Fixed frontend linter issues
r800360 31ae9eb
Removed extra file and comments
eshaan-s18 72d7bc7
Changed from passing in emergency id to passing in emergency directly…
r800360 a916d83
Package and package-lock fixes
r800360 95f995c
Fixed frontend linter issues
r800360 7eedb71
Replace App.tsx with main branch copy
r800360 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,51 @@ | ||
import { StatusBar } from "expo-status-bar"; | ||
import { StyleSheet, Text, View } from "react-native"; | ||
import { NavigationContainer } from "@react-navigation/native"; | ||
import { createNativeStackNavigator } from "@react-navigation/native-stack"; | ||
// import { StatusBar } from "expo-status-bar"; | ||
// import { StyleSheet, Text, View } from "react-native"; | ||
// import { StyleSheet } from "react-native"; | ||
// import { NativeRouter, Routes, Route } from "react-router-native"; | ||
|
||
export default function App() { | ||
import ConditionsSection from "./ConditionsSection"; | ||
import HomeScreen from "./HomeScreen"; | ||
|
||
// In your App.tsx or where your navigation setup resides | ||
|
||
const Stack = createNativeStackNavigator(); | ||
|
||
function App() { | ||
return ( | ||
// eslint-disable-next-line @typescript-eslint/no-use-before-define | ||
<View style={styles.container}> | ||
<Text>Open up App.js to start working on your app!</Text> | ||
<StatusBar style="auto" /> | ||
</View> | ||
<NavigationContainer> | ||
<Stack.Navigator> | ||
<Stack.Screen name="Home" component={HomeScreen} /> | ||
<Stack.Screen name="Conditions" component={ConditionsSection} /> | ||
</Stack.Navigator> | ||
</NavigationContainer> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: "#fff", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
}, | ||
}); | ||
export default App; | ||
|
||
// export default function App() { | ||
// return ( | ||
// // eslint-disable-next-line @typescript-eslint/no-use-before-define | ||
// <View style={styles.container}> | ||
// {/* <Text>Open up App.js to start working on your app!</Text> */} | ||
// {/* <ConditionsSection /> */} | ||
// <NativeRouter> | ||
// <Routes> | ||
// <Route exact path="/" element={<ConditionsSection />} /> | ||
// <Route path="/emergencies/:emergencyObjectId" element={<ConditionsSection />} /> | ||
// </Routes> | ||
// </NativeRouter> | ||
// <StatusBar style="auto" /> | ||
// </View> | ||
// ); | ||
// } | ||
// const styles = StyleSheet.create({ | ||
// container: { | ||
// flex: 1, | ||
// backgroundColor: "#fff", | ||
// alignItems: "center", | ||
// justifyContent: "center", | ||
// }, | ||
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall, make sure to get rid of any commented code. Also, note that the Condiitons Section will be showing data that is fetched from the device's storage, not from the MongoDB database. So for the scope of this pull request, just don't worry about fetching the data, and just make the data be passed in as a prop to the component. In the future, we will have a dedicated file that fetches the correct data for a specific emergency/condition, and passes it into the Conditions Section component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, the progress you have made on emergencies.ts and the fetching will be useful later, especially for admin mode stuff, so great work and feel free to keep this! Just make sure the ConditionsSection.tsx only focuses on showing data that is passed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes as discussed here have been addressed with the commits below by having ConditionsSection take in an Emergency as input as opposed to an id. Tests have been reconfigured accordingly.