Skip to content
This repository was archived by the owner on Apr 11, 2019. It is now read-only.

Commit f5f6a6a

Browse files
authored
Merge pull request #39 from RyanCCollins/feat_rc_server_rendering
Feat rc server rendering
2 parents 31e5d60 + 9ab2a93 commit f5f6a6a

File tree

109 files changed

+10790
-9849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+10790
-9849
lines changed

app/src/apolloClient.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import ApolloClient, {
2+
createNetworkInterface,
3+
addTypeName,
4+
} from 'apollo-client';
5+
const baseUrl = typeof process.env.BASE_URL !== 'undefined' ?
6+
process.env.BASE_URL : 'https://0.0.0.0:3000/';
7+
const productionUrl = `${baseUrl}graphql`;
8+
9+
const client = new ApolloClient({
10+
networkInterface: createNetworkInterface(productionUrl),
11+
initialState: typeof window !== 'undefined' ? window.__APOLLO_STATE__ : null,
12+
queryTransformer: addTypeName,
13+
});
14+
15+
export default client;

app/src/components/App/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

app/src/components/App/actions.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/src/components/App/index.js

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## AppFooter Component
2+
A component that shows up as a footer at the bottom of the page. It shows information about the project and also social sharing links.
3+
4+
The component is completely presentational and is stateless. No props are passed in.
5+
6+
### Example
7+
8+
```js
9+
<AppFooter />
10+
```
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import React from 'react';
2+
import styles from './index.module.scss';
3+
import cssModules from 'react-css-modules';
4+
import Footer from 'grommet-udacity/components/Footer';
5+
import Box from 'grommet-udacity/components/Box';
6+
import Heading from 'grommet-udacity/components/Heading';
7+
import SocialShare from 'grommet-udacity/components/SocialShare';
8+
import Anchor from 'grommet-udacity/components/Anchor';
9+
10+
const AppFooter = () => (
11+
<Footer pad="large" colorIndex="light-2">
12+
<Box
13+
direction="column"
14+
align="center"
15+
pad="none"
16+
responsive
17+
className={styles.flexOne}
18+
>
19+
<Heading tag="h3">
20+
By{' '}
21+
<a
22+
className={styles.footerAnchor}
23+
href="http://www.ryancollins.io"
24+
>
25+
Ryan Collins
26+
</a>
27+
</Heading>
28+
<Heading tag="h5">
29+
This app is licensed under the{' '}
30+
<a
31+
className={styles.footerAnchor}
32+
href="https://github.com/RyanCCollins/ryancollinsio/blob/master/LICENSE"
33+
>
34+
MIT License.
35+
</a>
36+
{' '}Take a peak at the{' '}
37+
<br />
38+
<Anchor
39+
className={styles.footerAnchor}
40+
href="https://github.com/RyanCCollins/ryancollinsio"
41+
>
42+
source code.
43+
</Anchor>
44+
</Heading>
45+
<nav
46+
aria-hidden
47+
className={
48+
'grommetux-box grommetux-box--direction-row ' +
49+
'grommetux-box--responsive grommetux-box--pad-none ' +
50+
'grommetux-menu grommetux-menu--row grommetux-menu--inline'
51+
}
52+
>
53+
<SocialShare
54+
a11yTitle="Go to Facebook to Share this website"
55+
type="facebook"
56+
link="http://www.ryancollins.io"
57+
text="RyanCollins.io"
58+
/>
59+
<SocialShare
60+
a11yTitle="Go to Twitter to Share this website"
61+
type="twitter"
62+
link="http://www.ryancollins.io"
63+
text="RyanCollins.io"
64+
/>
65+
<SocialShare
66+
a11yTitle="Go to Linkedin to Share this website"
67+
type="linkedin"
68+
link="http://www.ryancollins.io"
69+
title="Restaurant Reviewer"
70+
text="RyanCollins.io"
71+
/>
72+
</nav>
73+
</Box>
74+
</Footer>
75+
);
76+
77+
export default cssModules(AppFooter, styles);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.appFooter {
2+
background: #fbfbfb;
3+
padding: 50px;
4+
title {
5+
color: black !important;
6+
}
7+
}
8+
9+
.flexOne {
10+
flex: 1;
11+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
exports[`<AppFooter /> should render with default props 1`] = `
2+
<Footer
3+
colorIndex="light-2"
4+
direction="row"
5+
pad="large"
6+
responsive={false}>
7+
<Box
8+
align="center"
9+
announce={false}
10+
className={undefined}
11+
direction="column"
12+
focusable={true}
13+
pad="none"
14+
responsive={true}
15+
tag="div">
16+
<Heading
17+
tag="h3">
18+
By
19+
20+
<a
21+
className={undefined}
22+
href="http://www.ryancollins.io">
23+
Ryan Collins
24+
</a>
25+
</Heading>
26+
<Heading
27+
tag="h5">
28+
This app is licensed under the
29+
30+
<a
31+
className={undefined}
32+
href="https://github.com/RyanCCollins/ryancollinsio/blob/master/LICENSE">
33+
MIT License.
34+
</a>
35+
36+
Take a peak at the
37+
38+
<br />
39+
<Anchor
40+
className={undefined}
41+
href="https://github.com/RyanCCollins/ryancollinsio"
42+
tag="a">
43+
source code.
44+
</Anchor>
45+
</Heading>
46+
<nav
47+
aria-hidden={true}
48+
className="grommetux-box grommetux-box--direction-row grommetux-box--responsive grommetux-box--pad-none grommetux-menu grommetux-menu--row grommetux-menu--inline">
49+
<SocialShare
50+
a11yTitle="Go to Facebook to Share this website"
51+
link="http://www.ryancollins.io"
52+
text="RyanCollins.io"
53+
title=""
54+
type="facebook" />
55+
<SocialShare
56+
a11yTitle="Go to Twitter to Share this website"
57+
link="http://www.ryancollins.io"
58+
text="RyanCollins.io"
59+
title=""
60+
type="twitter" />
61+
<SocialShare
62+
a11yTitle="Go to Linkedin to Share this website"
63+
link="http://www.ryancollins.io"
64+
text="RyanCollins.io"
65+
title="Restaurant Reviewer"
66+
type="linkedin" />
67+
</nav>
68+
</Box>
69+
</Footer>
70+
`;

app/src/components/Header/tests/index.test.js renamed to app/src/components/AppFooter/tests/index.test.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import Header from '../index';
1+
import AppFooter from '../index';
22
import { shallow } from 'enzyme';
33
import { shallowToJson } from 'enzyme-to-json';
44
import React from 'react';
55

6-
describe('<Header />', () => {
6+
describe('<AppFooter />', () => {
77
it('should render with default props', () => {
88
const wrapper = shallow(
9-
<Header
10-
content="Hello World"
11-
/>
9+
<AppFooter />
1210
);
1311
expect(shallowToJson(wrapper)).toMatchSnapshot();
1412
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Avatar Component
2+
A reusable avatar component with some styling.
3+
4+
### Example
5+
6+
```js
7+
<Avatar src={person.url} />
8+
```
9+
10+
### Props
11+
12+
| Prop | Type | Default | Possible Values
13+
| ------------- | -------- | ----------- | ---------------------------------------------
14+
| **src** | String | | Any string value

0 commit comments

Comments
 (0)