force rename all UI folders to it's alway lowercase

This commit is contained in:
41666 2019-03-11 02:56:26 -05:00
parent df2a27663b
commit dc3a65cfc4
26 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,21 @@
// @flow
import * as React from 'react'
import dynamic from 'next/dynamic'
import { type User } from './user'
type Props = {
user: ?User
}
const HeaderBarAuth = dynamic(() => import('../components/header/auth'))
const HeaderBarUnauth = dynamic(() => import('../components/header/unauth'))
const HeaderBar: React.StatelessFunctionalComponent<Props> = (props) => {
if (props.user == null) {
return <HeaderBarUnauth {...props} />
} else {
return <HeaderBarAuth {...props} />
}
}
export default HeaderBar

32
ui/containers/user.js Normal file
View file

@ -0,0 +1,32 @@
// @flow
import { namespaceConfig } from 'fast-redux'
export type User = {
id: string,
username: string,
discriminator: string,
avatar: string,
nicknameCache: {
[server: string]: string
}
}
export type UserState = {
currentUser: User | null,
userCache: {
[id: string]: User
}
}
const DEFAULT_STATE: UserState = {
currentUser: null,
userCache: {}
}
export const {
action, getState: getUserStore
} = namespaceConfig('userStore', DEFAULT_STATE)
export const getCurrentUser = () => async (dispatch: Function) => {
}