├── src
├── client
│ ├── styles
│ │ ├── theme.js
│ │ └── default.less
│ ├── images
│ │ ├── odrMdcn.png
│ │ ├── rflMdcn.png
│ │ ├── odrMdcn@2x.png
│ │ ├── odrMdcn@3x.png
│ │ ├── rflMdcn@2x.png
│ │ └── rflMdcn@3x.png
│ ├── components
│ │ ├── layouts
│ │ │ ├── header
│ │ │ │ ├── index.js
│ │ │ │ └── Header.js
│ │ │ └── footer
│ │ │ │ ├── index.js
│ │ │ │ └── Footer.js
│ │ ├── profile
│ │ │ └── index.js
│ │ ├── refill
│ │ │ └── index.js
│ │ ├── articles
│ │ │ └── index.js
│ │ ├── orders
│ │ │ ├── ordersActionTypes.js
│ │ │ ├── User.js
│ │ │ ├── Users.js
│ │ │ ├── ordersActions.js
│ │ │ ├── orderEpics.js
│ │ │ ├── index.js
│ │ │ ├── ordersReducer.js
│ │ │ └── Orders.js
│ │ └── Main.js
│ ├── NotFound.js
│ ├── App.test.js
│ ├── epics
│ │ └── index.js
│ ├── App.js
│ ├── reducers
│ │ └── index.js
│ ├── App.css
│ └── routes
│ │ └── web
│ │ ├── routes.js
│ │ └── index.js
├── index.css
├── shared
│ └── utils.js
├── index.js
├── logo.svg
└── registerServiceWorker.js
├── public
├── favicon.ico
├── manifest.json
└── index.html
├── .travis.yml
├── .idea
├── markdown-navigator
│ └── profiles_settings.xml
├── preferred-vcs.xml
└── markdown-navigator.xml
├── .flowconfig
├── config
├── jest
│ ├── fileTransform.js
│ └── cssTransform.js
├── polyfills.js
├── paths.js
├── env.js
├── webpackDevServer.config.js
├── webpack.config.dev.js
└── webpack.config.prod.js
├── .gitignore
├── scripts
├── test.js
├── start.js
└── build.js
├── config-overrides.js
├── package.json
└── README.md
/src/client/styles/theme.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lusan/antd-boilerplate/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | font-family: sans-serif;
5 | }
6 |
--------------------------------------------------------------------------------
/src/client/images/odrMdcn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lusan/antd-boilerplate/HEAD/src/client/images/odrMdcn.png
--------------------------------------------------------------------------------
/src/client/images/rflMdcn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lusan/antd-boilerplate/HEAD/src/client/images/rflMdcn.png
--------------------------------------------------------------------------------
/src/client/images/odrMdcn@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lusan/antd-boilerplate/HEAD/src/client/images/odrMdcn@2x.png
--------------------------------------------------------------------------------
/src/client/images/odrMdcn@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lusan/antd-boilerplate/HEAD/src/client/images/odrMdcn@3x.png
--------------------------------------------------------------------------------
/src/client/images/rflMdcn@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lusan/antd-boilerplate/HEAD/src/client/images/rflMdcn@2x.png
--------------------------------------------------------------------------------
/src/client/images/rflMdcn@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lusan/antd-boilerplate/HEAD/src/client/images/rflMdcn@3x.png
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 6
4 | - 7
5 | - 8
6 | cache:
7 | directories:
8 | - node_modules
9 |
--------------------------------------------------------------------------------
/.idea/markdown-navigator/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/shared/utils.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | // eslint-disable-next-line import/prefer-default-export
4 | export const isProd = process.env.NODE_ENV === 'production'
5 |
--------------------------------------------------------------------------------
/src/client/components/layouts/header/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import Header from './Header'
4 |
5 | const HeaderWrapper = props =>
6 |
7 | export default HeaderWrapper
8 |
--------------------------------------------------------------------------------
/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 | .*/node_modules/fbjs/.*
3 | .*/node_modules/config-chain/test/broken.json
4 | .*/node_modules/npmconf/test/.*
5 | [include]
6 |
7 | [libs]
8 |
9 | [lints]
10 |
11 | [options]
12 |
--------------------------------------------------------------------------------
/src/client/components/layouts/footer/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import Footer from './Footer'
4 |
5 | const FooterWrapper = props =>
6 |
7 | export default FooterWrapper
8 |
--------------------------------------------------------------------------------
/src/client/components/profile/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import { Text } from 'react-native'
4 |
5 | const ProfileWrapper = props => ProfileWrapper
6 |
7 | export default ProfileWrapper
8 |
--------------------------------------------------------------------------------
/src/client/components/refill/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import { Text } from 'react-native'
4 |
5 | const RefillMedicines = () => Refill Medicine
6 |
7 | export default RefillMedicines
8 |
--------------------------------------------------------------------------------
/src/client/components/articles/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import { Text } from 'react-native'
4 |
5 | const ArticlesWrapper = props => ArticlesWrapper
6 |
7 | export default ArticlesWrapper
8 |
--------------------------------------------------------------------------------
/src/client/NotFound.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import { View, Text } from 'react-native'
4 |
5 | const NotFound = () => (
6 |
7 | Not Found
8 |
9 | )
10 |
11 | export default NotFound
12 |
--------------------------------------------------------------------------------
/src/client/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom'
3 | import App from './App'
4 |
5 | it('renders without crashing', () => {
6 | const div = document.createElement('div')
7 | ReactDOM.render(, div)
8 | })
9 |
--------------------------------------------------------------------------------
/.idea/preferred-vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Git
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/client/components/orders/ordersActionTypes.js:
--------------------------------------------------------------------------------
1 | export const INCREASE_COUNT = 'INCREASE_COUNT'
2 | export const DECREASE_COUNT = 'DECREASE_COUNT'
3 |
4 | export const FETCH_USER = 'FETCH_USER'
5 | export const FETCH_USER_FULFILLED = 'FETCH_USER_FULFILLED'
6 |
--------------------------------------------------------------------------------
/src/client/components/orders/User.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export default function User (props) {
4 | return (
5 |
6 |
7 |
8 |
9 |
{props.name} ({props.login})
10 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/src/client/epics/index.js:
--------------------------------------------------------------------------------
1 | import { combineEpics } from 'redux-observable'
2 |
3 | import {
4 | increaseCount,
5 | decreaseCount,
6 | fetchUserEpic
7 | } from '../components/orders/orderEpics'
8 |
9 | const rootEpic = combineEpics(
10 | increaseCount,
11 | decreaseCount,
12 | fetchUserEpic
13 | )
14 |
15 | export default rootEpic
16 |
--------------------------------------------------------------------------------
/src/client/App.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | import React from 'react'
4 |
5 | import { View, Text } from 'react-native'
6 |
7 | import Main from './components/Main'
8 |
9 | import './App.css'
10 |
11 | const App = props => (
12 |
13 |
14 | {JSON.stringify(props.history)}
15 |
16 | )
17 |
18 | export default App
19 |
--------------------------------------------------------------------------------
/config/jest/fileTransform.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const path = require('path')
4 |
5 | // This is a custom Jest transformer turning file imports into filenames.
6 | // http://facebook.github.io/jest/docs/tutorial-webpack.html
7 |
8 | module.exports = {
9 | process (src, filename) {
10 | return `module.exports = ${JSON.stringify(path.basename(filename))};`
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 | .idea/
19 |
20 | npm-debug.log*
21 | yarn-debug.log*
22 | yarn-error.log*
23 |
--------------------------------------------------------------------------------
/config/jest/cssTransform.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | // This is a custom Jest transformer turning style imports into empty objects.
4 | // http://facebook.github.io/jest/docs/tutorial-webpack.html
5 |
6 | module.exports = {
7 | process () {
8 | return 'module.exports = {};'
9 | },
10 | getCacheKey () {
11 | // The output is always the same.
12 | return 'cssTransform'
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/client/components/layouts/header/Header.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | import { NavBar, Icon } from 'antd-mobile'
4 |
5 | const Header = props => (
6 | console.log('onLeftClick')}
10 | rightContent={[]}
11 | >
12 | redux-rx
13 |
14 | )
15 |
16 | export default Header
17 |
--------------------------------------------------------------------------------
/src/client/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux'
2 |
3 | import ordersReducer from '../components/orders/ordersReducer'
4 |
5 | const itemsState = {
6 | items: [
7 | {
8 | id: 1,
9 | name: 'item 1'
10 | }
11 | ]
12 | }
13 |
14 | const rootReducer = combineReducers({
15 | ordersState: ordersReducer,
16 | itemsState: itemsState.items
17 | })
18 |
19 | export default rootReducer
20 |
--------------------------------------------------------------------------------
/src/client/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | animation: App-logo-spin infinite 20s linear;
7 | height: 80px;
8 | }
9 |
10 | .App-header {
11 | background-color: #222;
12 | height: 150px;
13 | padding: 20px;
14 | color: white;
15 | }
16 |
17 | .App-title {
18 | font-size: 1.5em;
19 | }
20 |
21 | .App-intro {
22 | font-size: large;
23 | }
24 |
25 | @keyframes App-logo-spin {
26 | from {
27 | transform: rotate(0deg);
28 | }
29 | to {
30 | transform: rotate(360deg);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/config/polyfills.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | if (typeof Promise === 'undefined') {
4 | // Rejection tracking prevents a common issue where React gets into an
5 | // inconsistent state due to an error, but it gets swallowed by a Promise,
6 | // and the user has no idea what causes React's erratic future behavior.
7 | require('promise/lib/rejection-tracking').enable()
8 | window.Promise = require('promise/lib/es6-extensions.js')
9 | }
10 |
11 | // fetch() polyfill for making API calls.
12 | require('whatwg-fetch')
13 |
14 | // Object.assign() is commonly used with React.
15 | // It will use the native implementation if it's present and isn't buggy.
16 | Object.assign = require('object-assign')
17 |
--------------------------------------------------------------------------------
/scripts/test.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | // Do this as the first thing so that any code reading it knows the right env.
4 | process.env.BABEL_ENV = 'test'
5 | process.env.NODE_ENV = 'test'
6 | process.env.PUBLIC_URL = ''
7 |
8 | // Makes the script crash on unhandled rejections instead of silently
9 | // ignoring them. In the future, promise rejections that are not handled will
10 | // terminate the Node.js process with a non-zero exit code.
11 | process.on('unhandledRejection', err => {
12 | throw err
13 | })
14 |
15 | // Ensure environment variables are read.
16 | require('../config/env')
17 |
18 | const jest = require('jest')
19 | const argv = process.argv.slice(2)
20 |
21 | // Watch unless on CI or in coverage mode
22 | if (!process.env.CI && argv.indexOf('--coverage') < 0) {
23 | argv.push('--watch')
24 | }
25 |
26 | jest.run(argv)
27 |
--------------------------------------------------------------------------------
/src/client/components/orders/Users.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import User from './User'
4 |
5 | class Users extends Component {
6 | constructor (props) {
7 | super(props)
8 |
9 | this.loadUser = this.loadUser.bind(this)
10 | }
11 |
12 | loadUser (login) {
13 | this.props.fetchUserAction(login)
14 | }
15 |
16 | render () {
17 | return (
18 |
19 |
20 | {this.props.users.map(login =>
21 | -
22 | {login}
23 |
24 |
25 | )}
26 |
27 | {this.props.loading &&
Please wait!
}
28 | {this.props.current &&
}
29 |
30 | )
31 | }
32 | }
33 |
34 | export default Users
35 |
--------------------------------------------------------------------------------
/src/client/components/orders/ordersActions.js:
--------------------------------------------------------------------------------
1 | import {
2 | INCREASE_COUNT,
3 | DECREASE_COUNT,
4 | FETCH_USER,
5 | FETCH_USER_FULFILLED
6 | } from './ordersActionTypes'
7 |
8 | export function increaseCount (count) {
9 | console.log('increaseCount action')
10 | let orderCount = parseInt(count, 10) + 1
11 |
12 | return {
13 | type: INCREASE_COUNT,
14 | count: orderCount
15 | }
16 | }
17 |
18 | export function decreaseCount (count) {
19 | console.log('decreaseCount action')
20 | let orderCount = parseInt(count, 10) - 1
21 |
22 | return {
23 | type: DECREASE_COUNT,
24 | count: orderCount > 0 ? orderCount : 0
25 | }
26 | }
27 |
28 | export function fetchUserAction (login) {
29 | return {
30 | type: FETCH_USER,
31 | payload: login
32 | }
33 | }
34 |
35 | export function fetchUserFulfilledAction (user) {
36 | return {
37 | type: FETCH_USER_FULFILLED,
38 | payload: user
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/client/components/orders/orderEpics.js:
--------------------------------------------------------------------------------
1 | import { Observable } from 'rxjs'
2 | // import individual rxjs operators
3 | import 'rxjs/add/operator/do'
4 | import 'rxjs/add/operator/ignoreElements'
5 | import 'rxjs/add/operator/switchMap'
6 |
7 | import { fetchUserFulfilledAction } from './ordersActions'
8 |
9 | import {
10 | INCREASE_COUNT,
11 | DECREASE_COUNT,
12 | FETCH_USER
13 | } from './ordersActionTypes'
14 |
15 | export function increaseCount (action$) {
16 | return action$
17 | .ofType(INCREASE_COUNT)
18 | .do(action => console.log(action))
19 | .ignoreElements()
20 | }
21 |
22 | export function decreaseCount (action$) {
23 | return action$
24 | .ofType(DECREASE_COUNT)
25 | .do(action => console.log(action))
26 | .ignoreElements()
27 | }
28 |
29 | export function fetchUserEpic (action$) {
30 | return action$.ofType(FETCH_USER)
31 | .switchMap(({payload}) => {
32 | return Observable.ajax.getJSON(`https://api.github.com/users/${payload}`)
33 | .map(user => {
34 | return fetchUserFulfilledAction(user)
35 | })
36 | })
37 | }
38 |
--------------------------------------------------------------------------------
/src/client/components/orders/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { connect } from 'react-redux'
3 | import { bindActionCreators } from 'redux'
4 |
5 | import {
6 | increaseCount,
7 | decreaseCount,
8 | fetchUserAction
9 | } from './ordersActions'
10 |
11 | import { View } from 'react-native'
12 |
13 | import Orders from './Orders'
14 |
15 | const OrdersWrapper = props => (
16 |
17 |
23 |
24 | )
25 |
26 | function mapStateToProps (state) {
27 | return {
28 | ordersState: state.ordersState
29 | }
30 | }
31 |
32 | function matchDispatchToProps (dispatch) {
33 | return {
34 | actions: bindActionCreators({
35 | increaseCount: increaseCount,
36 | decreaseCount: decreaseCount,
37 | fetchUserAction: fetchUserAction
38 | }, dispatch)
39 | }
40 | }
41 |
42 | export default connect(mapStateToProps, matchDispatchToProps)(OrdersWrapper)
43 |
--------------------------------------------------------------------------------
/src/client/components/orders/ordersReducer.js:
--------------------------------------------------------------------------------
1 | import {
2 | INCREASE_COUNT,
3 | DECREASE_COUNT,
4 | FETCH_USER,
5 | FETCH_USER_FULFILLED
6 | } from './ordersActionTypes'
7 |
8 | const initialState = {
9 | ordersCount: 3,
10 | users: [
11 | 'lusan',
12 | 'jyoti',
13 | 'sachin',
14 | 'lakshita',
15 | 'ayushi'
16 | ],
17 | current: null,
18 | loading: false
19 | }
20 |
21 | function ordersReducer (state = initialState, action) {
22 | switch (action.type) {
23 | case INCREASE_COUNT:
24 | return {
25 | ...state,
26 | ordersCount: action.count
27 | }
28 |
29 | case DECREASE_COUNT:
30 | return {
31 | ...state,
32 | ordersCount: action.count
33 | }
34 |
35 | case FETCH_USER:
36 | return {
37 | ...state,
38 | current: null,
39 | loading: true
40 | }
41 |
42 | case FETCH_USER_FULFILLED:
43 | return {
44 | ...state,
45 | current: action.payload,
46 | loading: false
47 | }
48 |
49 | default:
50 | return state
51 | }
52 | }
53 |
54 | export default ordersReducer
55 |
--------------------------------------------------------------------------------
/src/client/routes/web/routes.js:
--------------------------------------------------------------------------------
1 | import App from '../../App'
2 | import HeaderWrapper from '../../components/layouts/header'
3 | import FooterWrapper from '../../components/layouts/footer'
4 | import OrdersWrapper from '../../components/orders'
5 | import RefillMedicines from '../../components/refill'
6 | import ArticlesWrapper from '../../components/articles'
7 | import ProfileWrapper from '../../components/profile'
8 | import NotFound from '../../NotFound'
9 |
10 | export const routes = [
11 | {
12 | path: '/',
13 | exact: true,
14 | header: HeaderWrapper,
15 | main: App,
16 | footer: FooterWrapper
17 | },
18 | {
19 | path: '/orders',
20 | header: HeaderWrapper,
21 | main: OrdersWrapper,
22 | footer: FooterWrapper
23 | },
24 | {
25 | path: '/refill-medicines',
26 | header: HeaderWrapper,
27 | main: RefillMedicines,
28 | footer: FooterWrapper
29 | },
30 | {
31 | path: '/articles',
32 | header: HeaderWrapper,
33 | main: ArticlesWrapper,
34 | footer: FooterWrapper
35 | },
36 | {
37 | path: '/profile',
38 | header: HeaderWrapper,
39 | main: ProfileWrapper,
40 | footer: FooterWrapper
41 | },
42 | {
43 | path: '/not',
44 | main: NotFound
45 | }
46 | ]
47 |
--------------------------------------------------------------------------------
/src/client/components/orders/Orders.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import { View, Text, Button } from 'react-native'
4 |
5 | import Users from './Users'
6 |
7 | class Orders extends Component {
8 | constructor (props) {
9 | super(props)
10 |
11 | this.switchFlag = false
12 |
13 | this.changeCount = this.changeCount.bind(this)
14 | }
15 |
16 | changeCount () {
17 | console.log('changing count')
18 | if (!this.switchFlag) {
19 | this.props.increaseCount(
20 | this.props.ordersState.ordersCount
21 | )
22 | this.switchFlag = true
23 | } else {
24 | this.props.decreaseCount(
25 | this.props.ordersState.ordersCount
26 | )
27 | this.switchFlag = false
28 | }
29 | }
30 |
31 | render () {
32 | return (
33 |
34 | Orders: {this.props.ordersState.ordersCount}
35 |
36 |
42 |
43 | )
44 | }
45 | }
46 |
47 | export default Orders
48 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom'
3 | import { BrowserRouter } from 'react-router-dom'
4 | import { createStore, applyMiddleware, compose } from 'redux'
5 | import { Provider } from 'react-redux'
6 | import { createEpicMiddleware } from 'redux-observable'
7 | import { offline } from 'redux-offline'
8 | import offlineConfig from 'redux-offline/lib/defaults'
9 |
10 | import rootEpic from './client/epics'
11 | import rootReducer from './client/reducers'
12 |
13 | import './index.css'
14 |
15 | import Routes from './client/routes/web'
16 |
17 | import registerServiceWorker from './registerServiceWorker'
18 |
19 | const epicMiddleware = createEpicMiddleware(rootEpic)
20 |
21 | const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
22 |
23 | // const store = createStore(
24 | // rootReducer,
25 | // composeEnhancers(
26 | // applyMiddleware(epicMiddleware)
27 | // )
28 | // )
29 |
30 | const store = offline(offlineConfig)(createStore)(rootReducer, composeEnhancers(applyMiddleware(epicMiddleware)))
31 |
32 | ReactDOM.render(
33 |
34 |
35 |
36 |
37 | ,
38 | document.getElementById('root')
39 | )
40 |
41 | registerServiceWorker()
42 |
--------------------------------------------------------------------------------
/src/client/components/Main.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import { Card, Flex } from 'antd-mobile'
4 | import { Text, Image, StyleSheet } from 'react-native'
5 |
6 | import order from '../images/odrMdcn@2x.png'
7 | import reOrder from '../images/rflMdcn@2x.png'
8 |
9 | const style = StyleSheet.create({
10 | image: {
11 | height: 60,
12 | resizeMode: 'contain',
13 | paddingBottom: 100
14 | }
15 | })
16 |
17 | class Main extends Component {
18 | constructor (props) {
19 | super(props)
20 |
21 | this.state = {
22 | selectedTab: 'redTab',
23 | hidden: false
24 | }
25 | }
26 |
27 | render () {
28 | return (
29 |
30 |
31 |
32 |
33 |
34 | Order
35 |
36 |
37 |
38 |
39 |
40 |
41 |
46 | Refill
47 |
48 |
49 |
50 |
51 | )
52 | }
53 | }
54 |
55 | export default Main
56 |
--------------------------------------------------------------------------------
/src/client/components/layouts/footer/Footer.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import { TabBar } from 'antd-mobile'
4 |
5 | import order from '../../../images/odrMdcn.png'
6 |
7 | class Footer extends Component {
8 | constructor (props) {
9 | super(props)
10 |
11 | this.navigatePath = this.navigatePath.bind(this)
12 | }
13 |
14 | navigatePath (path) {
15 | this.props.history.push(path)
16 | }
17 |
18 | render () {
19 | return (
20 |
25 | {
30 | this.navigatePath('/')
31 | }}
32 | />
33 |
34 | {
39 | this.navigatePath('/orders')
40 | }}
41 | />
42 |
43 | {
48 | this.navigatePath('/articles')
49 | }}
50 | />
51 |
52 | {
57 | this.navigatePath('/profile')
58 | }}
59 | />
60 |
61 | )
62 | }
63 | }
64 |
65 | export default Footer
66 |
--------------------------------------------------------------------------------
/src/client/routes/web/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Route, Switch } from 'react-router-dom'
3 |
4 | import { View } from 'react-native'
5 |
6 | import { routes } from './routes'
7 |
8 | const Routes = props => (
9 |
10 |
11 | {routes.map((route, index) => (
12 | // You can render a in as many places
13 | // as you want in your app. It will render along
14 | // with any other s that also match the URL.
15 | // So, a sidebar or breadcrumbs or anything else
16 | // that requires you to render multiple things
17 | // in multiple places at the same URL is nothing
18 | // more than multiple s.
19 |
25 | ))}
26 | {routes.map((route, index) => (
27 | // Render more s with the same paths as
28 | // above, but different components this time.
29 |
35 | ))}
36 | {routes.map((route, index) => (
37 | // Render more s with the same paths as
38 | // above, but different components this time.
39 |
45 | ))}
46 |
47 |
48 | )
49 |
50 | export default Routes
51 |
--------------------------------------------------------------------------------
/config/paths.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const path = require('path')
4 | const fs = require('fs')
5 | const url = require('url')
6 |
7 | // Make sure any symlinks in the project folder are resolved:
8 | // https://github.com/facebookincubator/create-react-app/issues/637
9 | const appDirectory = fs.realpathSync(process.cwd())
10 | const resolveApp = relativePath => path.resolve(appDirectory, relativePath)
11 |
12 | const envPublicUrl = process.env.PUBLIC_URL
13 |
14 | function ensureSlash (path, needsSlash) {
15 | const hasSlash = path.endsWith('/')
16 | if (hasSlash && !needsSlash) {
17 | return path.substr(path, path.length - 1)
18 | } else if (!hasSlash && needsSlash) {
19 | return `${path}/`
20 | } else {
21 | return path
22 | }
23 | }
24 |
25 | const getPublicUrl = appPackageJson =>
26 | envPublicUrl || require(appPackageJson).homepage
27 |
28 | // We use `PUBLIC_URL` environment variable or "homepage" field to infer
29 | // "public path" at which the app is served.
30 | // Webpack needs to know it to put the right
10 |
20 |
21 |
22 |
26 |
27 |
28 |
37 | My App
38 |
39 |
40 |
43 |
44 |
54 |
55 |