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
import { schema, normalize } from 'normalizr' | |
import 'isomorphic-fetch' | |
import { responseMessageSchema } from 'schemas' | |
const API_ROOT = 'https://api.myjson.com/' | |
function callApi(endpoint, schema) { | |
const fullUrl = (endpoint.indexOf(API_ROOT) === -1) ? API_ROOT + endpoint : endpoint | |
return fetch(fullUrl) |
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
const REQUEST = 'REQUEST' | |
const SUCCESS = 'SUCCESS' | |
const FAILURE = 'FAILURE' | |
function createRequestTypes(base) { | |
return [REQUEST, SUCCESS, FAILURE].reduce((acc, type) => { | |
acc[type] = `${base}_${type}` | |
return acc | |
}, {}) | |
} |
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
import React from 'react'; | |
import { View, Text, SafeAreaView } from 'react-native'; | |
import ProfileDrawerItem from './ProfileDrawerItem'; | |
import images from 'res/images'; | |
import colors from 'res/colors'; | |
const ProfileDrawer = () => { | |
return ( | |
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background, justifyContent: 'space-between' }}> | |
<View> |
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
import React from 'react'; | |
import { View, Image, Text, StyleSheet, TouchableOpacity, } from 'react-native'; | |
import ProfilePicture from 'components/ProfilePicture'; | |
import ActivityDescription from './ActivityDescription'; | |
const Activity = (props) => { | |
return <View style={styles.container}> | |
<ProfilePicture item={props.item} size={55} /> | |
<ActivityDescription item={props.item} /> |
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
import React from 'react'; | |
import { View, StyleSheet, Image, Text, TouchableOpacity } from 'react-native'; | |
import colors from 'res/colors'; | |
import images from 'res/images'; | |
import prettyTime from 'utils/prettyTime'; | |
import ProfilePicture from 'components/ProfilePicture'; | |
const MessageListItem = (props) => { | |
const prettyTimeTemplates = { | |
short: { |
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
import React from 'react'; | |
import { StyleSheet, Text, } from 'react-native'; | |
import colors from 'res/colors'; | |
import { TouchableOpacity } from 'react-native-gesture-handler'; | |
import prettyTime from 'utils/prettyTime'; | |
const PostPublishDate = ({ post }) => { | |
const prettyTimeTemplates = { | |
long: { | |
prefix: "", |