-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 28-add-cypress
- Loading branch information
Showing
38 changed files
with
1,374 additions
and
848 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const path = require('path'); | ||
const path = require('path') | ||
|
||
module.exports = { | ||
process(src, filename, config, options) { | ||
return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';'; | ||
}, | ||
}; | ||
process (src, filename, config, options) { | ||
return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';' | ||
} | ||
} |
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,18 +1,19 @@ | ||
import axios from "axios"; | ||
import { GET_USERS } from "../types"; | ||
import axios from 'axios' | ||
import { GET_USERS } from '../types' | ||
|
||
export let getUsers = users => ({ type: GET_USERS, payload: users }); | ||
export let getUsers = users => ({ type: GET_USERS, payload: users }) | ||
|
||
export let fetchUsers = () => dispatch => { | ||
return axios | ||
.get("/api/v1/users") | ||
.get('/api/v1/users') | ||
.then(response => { | ||
let { users, gravatar_url, karma_total } = response.data; | ||
/* eslint-disable-next-line */ | ||
let { users, gravatar_url, karma_total } = response.data | ||
users = users.map(user => { | ||
user.gravatar_url = gravatar_url[user.id]; | ||
user.karma_total = karma_total[user.id]; | ||
return user; | ||
}); | ||
dispatch(getUsers(users)); | ||
}); | ||
}; | ||
user.gravatar_url = gravatar_url[user.id] | ||
user.karma_total = karma_total[user.id] | ||
return user | ||
}) | ||
dispatch(getUsers(users)) | ||
}) | ||
} |
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,22 +1,22 @@ | ||
import React from "react"; | ||
import { RingLoader } from "react-spinners"; | ||
import React from 'react' | ||
import { RingLoader } from 'react-spinners' | ||
|
||
const Paginate = ({ items, Component }) => { | ||
let itemsArray; | ||
let itemsArray | ||
if (items.length) { | ||
itemsArray = items.map(item => ( | ||
<Component key={item.id} item={item} /> | ||
)); | ||
)) | ||
} | ||
return ( | ||
itemsArray || ( | ||
<RingLoader | ||
sizeUnit={"px"} | ||
sizeUnit={'px'} | ||
size={200} | ||
color={"#34495E"} | ||
color={'#34495E'} | ||
/> | ||
) | ||
); | ||
}; | ||
) | ||
} | ||
|
||
export default Paginate; | ||
export default Paginate |
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,44 +1,44 @@ | ||
import React from "react"; | ||
import { Card, Image, Icon } from "semantic-ui-react"; | ||
import { Link } from "react-router-dom"; | ||
import "../assets/User.css"; | ||
import React from 'react' | ||
import { Card, Image, Icon } from 'semantic-ui-react' | ||
import { Link } from 'react-router-dom' | ||
import '../assets/User.css' | ||
|
||
const User = ({ item: user }) => { | ||
return ( | ||
<Card className="user-card" raised={true}> | ||
<Card className='user-card' raised> | ||
<Card.Content> | ||
<Link to={`/users/${user.id}`}> | ||
<Image | ||
src={`${user.gravatar_url}`} | ||
floated="left" | ||
rounded={true} | ||
size="tiny" | ||
floated='left' | ||
rounded | ||
size='tiny' | ||
/> | ||
<big className="card-header"> | ||
<big className='card-header'> | ||
<Card.Header> | ||
{user.first_name | ||
? fullName(user).length >= 12 | ||
? fullName(user).substring(0, 10) + "..." | ||
? fullName(user).substring(0, 10) + '...' | ||
: fullName(user) | ||
: user.slug.substring(0, 15)} | ||
</Card.Header> | ||
</big> | ||
</Link> | ||
<p> | ||
<Card.Description> | ||
{user.title_list.length | ||
? user.title_list.map(title => title + " ") | ||
? user.title_list.map(title => title + ' ') | ||
: null} | ||
</p> | ||
<p className="card-footer"> | ||
<Icon name="fire" /> {} | ||
</Card.Description> | ||
<p className='card-footer'> | ||
<Icon name='fire' /> {} | ||
{user.karma_total} | ||
</p> | ||
</Card.Content> | ||
</Card> | ||
); | ||
}; | ||
) | ||
} | ||
|
||
const fullName = user => { | ||
return user.first_name + " " + user.last_name; | ||
}; | ||
export default User; | ||
return user.first_name + ' ' + user.last_name | ||
} | ||
export default User |
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,32 +1,31 @@ | ||
import React, { Component, Fragment } from "react"; | ||
import { Grid } from "semantic-ui-react"; | ||
import React, { Component, Fragment } from 'react' | ||
import { Grid } from 'semantic-ui-react' | ||
import HomepageModal from './HomepageModal' | ||
import "./Homepage.css"; | ||
import modals from "./modals"; | ||
import './Homepage.css' | ||
import modals from './modals' | ||
|
||
export class Homepage extends Component { | ||
|
||
renderModals() { | ||
renderModals () { | ||
return modals.map((modal, id) => { | ||
return ( | ||
<HomepageModal key={id} modal={modal} /> | ||
); | ||
}); | ||
) | ||
}) | ||
}; | ||
|
||
render() { | ||
render () { | ||
return ( | ||
<Fragment> | ||
<Grid columns={16} stretched className="landing-page-background"> | ||
<Grid columns={16} stretched className='landing-page-background'> | ||
<Grid.Row style={{ height: '500px' }}> | ||
</Grid.Row> | ||
{this.renderModals()} | ||
<Grid.Row style={{ height: '320px' }}> | ||
</Grid.Row> | ||
</Grid> | ||
</Fragment> | ||
); | ||
) | ||
} | ||
} | ||
|
||
export default Homepage; | ||
export default Homepage |
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,49 +1,49 @@ | ||
import React, { Component } from "react"; | ||
import PropTypes from "prop-types" | ||
import { Modal, Grid, Button, Image, Icon } from "semantic-ui-react"; | ||
import React, { Component } from 'react' | ||
import PropTypes from 'prop-types' | ||
import { Modal, Grid, Button, Image, Icon } from 'semantic-ui-react' | ||
|
||
export class HomepageModal extends Component { | ||
render() { | ||
const { modal, id } = this.props | ||
return ( | ||
<Grid.Row | ||
verticalAlign="bottom" | ||
key={id} | ||
style={{ height: modal.height }}> | ||
{modal.text} | ||
<Grid.Column width={modal.xsOffset}> | ||
</Grid.Column> | ||
<Grid.Column width={3}> | ||
<Modal trigger={ | ||
<Button primary size="massive"> | ||
<Icon name='home' /> | ||
{modal.buttonText} | ||
</Button> | ||
} closeIcon> | ||
<Modal.Content image> | ||
<Image wrapped size='medium' src={modal.image} alt={modal.imageAltText} /> | ||
<Modal.Description> | ||
{modal.modalText} | ||
</Modal.Description> | ||
</Modal.Content> | ||
</Modal> | ||
</Grid.Column> | ||
</Grid.Row> | ||
) | ||
} | ||
render () { | ||
const { modal, id } = this.props | ||
return ( | ||
<Grid.Row | ||
verticalAlign='bottom' | ||
key={id} | ||
style={{ height: modal.height }}> | ||
{modal.text} | ||
<Grid.Column width={modal.xsOffset}> | ||
</Grid.Column> | ||
<Grid.Column width={3}> | ||
<Modal trigger={ | ||
<Button primary size='massive'> | ||
<Icon name='home' /> | ||
{modal.buttonText} | ||
</Button> | ||
} closeIcon> | ||
<Modal.Content image> | ||
<Image wrapped size='medium' src={modal.image} alt={modal.imageAltText} /> | ||
<Modal.Description> | ||
{modal.modalText} | ||
</Modal.Description> | ||
</Modal.Content> | ||
</Modal> | ||
</Grid.Column> | ||
</Grid.Row> | ||
) | ||
} | ||
} | ||
|
||
export default HomepageModal | ||
|
||
HomepageModal.propTypes = { | ||
modal: PropTypes.shape({ | ||
buttonText: PropTypes.string.isRequired, | ||
xsOffset: PropTypes.number.isRequired, | ||
height: PropTypes.string.isRequired, | ||
reactId: PropTypes.string.isRequired, | ||
image: PropTypes.string.isRequired, | ||
imageAltText: PropTypes.string.isRequired, | ||
imageWidth: PropTypes.string.isRequired, | ||
modalText: PropTypes.string.isRequired, | ||
}) | ||
} | ||
modal: PropTypes.shape({ | ||
buttonText: PropTypes.string.isRequired, | ||
xsOffset: PropTypes.number.isRequired, | ||
height: PropTypes.string.isRequired, | ||
reactId: PropTypes.string.isRequired, | ||
image: PropTypes.string.isRequired, | ||
imageAltText: PropTypes.string.isRequired, | ||
imageWidth: PropTypes.string.isRequired, | ||
modalText: PropTypes.string.isRequired | ||
}) | ||
} |
Oops, something went wrong.