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, { Component } from 'react'; | |
import { graphql } from 'react-apollo'; | |
import { MatchSummary, NoDataSummary } from '@mls-digital/react-components'; | |
import MatchSummaryQuery from './match-summary.graphql'; | |
const mapResultsToProps = ({ data }) => { | |
if (!data.match) | |
return { | |
loading: data.loading, | |
}; |
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, { Component } from 'react'; | |
import { graphql } from 'react-apollo'; | |
import { MatchSummary, NoDataSummary } from '@mls-digital/react-components'; | |
import MatchSummaryQuery from './match-summary.graphql'; | |
// here we're using the graphql HOC as a decorator, but you can use it as a function too! | |
@graphql(MatchSummaryQuery, { | |
options: ({ id, season, shouldPoll }) => { | |
return { | |
variables: { |
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
query MatchSummary($id: String!, $season: String) { | |
match(id: $id) { | |
stats { | |
scores { | |
home { | |
score | |
isWinner: is_winner | |
} | |
away { | |
score |
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 } from 'react-native'; | |
export default ({ title, body }) => ( | |
<View> | |
<Text>{title}</Text> | |
<Text>{body}</Text> | |
</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
// Some thoughts on component structure & styling | |
/* | |
Easiest way to do themes in Aphrodite - use prop as an obj key | |
Each component holds their own theme info | |
*/ | |
import { css, StyleSheet } from 'aphrodite' | |
const Button = ({ theme }) => ( |
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
Show hidden characters
{ | |
"presets": [ | |
"react", | |
"stage-2", | |
[ | |
"env", | |
{ | |
"targets": { | |
"browsers": [ | |
"last 2 versions", |
NewerOlder