This file contains hidden or 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
| import React from 'react' | |
| import { Context } from '../lib/context' | |
| import { firebase, db } from '../lib/firebase' | |
| import Data from '../components/Data' | |
| export default class Home extends React.Component { | |
| constructor (props) { | |
| super(props) | |
| this.state = { |
This file contains hidden or 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
| import React from 'react' | |
| import {SafeAreaView, View, Text} from 'react-native' | |
| const App = props => { | |
| return ( | |
| <SafeAreaView> | |
| <View> | |
| <Text>Home screen!</Text> | |
| </View> | |
| </SafeAreaView> |
This file contains hidden or 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
| import React from 'react' | |
| import {SafeAreaView, View, Text} from 'react-native' | |
| import Amplify from 'aws-amplify' | |
| import awsconfig from './aws-exports' | |
| import {withAuthenticator} from 'aws-amplify-react-native' | |
| Amplify.configure(awsconfig) | |
| const App = props => { | |
| return ( |
This file contains hidden or 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
| { | |
| "data": { | |
| "metrics": [ | |
| { | |
| "time": 1577905826702, | |
| "value": 62 | |
| }, | |
| { | |
| "time": 1577905886702, | |
| "value": 62 |
This file contains hidden or 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
| const generateCalendar = (today: Date) => { | |
| const daysInMonth = getDaysInMonth(today) | |
| const firstDay = new Date(today.getFullYear(), today.getMonth()).getDay() | |
| // in order to calculate how many calendar weeks there are (starting on Sunday), we can take | |
| // days in the month and add first day + 1 to include the first week offset. returns an array | |
| // that looks something like this: | |
| // [undefined, undefined, undefined, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] | |
| const daysWithOffset = new Array(daysInMonth + firstDay).fill(undefined).map((v, i) => { | |
| if (i < firstDay) { |
OlderNewer