-
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.
Correct the projects issues raise by standard Change the location of test files Use babel eslint parser with standard
- Loading branch information
1 parent
02f1b52
commit 8451dcb
Showing
38 changed files
with
1,574 additions
and
870 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
module.exports = { | ||
verbose: true, | ||
collectCoverage: true, | ||
setupTestFrameworkScriptFile: "<rootDir>/src/tests/setupTests.js", | ||
coverageReporters: ["text", "lcov"], | ||
setupTestFrameworkScriptFile: '<rootDir>/src/tests/setupTests.js', | ||
coverageReporters: ['text', 'lcov'], | ||
collectCoverageFrom: [ | ||
"**/*.{js,jsx}", | ||
"!**/*.{config}.{js}", | ||
"!**/node_modules/**", | ||
"!**/dist/**", | ||
"!**/vendor/**", | ||
"!**/coverage/**", | ||
"!**/src/assets/**", | ||
"!**/semantic/**", | ||
"!**/src/index.js" | ||
'**/*.{js,jsx}', | ||
'!**/*.{config}.{js}', | ||
'!**/node_modules/**', | ||
'!**/dist/**', | ||
'!**/vendor/**', | ||
'!**/coverage/**', | ||
'!**/src/assets/**', | ||
'!**/semantic/**', | ||
'!**/src/index.js' | ||
], | ||
"transform": { | ||
"^.+\\.js$": "babel-jest", | ||
".+\\.(css|styl|less|sass|scss)$": "jest-transform-css", | ||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/jest.fileTransformer.config.js" | ||
'transform': { | ||
'^.+\\.js$': 'babel-jest', | ||
'.+\\.(css|styl|less|sass|scss)$': 'jest-transform-css', | ||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/jest.fileTransformer.config.js' | ||
} | ||
}; | ||
} |
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 |
Oops, something went wrong.