Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ad80d34
basic home page
Nov 6, 2020
551761a
added welcome message
Nov 30, 2020
b8aaec1
updated app.js
Dec 15, 2020
f60d0e9
updated package.json
Dec 15, 2020
fb16f9d
add react-scripts
Dec 27, 2020
d00d738
fixed renderText issue
Dec 28, 2020
292c13c
fixed dependencies problem
Dec 29, 2020
8fd4911
fixed dependencies problem
Dec 29, 2020
ee18dae
update Makefile for windows compatability and small change in title
bryan22lee Dec 30, 2020
c5d5736
style formatting and add images
bryan22lee Dec 30, 2020
1a886a6
basic three-page layout for now
bryan22lee Jan 6, 2021
c7aa951
reconfigure to work with snack.expo.io environment
bryan22lee Jan 24, 2021
0651a06
update README with development instructions
bryan22lee Jan 24, 2021
5ee7d3b
Update README.md
bryan22lee Jan 24, 2021
1ac0d81
Added local storage for progress through video and icons for custom e…
amrivkin-0 Feb 3, 2021
87f06d7
Added components and custom end screen
amrivkin-0 Feb 6, 2021
6379c85
Pushing change to new icons and little edits
amrivkin-0 Feb 7, 2021
f68f52f
allowed for horizontal and vertial ScrollView. Videos are now arrange…
bryan22lee Feb 7, 2021
addbcb8
Now pulls videos from real youtube playlist
amrivkin-0 Feb 7, 2021
a17aa71
Merge branch 'base-page' of github.com:uchicagotechteam/Cook-County-M…
amrivkin-0 Feb 7, 2021
2431af8
Merging with horizontal scroll changes
amrivkin-0 Feb 7, 2021
fe2c633
Fixed formatting bugs from merge and added progress bar
amrivkin-0 Feb 7, 2021
6469b26
Added real channels and search function
amrivkin-0 Feb 10, 2021
82ed74c
Apparently git doesn't notice if just the case of a folder name is ch…
amrivkin-0 Feb 10, 2021
db81580
And now components has a lowercase c
amrivkin-0 Feb 10, 2021
b8d43cc
Added channel collection component and comments
amrivkin-0 Feb 12, 2021
c5bf4ee
Added search area with dates
amrivkin-0 Feb 14, 2021
6d4baec
Added sort filter and possible alternate color scheme
amrivkin-0 Feb 17, 2021
851b080
Fixed small warnings
amrivkin-0 Feb 21, 2021
23c06ac
change in channel titles and music channel logo
helenathomas99 Feb 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .expo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
> Why do I have a folder named ".expo" in my project?
The ".expo" folder is created when an Expo project is started using "expo start" command.

> What does the "packager-info.json" file contain?
The "packager-info.json" file contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.

> What does the "settings.json" file contain?
The "settings.json" file contains the server configuration that is used to serve the application manifest.

> Should I commit the ".expo" folder?
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.

Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
10 changes: 10 additions & 0 deletions .expo/packager-info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"devToolsPort": 19002,
"expoServerPort": 19000,
"packagerPort": 19000,
"expoServerNgrokUrl": null,
"packagerNgrokUrl": null,
"ngrokPid": null,
"packagerPid": null,
"webpackServerPort": null
}
10 changes: 10 additions & 0 deletions .expo/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"hostType": "lan",
"lanType": "ip",
"dev": true,
"minify": false,
"urlRandomness": null,
"https": false,
"scheme": null,
"devClient": false
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
.idea/*
25 changes: 25 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import HomeScreen from "./screens/HomeScreen.js";
import ChildScreen from "./screens/ChildScreen.js";
import AdultScreen from "./screens/AdultScreen.js";
import { theme, styles } from './scripts/constants.js'

const Stack = createStackNavigator();

function App() {
return (
<NavigationContainer theme={theme}>
<Stack.Navigator>
<Stack.Screen name="Home" component={HomeScreen}
options={{ title:'Project Rainbow', headerStyle: styles.searchColor}}
/>
<Stack.Screen name="Child Page" component={ChildScreen} options={{headerStyle: styles.searchColor}} />
<Stack.Screen name="Adult Page" component={AdultScreen} options={{headerStyle: styles.searchColor}}/>
</Stack.Navigator>
</NavigationContainer>
);
}

export default App;
18 changes: 0 additions & 18 deletions Dockerfile

This file was deleted.

24 changes: 0 additions & 24 deletions Makefile

This file was deleted.

76 changes: 69 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,78 @@
# Cook County Mobile App - Project Rainbow

A mobile app allowing parents and children affeced by COVID-19 to access educational videos and materials created by the Cook County Board.
A mobile app allowing parents and children affected by COVID-19 to access educational videos and materials created by the Cook County Board.

We are using expo at snack.expo.io for development and to emulate on Android.

## Prerequisites
## Youtube API

Built from [TechTeam React Native Docker template project](https://github.com/uchicagotechteam/Docker-React).
### Status
1. When user opens the app, a hardcoded youtube video appears along with a play/pause button.
1. When the screen loads, we make an http request to Youtube Data API that dumps the response onto the page

For prerequisites, see the [wiki page](https://github.com/uchicagotechteam/Cook-County-Mobile-App/wiki/Prerequisites).
Note that the Youtube Data API call won't work if you run it before inserting a real API key on line 33 of `App.js`

Reach out to Dallon on slack/email ([email protected])/FB for any questions or to get the api key

## Building and Running
Run `make start` to build and run the Docker container.
### Next steps
`TODOs` with more details are in `App.js` file

The project will run locally in `http://localhost:3000` and will compile automatically upon changes to the src code.
High Priority:
1. Modify query string of http request to Youtube Data API to pull down list of playlists for that channel as well as videoIds for videos in each playlist
1. Modify styling to match wireframe that Abbey posted in `youtube-api` slack channel
1. Extract spaghetti code into components/variables
1. Figure out to handle API key. Current questions are 1) how to embed API key in env variable, 2) is it even safe to put the API key in an .env file if that is exposed to client after build process and 3) should we make an org gmail acct/API key so that we stop using Rithvik's personal key?

Lower Priority:
1. Integrate expo build process with Docker
1. Add a unit test suite

### How to setup for local development

We use expo for development and testing in both iOS and Android

1. Clone down this repo
1. Put in a real API key on line 33 of `App.js`
1. Run `yarn install` to install all the required modules
1. run `yarn ios` to run on iPhone emulator (requires Mac and iPhone emulator setup) or run `yarn android` to run on Android Emulator (requires AndroidStudio and AndroidEmulator setup)

Some things to note:
1. Whenever you want to install a new package, you have to do `expo install <package-name>` instead of `yarn add ...` or `npm install ...` so that expo can manage the cross-device deps
1. Features such as webview (required for youtube iframe) do not work in web client, but they do work in iOS and Android
1. If you haven't developed in XCode with an iOS simulator before, you'll need to set up a simulator
1. Likewise you'll need to make sure you have AndroidStudio installed and set up an Android Emulator


#### Misc documentation

Docs for youtube iframe: https://lonelycpp.github.io/react-native-youtube-iframe/component-props

Setup is based on these instructions:

https://reactnative.dev/docs/environment-setup

https://docs.expo.io/versions/latest/sdk/webview/

https://lonelycpp.github.io/react-native-youtube-iframe/


## We have shifted development workflow to snack.expo.io. See instructions below on how to open the project as an Expo snack. youtube-api and base-page branches have been merged.

## Alternatively,
you can run the project as a snack on snack.expo.io by (1) importing the git repository, (2) installing the
necessary dependencies, and (3) running it on the provided Android emulator on snack.expo.io.

### (1) Importing the git repository
Go to snack.expo.io and click the 3 vertical dots directly to the right of "Project" on the left side
of the page. Then click "Import git repository". In the given field, type in the URL of the git repository
that you want to import as a snack (in this case, use "https://github.com/uchicagotechteam/Cook-County-Mobile-App/tree/base-page").

### (2) Installing the necessary dependencies
Once the git repository has been imported as a snack, at the bottom of the development environment there will be
text in red recommended dependencies that are needed to run the project. Click on the text in red to install
all the necessary dependencies until they are all installed.

### (3) Run the project on an Android emulator
On the right hand side of the page, click the "Android" button, followed by "Tap to play". Soon, the project
should open on the Android emulator (you may have to wait in a queue for a bit).
If you want to see the uploaded sample video, click "STUDENT" and play the video at the top of the page.
32 changes: 32 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"expo": {
"name": "project-rainbow-base-page",
"slug": "snack-a1d95dad-f134-4b62-add7-026db2ee28b0",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
Binary file added assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
39 changes: 39 additions & 0 deletions components/AdjustableText.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react';
import { Text } from 'react-native';

// Simple wrapper class for React Native's Text component which will take a default font size and a maximum height, and will keep reducing the font size by 1 from the default until the wrapped Text component has <= to the max height.
// Props include:
// style : Style Object - style for the text, excluding font size
// maxHeight : Int - upperbound on the height that the text can take up
// text : JSX - whatever components (probably should only be used with just text) you want to fit within props.maxHeight by shrinking the font
// fontSize : Int - initial font size that the component will try to use. Will shrink if text is taller than props.maxHeight
class AdjustableText extends React.Component {

constructor(props) {
super(props);

this.state = {
currentFont : this.props.fontSize
};
}


render() {
return (
<Text
adjustsFontSizeToFit
style={ [this.props.style, { fontSize: this.state.currentFont }] }
onTextLayout={ (e) => {
let { lines } = e.nativeEvent;
if (lines.map(line => {lines.height}).reduce((a, b) => a + b, 0) > this.props.maxHeight) {
this.setState({currentFont: this.state.currentFont - 1});
}
} }
>
{ this.props.text }
</Text>
);
}
}

export default AdjustableText;
Loading