Skip to content

Commit f32b2c4

Browse files
committed
Run prettier on everything.
1 parent 691bc73 commit f32b2c4

Some content is hidden

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

58 files changed

+1514
-1364
lines changed

bin/favicons.js

+7-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const OUTPUT_PATH = '../public/gen/';
88

99
const outputDir = path.resolve(__dirname, OUTPUT_PATH);
1010
if (!fs.existsSync(outputDir)) {
11-
fs.mkdirSync(outputDir, {recursive: true});
11+
fs.mkdirSync(outputDir, { recursive: true });
1212
}
1313
const indexPath = path.resolve(__dirname, '../src/index.html');
1414
const outputIndexPath = path.resolve(__dirname, '../public/index.html');
@@ -37,15 +37,12 @@ const fullConfig = {
3737
...config,
3838
};
3939

40-
const writeTo = (dir, file) => fs.writeFile(
41-
path.resolve(__dirname, dir, file.name),
42-
file.contents,
43-
err => {
40+
const writeTo = (dir, file) =>
41+
fs.writeFile(path.resolve(__dirname, dir, file.name), file.contents, err => {
4442
if (err) {
4543
console.log(err);
4644
}
47-
}
48-
);
45+
});
4946

5047
const callback = function(err, res) {
5148
if (err) {
@@ -55,14 +52,14 @@ const callback = function(err, res) {
5552
res.files.forEach(file => writeTo(OUTPUT_PATH, file));
5653

5754
console.log('Writing index.html');
58-
fs.readFile(indexPath, 'utf8', function (err, data) {
55+
fs.readFile(indexPath, 'utf8', function(err, data) {
5956
if (err) {
6057
return console.log(err);
6158
}
6259
var result = data.replace('<!--FAVICON_HTML-->', res.html.join(''));
6360

64-
fs.writeFile(outputIndexPath, result, 'utf8', function (err) {
65-
if (err) return console.log(err);
61+
fs.writeFile(outputIndexPath, result, 'utf8', function(err) {
62+
if (err) return console.log(err);
6663
});
6764
});
6865
};

manifest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ module.exports = {
66
start_url: '.',
77
theme_color: '#000',
88
background_color: '#fff',
9-
logo: path.resolve(__dirname, 'src/images/icon.png')
9+
logo: path.resolve(__dirname, 'src/images/Icon.png'),
1010
};

src/App.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import React from "react";
2-
import { Router, navigate } from "@reach/router";
1+
import React from 'react';
2+
import { Router, navigate } from '@reach/router';
33

4-
import Home from "./pages/Home";
5-
import Profile from "./pages/Profile";
6-
import LoginRegister from "./pages/LoginRegister";
7-
import NavPage from "./pages/NavPage";
8-
import ChallengeRecorder from "./pages/ChallengeRecorder";
9-
import FullPageLoader from "./pages/FullPageLoader";
10-
import TakeChallenge from "./pages/TakeChallenge";
11-
import ResponseViewer from "./pages/ResponseViewer";
12-
import ChallengeList from "./pages/ChallengeList";
13-
import ResponseList from "./pages/ResponseList";
14-
import HumanAdmin from "./components/HumanAdmin";
15-
import { UserSelectors, UserActions } from "modules/user";
16-
import { useActions, useSelectors } from "hooks";
4+
import Home from './pages/Home';
5+
import Profile from './pages/Profile';
6+
import LoginRegister from './pages/LoginRegister';
7+
import NavPage from './pages/NavPage';
8+
import ChallengeRecorder from './pages/ChallengeRecorder';
9+
import FullPageLoader from './pages/FullPageLoader';
10+
import TakeChallenge from './pages/TakeChallenge';
11+
import ResponseViewer from './pages/ResponseViewer';
12+
import ChallengeList from './pages/ChallengeList';
13+
import ResponseList from './pages/ResponseList';
14+
import HumanAdmin from './components/HumanAdmin';
15+
import { UserSelectors, UserActions } from 'modules/user';
16+
import { useActions, useSelectors } from 'hooks';
1717

18-
const App = props => {
18+
const App = props => {
1919
const actions = useActions(UserActions);
2020
const { isInitializing, isLoggedIn } = useSelectors(UserSelectors);
2121

@@ -24,9 +24,9 @@ const App = props => {
2424
}
2525

2626
const pathname = window.location.pathname;
27-
if (!isLoggedIn && pathname !== "/login" && pathname !== "/register") {
27+
if (!isLoggedIn && pathname !== '/login' && pathname !== '/register') {
2828
actions.redirectForLogin(pathname);
29-
navigate("/login");
29+
navigate('/login');
3030
}
3131

3232
return (
@@ -45,6 +45,6 @@ const App = props => {
4545
</Router>
4646
</NavPage>
4747
);
48-
}
48+
};
4949

5050
export default App;

src/ProvisionedApp.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React from "react";
2-
import { Provider } from "react-redux";
3-
import MuiThemeProvider from "@material-ui/core/styles/MuiThemeProvider";
1+
import React from 'react';
2+
import { Provider } from 'react-redux';
3+
import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
44

5-
import App from "./App";
6-
import store from "./storeContainer";
7-
import ErrorBoundary from "./components/ErrorBoundary";
8-
import { UserActions } from "./modules/user";
9-
import humanTheme from "./themes/humanTheme";
5+
import App from './App';
6+
import store from './storeContainer';
7+
import ErrorBoundary from './components/ErrorBoundary';
8+
import { UserActions } from './modules/user';
9+
import humanTheme from './themes/humanTheme';
1010

1111
store.dispatch(UserActions.initLogin());
1212

@@ -20,4 +20,4 @@ const ProvisionedApp = () => (
2020
</ErrorBoundary>
2121
);
2222

23-
export default ProvisionedApp;
23+
export default ProvisionedApp;

src/__mocks__/axios.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function request(config) {
3333

3434
pendingRequests.push({
3535
config: config,
36-
promise: promise
36+
promise: promise,
3737
});
3838

3939
return promise;
@@ -43,21 +43,21 @@ function __clearMockResponses() {
4343
mockResponses = Object.create(null);
4444
}
4545

46-
function __setMockResponse({endpoint, response}) {
46+
function __setMockResponse({ endpoint, response }) {
4747
if (!mockResponses[endpoint]) {
4848
mockResponses[endpoint] = [];
4949
}
5050
mockResponses[endpoint].push(response);
5151
}
5252

5353
function failMissing(req) {
54-
let error = new Error("Request failed with status code 404");
54+
let error = new Error('Request failed with status code 404');
5555
error.config = req.config;
5656
error.response = {
5757
config: req.config,
58-
data: "",
58+
data: '',
5959
status: 404,
60-
statusText: "NOT FOUND"
60+
statusText: 'NOT FOUND',
6161
};
6262
req.promise.reject(error);
6363
}
@@ -92,7 +92,7 @@ function __cancelToken(token) {
9292
// loop through the requests and cancel if they have that token
9393
pendingRequests.forEach(req => {
9494
if (req.config.cancelToken == token) {
95-
let error = new Error("Cancel");
95+
let error = new Error('Cancel');
9696
error.axiosCancel = true;
9797
req.promise.reject(error);
9898
}
@@ -102,9 +102,9 @@ function __cancelToken(token) {
102102
function __axiosResponseError(status, statusText) {
103103
let error = new Error(`${status}(${statusText})`);
104104
error.response = {
105-
data: "",
105+
data: '',
106106
status: status,
107-
statusText: statusText
107+
statusText: statusText,
108108
};
109109
return error;
110110
}
@@ -115,8 +115,8 @@ function __axiosResponse(status, data) {
115115
status: status,
116116
headers: {},
117117
config: {},
118-
request: {}
119-
}
118+
request: {},
119+
};
120120
}
121121

122122
function isCancel(error) {
@@ -127,12 +127,12 @@ const CancelToken = {
127127
source: () => {
128128
const result = {
129129
token: currentTokenId,
130-
cancel: (token) => mockAxios.__cancelToken(token)
131-
}
130+
cancel: token => mockAxios.__cancelToken(token),
131+
};
132132
currentTokenId++;
133133
return result;
134-
}
135-
}
134+
},
135+
};
136136

137137
mockAxios.CancelToken = CancelToken;
138138
mockAxios.request = request;
@@ -146,4 +146,4 @@ mockAxios.__axiosResponse = __axiosResponse;
146146
mockAxios.__clearMockResponses = __clearMockResponses;
147147
mockAxios.__callbackOnRequest = __callbackOnRequest;
148148

149-
export default mockAxios;
149+
export default mockAxios;

src/components/AdapterLink.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React from "react";
1+
import React from 'react';
22

3-
import { Link } from "@reach/router";
3+
import { Link } from '@reach/router';
44

55
// Todo: Wrap this together with @material-ui/core/Link
66
const AdapterLink = React.forwardRef((props, ref) => (
77
<Link innerRef={ref} {...props} />
88
));
99

10-
export default AdapterLink;
10+
export default AdapterLink;

0 commit comments

Comments
 (0)