mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-14 17:49:08 +00:00
chore: prettier UI
This commit is contained in:
parent
1f03e1bb11
commit
d08c9e4829
9 changed files with 36 additions and 26 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export const fadeOut = cb => dispatch => {
|
||||
export const fadeOut = (cb) => (dispatch) => {
|
||||
dispatch({
|
||||
type: Symbol.for('app fade'),
|
||||
data: true,
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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)">
|
||||
|
|
|
@ -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()
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import color from 'color'
|
||||
|
||||
export const msgToReal = msg => msg.replace(/</g, '<').replace(/\n/g, '<br />')
|
||||
export const msgToReal = (msg) => msg.replace(/</g, '<').replace(/\n/g, '<br />')
|
||||
|
||||
export const colorToCSS = colorInt => {
|
||||
if (colorInt === 0) {
|
||||
return '#fff'
|
||||
}
|
||||
export const colorToCSS = (colorInt) => {
|
||||
if (colorInt === 0) {
|
||||
return '#fff'
|
||||
}
|
||||
|
||||
return color(colorInt).hsl().string()
|
||||
return color(colorInt).hsl().string()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue