-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #381 from CaptainFact/staging
Release 1.0.0 Co-authored-by: null <greenkeeper[bot]@users.noreply.github.com> Co-authored-by: Vincent Lefoulon <[email protected]>
- Loading branch information
Showing
80 changed files
with
5,933 additions
and
1,741 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ should be enough. Otherwise follow the procedure below: | |
- `npm start` - Start the frontend | ||
- `npm run test` - run all unit tests | ||
|
||
Frontend is started on http://localhost:3333 | ||
|
||
A default account should have been created for you with | ||
email=`[email protected]` and password=`password`. | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
import ApolloClient from 'apollo-boost' | ||
import { GRAPHQL_API_URL } from '../config' | ||
|
||
const authMiddleware = operation => { | ||
const token = localStorage.getItem('token') | ||
|
||
if (token) { | ||
operation.setContext({ | ||
headers: { | ||
authorization: `Bearer ${token}` | ||
} | ||
}) | ||
} | ||
|
||
return operation | ||
} | ||
|
||
const GraphQLClient = new ApolloClient({ | ||
uri: GRAPHQL_API_URL | ||
uri: GRAPHQL_API_URL, | ||
request: authMiddleware | ||
}) | ||
|
||
export default GraphQLClient |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,56 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import styled, { css } from 'styled-components' | ||
import { themeGet } from 'styled-system' | ||
|
||
import { Flex } from '@rebass/grid' | ||
import logo from '../../assets/logo.svg' | ||
import borderlessLogo from '../../assets/logo-borderless.svg' | ||
import { Span, Small } from '../StyledUtils/Text' | ||
|
||
const Logo = ({ borderless = false }) => ( | ||
<h1 className="site-logo title is-1"> | ||
<img alt="C" src={borderless ? borderlessLogo : logo} /> | ||
<span className="logo-captain">aptain</span> | ||
<span className="logo-fact">Fact</span> | ||
<small className="beta"> (Beta)</small> | ||
</h1> | ||
const LogoContainer = styled(Flex)` | ||
max-height: 100%; | ||
align-items: center; | ||
font-family: ${themeGet('fontFamily.serif')}; | ||
color: ${themeGet('colors.black.500')}; | ||
${props => css` | ||
font-size: ${props.size / 2}px; | ||
height: ${props.size}px; | ||
`} | ||
` | ||
|
||
const Image = styled.img` | ||
height: 100%; | ||
width: ${props => props.size}px; | ||
` | ||
|
||
/** | ||
* The main website logo. | ||
*/ | ||
const Logo = ({ borderless, height }) => ( | ||
<LogoContainer size={height}> | ||
<Image alt="C" src={borderless ? borderlessLogo : logo} /> | ||
<Span ml="1px">aptain</Span> | ||
<Span fontWeight="bold" mr={1}> | ||
Fact | ||
</Span> | ||
<Small display={['none', 'block']} color="black.300" fontSize="0.6em" pb="0.2em"> | ||
(Beta) | ||
</Small> | ||
</LogoContainer> | ||
) | ||
|
||
Logo.propTypes = { | ||
/** If true, a version of the logo without border will be used */ | ||
borderless: PropTypes.bool, | ||
/** Base height of the component in pixels */ | ||
height: PropTypes.number | ||
} | ||
|
||
Logo.defaultProps = { | ||
borderless: false, | ||
height: 30 | ||
} | ||
|
||
export default Logo |
Oops, something went wrong.