diff --git a/src/actions/index.js b/src/actions/index.js index 38ba96a..24560bb 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -671,4 +671,3 @@ export function switchCanvas(canvasId: number): PromiseAction { dispatch(onViewFinishChange()); }; } - diff --git a/src/actions/types.js b/src/actions/types.js index 9994f85..7051544 100644 --- a/src/actions/types.js +++ b/src/actions/types.js @@ -52,10 +52,7 @@ export type Action = | { type: 'SHOW_MODAL', modalType: string, modalProps: obj } | { type: 'HIDE_MODAL' } | { type: 'RELOAD_URL' } - | { type: 'ON_VIEW_FINISH_CHANGE' } - ; - - + | { type: 'ON_VIEW_FINISH_CHANGE' }; export type PromiseAction = Promise; export type ThunkAction = (dispatch: Dispatch, getState: GetState) => any; export type Dispatch = (action: Action | ThunkAction | PromiseAction | Array) => any; diff --git a/src/client.js b/src/client.js index 029cfa0..6436776 100644 --- a/src/client.js +++ b/src/client.js @@ -132,8 +132,9 @@ function initViewport() { let lastScale = initialState.canvas.scale; hammertime.on( 'panstart pinchstart pan pinch panend pinchend', - ({ type, deltaX, deltaY, scale }, - ) => { + ({ + type, deltaX, deltaY, scale, + }) => { viewport.style.cursor = 'move'; // like google maps const { scale: viewportScale } = store.getState().canvas; @@ -192,7 +193,9 @@ document.addEventListener('DOMContentLoaded', () => { const renderer = new Renderer(); renderer.setViewport(viewport); - ProtocolClient.on('pixelUpdate', ({ i, j, offset, color }) => { + ProtocolClient.on('pixelUpdate', ({ + i, j, offset, color, + }) => { store.dispatch(receivePixelUpdate(i, j, offset, color)); // render updated pixel renderer.renderPixel(i, j, offset, color); diff --git a/src/components/Admin.jsx b/src/components/Admin.jsx index 08e6cd7..b76249b 100644 --- a/src/components/Admin.jsx +++ b/src/components/Admin.jsx @@ -44,7 +44,6 @@ const data = { description: 'admin access on pixelplanet', body: , }; -const adminHtml = - `${ReactDOM.renderToStaticMarkup()}`; +const adminHtml = `${ReactDOM.renderToStaticMarkup()}`; export default adminHtml; diff --git a/src/components/ChangeMail.jsx b/src/components/ChangeMail.jsx index fb3a539..689a89e 100644 --- a/src/components/ChangeMail.jsx +++ b/src/components/ChangeMail.jsx @@ -4,7 +4,9 @@ */ import React from 'react'; -import { validateName, validateEMail, validatePassword, parseAPIresponse } from '../utils/validation'; +import { + validateName, validateEMail, validatePassword, parseAPIresponse, +} from '../utils/validation'; function validate(email, password) { const errors = []; @@ -87,19 +89,19 @@ class ChangeMail extends React.Component { return (
- {errors.map(error => ( + {errors.map((error) => (

Error: {error}

))} this.setState({ password: evt.target.value })} + onChange={(evt) => this.setState({ password: evt.target.value })} type="password" placeholder="Password" />
this.setState({ email: evt.target.value })} + onChange={(evt) => this.setState({ email: evt.target.value })} type="text" placeholder="New Mail" /> diff --git a/src/components/ChangeName.jsx b/src/components/ChangeName.jsx index 5839f82..c4e6edd 100644 --- a/src/components/ChangeName.jsx +++ b/src/components/ChangeName.jsx @@ -74,12 +74,12 @@ class ChangeName extends React.Component { return (
- {errors.map(error => ( + {errors.map((error) => (

Error: {error}

))} this.setState({ name: evt.target.value })} + onChange={(evt) => this.setState({ name: evt.target.value })} type="text" placeholder="New Username" /> diff --git a/src/components/ChangePassword.jsx b/src/components/ChangePassword.jsx index b3fa717..6d05e95 100644 --- a/src/components/ChangePassword.jsx +++ b/src/components/ChangePassword.jsx @@ -60,7 +60,9 @@ class ChangePassword extends React.Component { async handleSubmit(e) { e.preventDefault(); - const { password, new_password, confirm_password, submitting } = this.state; + const { + password, new_password, confirm_password, submitting, + } = this.state; if (submitting) return; const errors = validate(this.props.mailreg, password, new_password, confirm_password); @@ -95,28 +97,29 @@ class ChangePassword extends React.Component { return (
- {errors.map(error => ( + {errors.map((error) => (

Error: {error}

))} - {(this.props.mailreg) && + {(this.props.mailreg) + && ( this.setState({ password: evt.target.value })} + onChange={(evt) => this.setState({ password: evt.target.value })} type="password" placeholder="Old Password" /> - } + )}
this.setState({ new_password: evt.target.value })} + onChange={(evt) => this.setState({ new_password: evt.target.value })} type="password" placeholder="New Password" />
this.setState({ confirm_password: evt.target.value })} + onChange={(evt) => this.setState({ confirm_password: evt.target.value })} type="password" placeholder="Confirm New Password" /> diff --git a/src/components/Chat.jsx b/src/components/Chat.jsx index 52be78f..f18f784 100644 --- a/src/components/Chat.jsx +++ b/src/components/Chat.jsx @@ -26,20 +26,21 @@ const Chat = ({ chatMessages }) => {
    { - chatMessages.map(message => ( + chatMessages.map((message) => (

    - {(message[0] == 'info') ? - {message[1]} : -

    - {`${message[0]}: `} - { + {(message[0] == 'info') + ? {message[1]} + : ( +
    + {`${message[0]}: `} + { splitCoordsInString(message[1]).map((text, i) => { if (i % 2 == 0) { return ({text}); } return ({text}); }) } -
    - } +
    + )}

    )) } diff --git a/src/components/ChatBox.jsx b/src/components/ChatBox.jsx index fb56c39..18f56f0 100644 --- a/src/components/ChatBox.jsx +++ b/src/components/ChatBox.jsx @@ -13,10 +13,12 @@ import Chat from './Chat'; const ChatBox = ({ chatOpen }) => (
    - {(chatOpen) ? -
    - -
    : null} + {(chatOpen) + ? ( +
    + +
    + ) : null}
    ); diff --git a/src/components/ChatInput.jsx b/src/components/ChatInput.jsx index 94142ae..56c2f66 100644 --- a/src/components/ChatInput.jsx +++ b/src/components/ChatInput.jsx @@ -42,7 +42,7 @@ class ChatInput extends React.Component { this.setState({ message: evt.target.value })} + onChange={(evt) => this.setState({ message: evt.target.value })} type="text" placeholder="Chat here" /> diff --git a/src/components/DailyRankings.jsx b/src/components/DailyRankings.jsx index 09d80ac..f83cff7 100644 --- a/src/components/DailyRankings.jsx +++ b/src/components/DailyRankings.jsx @@ -19,14 +19,15 @@ const DailyRankings = ({ totalDailyRanking }) => ( Total Pixels { - totalDailyRanking.map(rank => ( + totalDailyRanking.map((rank) => ( {rank.dailyRanking} {rank.name} {rank.dailyTotalPixels} {rank.ranking} {rank.totalPixels} - )) + + )) }
diff --git a/src/components/DeleteAccount.jsx b/src/components/DeleteAccount.jsx index 0c27aaa..59f9874 100644 --- a/src/components/DeleteAccount.jsx +++ b/src/components/DeleteAccount.jsx @@ -72,12 +72,12 @@ class DeleteAccount extends React.Component { return (
- {errors.map(error => ( + {errors.map((error) => (

Error: {error}

))} this.setState({ password: evt.target.value })} + onChange={(evt) => this.setState({ password: evt.target.value })} type="password" placeholder="Password" /> diff --git a/src/components/DownloadButton.jsx b/src/components/DownloadButton.jsx index 6f6c664..bc1ec01 100644 --- a/src/components/DownloadButton.jsx +++ b/src/components/DownloadButton.jsx @@ -24,7 +24,7 @@ function download(view) { const [x, y] = view.map(Math.round); const filename = `pixelplanet-${x}-${y}.png`; - $viewport.toBlob(blob => fileDownload(blob, filename)); + $viewport.toBlob((blob) => fileDownload(blob, filename)); } diff --git a/src/components/GlobeButton.jsx b/src/components/GlobeButton.jsx index 149f9bc..dc0609b 100644 --- a/src/components/GlobeButton.jsx +++ b/src/components/GlobeButton.jsx @@ -19,7 +19,9 @@ function globe(canvasId, canvasIdent, canvasSize, view) { } -const GlobeButton = ({ canvasId, canvasIdent, canvasSize, view }) => ( +const GlobeButton = ({ + canvasId, canvasIdent, canvasSize, view, +}) => (
globe(canvasId, canvasIdent, canvasSize, view)}>
@@ -27,8 +29,12 @@ const GlobeButton = ({ canvasId, canvasIdent, canvasSize, view }) => ( // TODO optimize function mapStateToProps(state: State) { - const { canvasId, canvasIdent, canvasSize, view } = state.canvas; - return { canvasId, canvasIdent, canvasSize, view }; + const { + canvasId, canvasIdent, canvasSize, view, + } = state.canvas; + return { + canvasId, canvasIdent, canvasSize, view, + }; } export default connect(mapStateToProps)(GlobeButton); diff --git a/src/components/Html.jsx b/src/components/Html.jsx index 5c8605a..ef0f578 100644 --- a/src/components/Html.jsx +++ b/src/components/Html.jsx @@ -31,7 +31,9 @@ class Html extends React.Component { }; render() { - const { title, description, styles, scripts, body, code, useRecaptcha } = this.props; + const { + title, description, styles, scripts, body, code, useRecaptcha, + } = this.props; return ( @@ -45,14 +47,14 @@ class Html extends React.Component { content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" /> - {styles.map(style => - (