This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add a material ui library and an index screen
- Loading branch information
1 parent
75864c9
commit 553c08b
Showing
8 changed files
with
154 additions
and
57 deletions.
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// TODO: reconfigure this once backend relations are known | ||
export default [ | ||
{ | ||
studyId: "50Kb9Jfa1ejkURIIE3T2", | ||
surveyId: "UaAyBbLNOobGO2prwpsT", | ||
studyName: "Thorncliffe Park", | ||
studyAuthor: "Park People", | ||
surveys: [ | ||
{ type: "activity", title: "Stationary Mapping" }, | ||
{ type: "lineOfSight", title: "Line of Sight (coming soon!)" }, | ||
{ type: "intercept", title: "Intercepts (coming soon!)" } | ||
] | ||
} | ||
]; |
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
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
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import React from "react"; | ||
import { ScrollView, StyleSheet, Text, View } from "react-native"; | ||
import { withNavigation } from "react-navigation"; | ||
|
||
import studies from "../config/studies"; | ||
import { | ||
Button, | ||
Caption, | ||
Card, | ||
CardContent, | ||
Divider, | ||
Title, | ||
Paragraph | ||
} from "react-native-paper"; | ||
|
||
class SurveyIndexScreen extends React.Component { | ||
static navigationOptions = { | ||
title: "Studies" | ||
}; | ||
|
||
render() { | ||
return ( | ||
<View style={[styles.container]}> | ||
<ScrollView stickyHeaderIndices={[0]}> | ||
<Caption style={styles.sectionTitle}>Your studies</Caption> | ||
{studies.map(study => ( | ||
<Card elevation={3}> | ||
<CardContent style={styles.studyHeader}> | ||
<Title>{study.studyName}</Title> | ||
<Paragraph>by {study.studyAuthor}</Paragraph> | ||
</CardContent> | ||
{study.surveys.map(survey => { | ||
return ( | ||
<View> | ||
<Divider /> | ||
<CardContent style={styles.surveyRow}> | ||
<Text style={styles.surveyTitle}>{survey.title}</Text> | ||
<Button | ||
dark | ||
raised | ||
primary | ||
onPress={() => | ||
this.props.navigation.navigate("SurveyScreen", { | ||
studyId: study.studyId, | ||
surveyId: study.surveyId, | ||
studyName: study.studyName, | ||
studyAuthor: study.studyAuthor, | ||
surveyType: survey.type, | ||
surveyTitle: survey.title | ||
}) | ||
} | ||
> | ||
Start | ||
</Button> | ||
</CardContent> | ||
</View> | ||
); | ||
})} | ||
</Card> | ||
))} | ||
</ScrollView> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
backgroundColor: "white", | ||
flex: 1, | ||
padding: 10 | ||
}, | ||
studyHeader: { | ||
paddingBottom: 10 | ||
}, | ||
sectionTitle: { | ||
backgroundColor: "white", | ||
fontWeight: "bold", | ||
marginBottom: 10 | ||
}, | ||
surveyRow: { | ||
paddingVertical: 10, | ||
flexDirection: "row", | ||
justifyContent: "space-between", | ||
alignItems: "center" | ||
}, | ||
surveyTitle: { | ||
fontWeight: "bold" | ||
} | ||
}); | ||
|
||
export default withNavigation(SurveyIndexScreen); |
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
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 |
---|---|---|
|
@@ -2282,6 +2282,13 @@ create-react-context@^0.2.1: | |
fbjs "^0.8.0" | ||
gud "^1.0.0" | ||
|
||
create-react-context@^0.2.2: | ||
version "0.2.3" | ||
resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.3.tgz#9ec140a6914a22ef04b8b09b7771de89567cb6f3" | ||
dependencies: | ||
fbjs "^0.8.0" | ||
gud "^1.0.0" | ||
|
||
cross-spawn@^5.0.1, cross-spawn@^5.1.0: | ||
version "5.1.0" | ||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" | ||
|
@@ -2368,6 +2375,10 @@ deepmerge@^1.3.0: | |
version "1.5.2" | ||
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-1.5.2.tgz#10499d868844cdad4fee0842df8c7f6f0c95a753" | ||
|
||
deepmerge@^2.1.0: | ||
version "2.1.1" | ||
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.1.1.tgz#e862b4e45ea0555072bf51e7fd0d9845170ae768" | ||
|
||
default-require-extensions@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" | ||
|
@@ -5549,6 +5560,16 @@ [email protected]: | |
babel-plugin-module-resolver "^2.3.0" | ||
babel-preset-react-native "1.9.0" | ||
|
||
react-native-paper@^1.12.0: | ||
version "1.12.0" | ||
resolved "https://registry.yarnpkg.com/react-native-paper/-/react-native-paper-1.12.0.tgz#1d891b2068cda4193b42fc527779aa379605ca11" | ||
dependencies: | ||
color "^2.0.1" | ||
create-react-context "^0.2.2" | ||
deepmerge "^2.1.0" | ||
hoist-non-react-statics "^2.5.0" | ||
react-lifecycles-compat "^3.0.4" | ||
|
||
react-native-platform-touchable@^1.1.1: | ||
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/react-native-platform-touchable/-/react-native-platform-touchable-1.1.1.tgz#fde4acc65eea585d28b164d0c3716a42129a68e4" | ||
|