chore: prettier UI

This commit is contained in:
41666 2020-08-02 16:28:46 -04:00
parent 1f03e1bb11
commit d08c9e4829
No known key found for this signature in database
GPG key ID: BC51D07640DC10AF
9 changed files with 36 additions and 26 deletions

View file

@ -1,7 +1,7 @@
import superagent from 'superagent'
import { history } from '../router/history'
export const fetchServers = async dispatch => {
export const fetchServers = async (dispatch) => {
const rsp = await superagent.get('/api/servers')
dispatch({
@ -14,7 +14,7 @@ export const fetchServers = async dispatch => {
})
}
export const userInit = async dispatch => {
export const userInit = async (dispatch) => {
if (!window.location.pathname.startsWith('/oauth')) {
try {
const rsp = await superagent.get('/api/auth/user')
@ -38,7 +38,7 @@ export const userInit = async dispatch => {
}
}
export const userLogout = async dispatch => {
export const userLogout = async (dispatch) => {
try {
await superagent.post('/api/auth/logout')
} catch (e) {}
@ -50,7 +50,7 @@ export const userLogout = async dispatch => {
window.location.href = '/'
}
export const startServerPolling = dispatch => {
export const startServerPolling = (dispatch) => {
return poll(window.__APP_STORE__.dispatch, window.__APP_STORE__.getState) // let's not cheat... :c
}

View file

@ -1,4 +1,4 @@
export const fadeOut = cb => dispatch => {
export const fadeOut = (cb) => (dispatch) => {
dispatch({
type: Symbol.for('app fade'),
data: true,

View file

@ -17,7 +17,7 @@ class Category extends Component {
)
}
onRoleToggle = id => (next, old) => {
onRoleToggle = (id) => (next, old) => {
const type = this.props.category.get('type')
switch (type) {
@ -45,7 +45,7 @@ class Category extends Component {
<h4>{category.get('name')}</h4>
{category
.get('roles_map')
.sortBy(r => r.get('position'))
.sortBy((r) => r.get('position'))
.reverse()
.map((r, k) => {
const id = r.get('id')

View file

@ -8,7 +8,6 @@ import discordLogo from '../../pages/images/discord-logo.svg'
let specialFills = {}
let showTransFlag = false
class Wrapper extends Component {
render() {
const date = new Date()
@ -18,7 +17,7 @@ class Wrapper extends Component {
) {
specialFills = {
circleFill: '#FFAEC6',
typeFill: '#6FDCFF'
typeFill: '#6FDCFF',
}
showTransFlag = true
}
@ -31,7 +30,18 @@ class Wrapper extends Component {
<div className="uk-navbar-left">
<Link to="/">
<div style={{ display: 'flex' }}>
<Logotype style={{ height: '2rem', marginRight: '12px' }} className="wrapper__logotype" {...specialFills} /> {showTransFlag && <TransFlag height="100%" width="75px" uk-tooltip="pos: bottom; title: Roleypoly says trans rights!" />}
<Logotype
style={{ height: '2rem', marginRight: '12px' }}
className="wrapper__logotype"
{...specialFills}
/>{' '}
{showTransFlag && (
<TransFlag
height="100%"
width="75px"
uk-tooltip="pos: bottom; title: Roleypoly says trans rights!"
/>
)}
</div>
</Link>
</div>

View file

@ -8,7 +8,7 @@ import Error404 from './Error404'
export { default as Landing } from './Landing'
export { default as Error404 } from './Error404'
const Pages = props => {
const Pages = (props) => {
return (
<div className="pages">
<Scrollbars autoHeight autoHeightMax="calc(100vh - 80px)">

View file

@ -46,7 +46,7 @@ export default function register() {
function registerValidSW(swUrl) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
.then((registration) => {
registration.onupdatefound = () => {
const installingWorker = registration.installing
installingWorker.onstatechange = () => {
@ -67,7 +67,7 @@ function registerValidSW(swUrl) {
}
}
})
.catch(error => {
.catch((error) => {
console.error('Error during service worker registration:', error)
})
}
@ -75,14 +75,14 @@ function registerValidSW(swUrl) {
function checkValidServiceWorker(swUrl) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl)
.then(response => {
.then((response) => {
// Ensure service worker exists, and that we really are getting a JS file.
if (
response.status === 404 ||
response.headers.get('content-type').indexOf('javascript') === -1
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
navigator.serviceWorker.ready.then((registration) => {
registration.unregister().then(() => {
window.location.reload()
})
@ -99,7 +99,7 @@ function checkValidServiceWorker(swUrl) {
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
navigator.serviceWorker.ready.then((registration) => {
registration.unregister()
})
}

View file

@ -3,7 +3,7 @@ import { createLogger } from 'redux-logger'
import thunk from 'redux-thunk'
import rootReducer from '../reducers'
const configureStore = preloadedState => {
const configureStore = (preloadedState) => {
const store = createStore(
rootReducer,
preloadedState,

View file

@ -4,7 +4,7 @@ import thunk from 'redux-thunk'
// import api from '../middleware/api'
import rootReducer from '../reducers'
const configureStore = preloadedState =>
const configureStore = (preloadedState) =>
createStore(rootReducer, preloadedState, applyMiddleware(thunk))
export default configureStore

View file

@ -1,8 +1,8 @@
import color from 'color'
export const msgToReal = msg => msg.replace(/</g, '&lt;').replace(/\n/g, '<br />')
export const msgToReal = (msg) => msg.replace(/</g, '&lt;').replace(/\n/g, '<br />')
export const colorToCSS = colorInt => {
export const colorToCSS = (colorInt) => {
if (colorInt === 0) {
return '#fff'
}