Package of overFlow has been changed.
This commit is contained in:
0
src/ts/@overflow/app/api/service.ts
Normal file
0
src/ts/@overflow/app/api/service.ts
Normal file
54
src/ts/@overflow/app/index.tsx
Normal file
54
src/ts/@overflow/app/index.tsx
Normal file
@@ -0,0 +1,54 @@
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
import { fork } from 'redux-saga/effects';
|
||||
|
||||
import { Provider } from 'react-redux';
|
||||
import { ConnectedRouter } from 'react-router-redux';
|
||||
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
|
||||
import * as injectTapEventPlugin from 'react-tap-event-plugin';
|
||||
|
||||
import Platform from '@overflow/commons/platform';
|
||||
import { store, sagaMiddleware, history } from './redux/store';
|
||||
|
||||
import sagas from './redux/saga';
|
||||
import muiTheme from './theme/mui';
|
||||
|
||||
import App from './views/App';
|
||||
|
||||
injectTapEventPlugin();
|
||||
|
||||
|
||||
function* app(): any {
|
||||
const appContainer: HTMLElement = yield Platform.getAppContainer('react-placeholder');
|
||||
|
||||
|
||||
|
||||
ReactDOM.render(
|
||||
<div style={{
|
||||
width: '100vw',
|
||||
height: '100vh',
|
||||
backgroundColor: 'white',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}>
|
||||
<h1>Loading...</h1>
|
||||
</div>,
|
||||
appContainer,
|
||||
);
|
||||
|
||||
sagaMiddleware.run(sagas);
|
||||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
<ConnectedRouter history={history}>
|
||||
<MuiThemeProvider muiTheme={muiTheme}>
|
||||
<App/>
|
||||
</MuiThemeProvider>
|
||||
</ConnectedRouter>
|
||||
</Provider>,
|
||||
appContainer,
|
||||
);
|
||||
}
|
||||
|
||||
sagaMiddleware.run(app);
|
||||
14
src/ts/@overflow/app/redux/reducer/index.ts
Normal file
14
src/ts/@overflow/app/redux/reducer/index.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Action, combineReducers } from 'redux';
|
||||
import State from '../state';
|
||||
|
||||
import { reducer as signinReducer} from '@overflow/member/redux/reducer/signin';
|
||||
import { reducer as signoutReducer} from '@overflow/member/redux/reducer/signout';
|
||||
import { reducer as signupReducer} from '@overflow/member/redux/reducer/signup';
|
||||
|
||||
const reducer = combineReducers<State>({
|
||||
signinReducer,
|
||||
signoutReducer,
|
||||
signupReducer,
|
||||
});
|
||||
|
||||
export default reducer;
|
||||
8
src/ts/@overflow/app/redux/saga/index.ts
Normal file
8
src/ts/@overflow/app/redux/saga/index.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { SagaIterator } from 'redux-saga';
|
||||
import { fork } from 'redux-saga/effects';
|
||||
|
||||
import { watchSignin as memberWatchSignin } from '@overflow/member/redux/saga/signin';
|
||||
|
||||
export default function* sagas(): SagaIterator {
|
||||
yield fork(memberWatchSignin);
|
||||
}
|
||||
5
src/ts/@overflow/app/redux/state/index.ts
Normal file
5
src/ts/@overflow/app/redux/state/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
interface State {
|
||||
|
||||
}
|
||||
|
||||
export default State;
|
||||
23
src/ts/@overflow/app/redux/store.ts
Normal file
23
src/ts/@overflow/app/redux/store.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { applyMiddleware, compose, createStore, Store } from 'redux';
|
||||
import { routerMiddleware } from 'react-router-redux';
|
||||
import createSagaMiddleware, { SagaMiddleware } from 'redux-saga';
|
||||
import { History } from 'history';
|
||||
import { createHashHistory } from 'history';
|
||||
|
||||
import reducer from './reducer';
|
||||
import State from './state';
|
||||
|
||||
const history = createHashHistory();
|
||||
const sagaMiddleware: SagaMiddleware<any> = createSagaMiddleware();
|
||||
const middlewares = [sagaMiddleware, routerMiddleware(history)];
|
||||
|
||||
const store: Store<State> = createStore<State>(
|
||||
reducer,
|
||||
applyMiddleware(...middlewares),
|
||||
);
|
||||
|
||||
export {
|
||||
history,
|
||||
sagaMiddleware,
|
||||
store,
|
||||
};
|
||||
0
src/ts/@overflow/app/router/index.tsx
Normal file
0
src/ts/@overflow/app/router/index.tsx
Normal file
25
src/ts/@overflow/app/theme/mui.ts
Normal file
25
src/ts/@overflow/app/theme/mui.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { colors, getMuiTheme, MuiTheme, spacing } from 'material-ui/styles';
|
||||
import { fade } from 'material-ui/utils/colorManipulator';
|
||||
|
||||
const muiTheme:MuiTheme = getMuiTheme({
|
||||
spacing: spacing,
|
||||
fontFamily: 'Roboto, sans-serif',
|
||||
palette: {
|
||||
primary1Color: colors.cyan500,
|
||||
primary2Color: colors.cyan700,
|
||||
primary3Color: colors.grey400,
|
||||
accent1Color: colors.pinkA200,
|
||||
accent2Color: colors.grey100,
|
||||
accent3Color: colors.grey500,
|
||||
textColor: colors.darkBlack,
|
||||
alternateTextColor: colors.white,
|
||||
canvasColor: colors.white,
|
||||
borderColor: colors.grey300,
|
||||
disabledColor: fade(colors.darkBlack, 0.3),
|
||||
pickerHeaderColor: colors.cyan500,
|
||||
clockCircleColor: fade(colors.darkBlack, 0.07),
|
||||
shadowColor: colors.fullBlack,
|
||||
},
|
||||
});
|
||||
|
||||
export default muiTheme;
|
||||
27
src/ts/@overflow/app/views/App.tsx
Normal file
27
src/ts/@overflow/app/views/App.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
import { Route } from 'react-router-dom';
|
||||
import { RouteComponentProps, Switch } from 'react-router';
|
||||
|
||||
export interface Props {
|
||||
|
||||
}
|
||||
|
||||
export interface State {
|
||||
|
||||
}
|
||||
|
||||
export default class App extends React.Component<Props, State> {
|
||||
public constructor(props: Props, context: State) {
|
||||
super(props, context);
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
|
||||
return (
|
||||
<Switch>
|
||||
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
}
|
||||
14
src/ts/@overflow/app/views/member/Signin.tsx
Normal file
14
src/ts/@overflow/app/views/member/Signin.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import { RouteComponentProps } from 'react-router';
|
||||
import SigninContainer from '@overflow/member/react/Signin';
|
||||
|
||||
class Signin extends React.Component<RouteComponentProps<object>, object> {
|
||||
public render(): JSX.Element {
|
||||
return (
|
||||
<SigninContainer/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default Signin;
|
||||
Reference in New Issue
Block a user