Commit 6095eb88 authored by 熊成伟's avatar 熊成伟

debug

parent 679fda2c
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
......
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/communicate.iml" filepath="$PROJECT_DIR$/.idea/communicate.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/create-react-app.iml" filepath="$PROJECT_DIR$/.idea/create-react-app.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `yarn start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `yarn test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `yarn build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `yarn build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
## `antd-mobile` with create-react-app demo
const { override, fixBabelImports } = require('customize-cra');
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd-mobile',
style: 'css',
}),
);
const { injectBabelPlugin, getLoader } = require('react-app-rewired');
const px2rem = require('postcss-px2rem')
const fileLoaderMatcher = function (rule) {
return rule.loader && rule.loader.indexOf(`file-loader`) != -1;
}
module.exports = function override(config, env) {
// babel-plugin-import
config = injectBabelPlugin(['import', {
libraryName: 'antd-mobile',
//style: 'css',
style: true, // use less for customized theme
}], config);
// customize theme
config.module.rules[1].oneOf.unshift(
{
test: /\.less$/,
use: [
require.resolve('style-loader'),
require.resolve('css-loader'),
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
px2rem({
remUnit: 37.5,
exclude: /node-modules/
}),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
],
flexbox: 'no-2009',
}),
],
},
},
{
loader: require.resolve('less-loader'),
options: {
// theme vars, also can use theme.js instead of this.
modifyVars: { "@brand-primary": "#1DA57A" },
},
},
]
}
);
// css-modules
config.module.rules[1].oneOf.unshift(
{
test: /\.css$/,
exclude: /node_modules|antd-mobile\.css/,
use: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
modules: true,
importLoaders: 1,
localIdentName: '[local]___[hash:base64:5]'
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
],
flexbox: 'no-2009',
}),
],
},
},
]
}
);
// file-loader exclude
let l = getLoader(config.module.rules, fileLoaderMatcher);
l.exclude.push(/\.less$/);
return config;
};
This diff is collapsed.
{
"name": "communicate",
"version": "0.1.0",
"version": "2.0.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"antd-mobile": "^2.3.3",
"history": "^4.10.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"antd-mobile": "^2.0.0",
"customize-cra": "^1.0.0",
"lib-flexible": "^0.3.2",
"postcss-px2rem": "^0.3.0",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1"
"react-scripts": "1.0.13"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"test": "react-app-rewired test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"babel-plugin-import": "^1.13.0",
"customize-cra": "^1.0.0",
"react-app-rewired": "^2.1.6"
"babel-plugin-import": "^1.2.0",
"classnames": "^2.2.6",
"css-loader": "^0.28.7",
"less": "^2.7.3",
"less-loader": "^4.0.5",
"postcss-flexbugs-fixes": "^4.2.1",
"postcss-loader": "^3.0.0",
"react-app-rewire-postcss": "^3.0.2",
"react-app-rewired": "^1.2.9",
"style-loader": "^1.2.1"
}
}
public/favicon.ico

3.08 KB | W: | H:

public/favicon.ico

3.78 KB | W: | H:

public/favicon.ico
public/favicon.ico
public/favicon.ico
public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- set `maximum-scale` for some compatibility issues -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<script src="https://as.alipayobjects.com/g/component/fastclick/1.0.6/fastclick.js"></script>
<script>
if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body);
}, false);
}
if(!window.Promise) {
document.writeln('<script src="https://as.alipayobjects.com/g/component/es6-promise/3.2.2/es6-promise.min.js"'+'>'+'<'+'/'+'script>');
}
</script>
<!--<meta name="theme-color" content="#000000">-->
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
......@@ -32,7 +22,28 @@
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
</body>
<script src="https://as.alipayobjects.com/g/component/fastclick/1.0.6/fastclick.js"></script>
<script>
if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body);
}, false);
}
if(!window.Promise) {
document.writeln('<script src="https://as.alipayobjects.com/g/component/es6-promise/3.2.2/es6-promise.min.js"'+'>'+'<'+'/'+'script>');
}
</script>
<!--<script>-->
<!--window.onload = function () {-->
<!--var load = document.body.clientHeight-->
<!--var view = document.getElementById('foot')-->
<!--view.style.height = load + 'px'-->
<!--}-->
<!--</script>-->
</html>
......@@ -5,17 +5,7 @@
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
"type": "image/png"
}
],
"start_url": ".",
......
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
import React from 'react';
import {Steps, WhiteSpace} from 'antd-mobile'
import {Steps, Icon} from 'antd-mobile'
const Step = Steps.Step;
const data = [{}, {current: true}, {}]
// const data = [{}, {current: true}, {}]
const Index = (props) => {
return (
<Steps direction={props.direction}>
<Step/>
<Step status="error" />
<Step icon={<div style={{width: 22, height: 22, borderRadius: '50%', background: 'gray'}}/>}/>
<Step icon={<div style={{width: 22, height: 22, borderRadius: '50%', background: 'gray'}}/>}/>
<Steps direction={props.direction} current={3}>
<Step icon={<Icon type="check-circle" size="xxs"/>} />
<Step icon={<Icon type="check-circle" size="xxs"/>}/>
<Step status="error" icon={<Icon type="check-circle" size="xxs"/>}/>
{/*<Step icon={<div style={{width: 17, height: 17, borderRadius: '50%', background: 'gray'}}/>}/>*/}
</Steps>
);
};
......
.step_success{
width: 16.7px;
height: 16.7px;
border-radius: 50%;
}
import React from 'react';
import Steps from '../Steps'
import './index.less'
const Index = () => {
return (
<div className="todo-card">
<div className="todo-title pos-aline">
<div className="pos-aline">
<div className="todo-tag pos-aline">
<img style={{width: 12, height: 12, marginRight: 4}} src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1591252471425&di=85236ae603ca74553adaca6e8c161a39&imgtype=0&src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fb912bf96dc19b3b23530ae2259b60eb6cf70083f6680b-H9l0ri_fw658"/>
收文管理
</div>
<p>《2020年上级党委文件7号》</p>
</div>
<span>img</span>
</div>
<div style={{marginTop: 27}}>
<p>当前状态:排版套头</p>
<p style={{marginTop: 15}}>更新时间:2020-05-26 17:51</p>
</div>
</div>
);
};
export default Index;
.todo-card{
padding: 10px 15px;
background:rgba(255,255,255,1);
border:0 solid rgba(38, 104, 255, 0.2);
border-radius:6px;
}
.todo-title{
justify-content: space-between;
}
.todo-tag{
line-height: 18px;
//width: 60px;
font-size: 9px;
padding: 0 5px;
background: #2087ED;
color: #ffffff;
border-radius:3px;
}
.pos-aline{
display: flex;
align-items: center;
}
import React from 'react';
import {Tabs, Icon} from 'antd-mobile'
import './index.less'
const tabs = [
{ title: '已读', sub: '1' },
{ title: '未读', sub: '2' },
]
const Index = () => {
return (
<div className="pos-line">
<div className="search-notice-box">
<Icon type="search" size="xs" className="search-svg"/>
<input className="top-search" placeholder="请输入关键字搜索" />
</div>
<div className="search-tab">
<Tabs
tabs={tabs}
initialPage={1}
onChange={(tab, index) => { console.log('onChange', index, tab); }}
/>
</div>
</div>
);
};
export default Index;
.search-notice-box{
width: 100%;
height: 43.5px;
margin-bottom: 2px;
display: flex;
align-items: center;
}
.search-svg{
position: absolute;
padding-left: 10px;
}
.top-search{
width: 100%;
height: 100%;
border:0 solid rgba(38, 104, 255, 0.2);
border-radius: 6px 6px 0 0;
padding: 0 0 0 40px;
}
.am-tabs-default-bar-tab-active{
color: #0185FB;
}
.am-tabs-default-bar-underline{
border: 1px #0185FB solid;
}
.search-tab{
width: 100%;
}
.pos-line{
display: flex;
flex-direction: column;
align-items: center;
}
.am-tabs-default-bar-top, .am-tabs-default-bar-bottom{
border-radius:0 0 6px 6px !important;
}
import React from 'react';
import {SearchBar, Icon} from 'antd-mobile'
import './index.less'
const Index = () => {
return (
<div className="search-box">
<Icon type="search" size="xs" className="search-svg"/>
{/*<SearchBar/>*/}
<input className="top-single-search" placeholder="请输入关键字搜索" />
</div>
);
};
export default Index;
.search-box{
width: 100%;
height: 42px;
display: flex;
align-items: center;
}
.search-svg{
position: absolute;
padding-left: 10px;
}
.top-single-search{
width: 100%;
height: 100%;
border:0 solid rgba(38, 104, 255, 0.2);
border-radius:6px;
padding: 0 0 0 40px;
}
import React from 'react';
import {Tabs, Icon} from 'antd-mobile'
import './index.less'
const tabs = [
{ title: '基本信息', sub: '1' },
{ title: '详情附件', sub: '2' },
{ title: '流转意见', sub: '3' },
{ title: '流程信息', sub: '4' },
]
const Index = () => {
return (
<div>
<Tabs
tabs={tabs}
initialPage={1}
onChange={(tab, index) => { console.log('onChange', index, tab); }}
/>
</div>
);
};
export default Index;
.am-tabs-default-bar-tab-active{
color: #0185FB;
}
.am-tabs-default-bar-underline{
border: 1px #0185FB solid;
}
.am-tabs-default-bar-top, .am-tabs-default-bar-bottom{
border-radius:0 0 6px 6px !important;
}
import React from 'react';
import './index.less'
const CardItem = (peops) => {
return (
<div className="card-item">
<div className="card-item-content">
<div className="card-item-content-img">
<img src={peops.data.icon} style={{ width: 35, height: 35 }} alt="" />
</div>
<div className="card-item-content-title">
{peops.data.text}
</div>
</div>
</div>
);
};
export default CardItem;
import React from 'react';
import {Grid} from 'antd-mobile'
import './index.less'
import CardItem from './CardItem'
const data = Array.from(new Array(7)).map((_val, i) => ({
icon: 'https://gw.alipayobjects.com/zos/rmsportal/nywPmnTAvTmLusPxHPSu.png',
text: `name${i}`,
}));
const Index = () => {
const empty = data.length % 3;
empty > 0 && data.push({}, {})
return (
<div>
<div className="work-card-title">
11111
</div>
<div className="work-card-body">
{data.map(item => (
<CardItem data={item}/>
))}
</div>
{/*<Grid*/}
{/*data={data}*/}
{/*columnNum={3}*/}
{/*renderItem={dataItem => (*/}
{/*<div style={{ padding: '12.5px' }}>*/}
{/*<img src={dataItem.icon} style={{ width: 35, height: 35 }} alt="" />*/}
{/*<div style={{ color: '#323232', fontSize: 13, marginTop: 18 }}>*/}
{/*收文管理*/}
{/*</div>*/}
{/*</div>*/}
{/*)}*/}
{/*/>*/}
</div>
);
};
export default Index;
.work-card-body{
display:flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
.card-item{
width: 33.33%;
position: relative;
}
.card-item-content{
padding: 26px 0;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
border: 1px salmon solid;
}
.card-item-content-img{
margin-bottom: 14px;
}
.card-item-content-title{
}
import React from 'react';
import {WhiteSpace} from 'antd-mobile'
import Step from '../../Components/Steps/index'
import TodoCard from '../../components/TodoCard'
import TopSearch from '../../components/TopSearch'
const Backlog = () => {
return (
<div>
<WhiteSpace/>
<Step direction="horizontal"/>
<TopSearch/>
<WhiteSpace/>
{
[{},{},{},{},{},{}].map(item => (
<div>
<WhiteSpace/>
<TodoCard/>
</div>
))
}
{/*<Step direction="horizontal"/>*/}
</div>
);
......
import React, {Component} from 'react';
import {List, WhiteSpace} from 'antd-mobile';
import TopSearch from '../../components/TopSearch'
const Item = List.Item;
class Communicate extends Component {
render() {
return (
<div>
<WhiteSpace/>
<TopSearch/>
<WhiteSpace/>
<List>
<Item>通讯录</Item>
<Item arrow="horizontal" multipleLine onClick={() => {}}>Title</Item>
</List>
</div>
);
}
}
export default Communicate;
import React from 'react';
import {WhiteSpace} from 'antd-mobile'
import TodoCard from '../../components/TodoCard'
import TopNotice from '../../components/TopNotice'
const Notice = () => {
return (
<div>
<WhiteSpace/>
<TopNotice/>
<WhiteSpace/>
<TodoCard/>
{/*<Step direction="horizontal"/>*/}
</div>
);
......
import React from 'react';
import {WhiteSpace} from "antd-mobile";
import TopSearch from '../../components/TopSearch'
import WorkCard from '../../components/WorkCard'
const Work = () => {
return (
<div>
<WhiteSpace/>
<TopSearch/>
<WhiteSpace/>
<WorkCard/>
</div>
);
};
......
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
html,
body,
#root {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
p{margin: 0}
......@@ -2,16 +2,8 @@ import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import ReactRouter from './router'
import * as serviceWorker from './serviceWorker';
import 'lib-flexible'
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(
<React.StrictMode>
<ReactRouter />
</React.StrictMode>,
document.getElementById('root')
);
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
ReactDOM.render(<ReactRouter />, document.getElementById('root'));
registerServiceWorker();
......@@ -5,10 +5,15 @@ import {withRouter} from 'react-router-dom'
const BlankLayout = (props) => {
return (
<div>
<WingBlank>
{props.children}
</WingBlank>
<div >
<div>
<div style={{position: 'fixed', top: 0, left: 0, right: 0, bottom: 50, overflow: 'auto', paddingBottom: 10}}>
<WingBlank>
{props.children}
</WingBlank>
</div>
<Footer {...props}/>
</div>
<Footer {...props}/>
</div>
);
......
......@@ -4,12 +4,13 @@ import Footer from './Footer'
import {withRouter} from 'react-router-dom'
const CommonLayout = (props) => {
console.log(props)
return (
<div>
<WingBlank>
{props.children}
</WingBlank>
<div style={{position: 'fixed', top: 0, left: 0, right: 0, bottom: 50, overflow: 'auto', paddingBottom: 10}}>
<WingBlank>
{props.children}
</WingBlank>
</div>
<Footer {...props}/>
</div>
);
......
import React, {useState, useEffect} from 'react';
import React, {Component} from 'react';
import {TabBar} from 'antd-mobile'
const Footer = (props) => {
const [current, setCurrent] = useState();
useEffect(() => {
const keysArray = props.location.pathname.replace(`${props.match.path}/`, '').split("/");
keysArray.length > 0 && setCurrent(keysArray[0])
}, [props]);
const tabItem = [
{title: '待办', key: 'backlog', icon: '', selectedIcon: '', badge: '', onPress: '/bord/backlog'},
{title: '工作', key: 'work', icon: '', selectedIcon: '', badge: '', onPress: '/bord/work'},
{title: '通知', key: 'notice', icon: '', selectedIcon: '', badge: '', onPress: '/bord/notice'}
];
const tabClick = (key, path) => {
setCurrent(key)
props.history.push(path)
class Footer extends Component {
state={
current: ''
}
componentDidMount() {
const keysArray = this.props.location.pathname.replace(`${this.props.match.path}/`, '').split("/");
keysArray.length > 0 && this.setState({current: keysArray[0]})
}
tabClick = (key, path) => {
this.setState({current: key})
this.props.history.push(path)
}
render() {
const tabItem = [
{title: '待办', key: 'backlog', icon: '', selectedIcon: '', badge: '', onPress: '/bord/backlog'},
{title: '工作', key: 'work', icon: '', selectedIcon: '', badge: '', onPress: '/bord/work'},
{title: '通讯录', key: 'communicate', icon: '', selectedIcon: '', badge: '', onPress: '/bord/communicate'},
{title: '通知', key: 'notice', icon: '', selectedIcon: '', badge: '', onPress: '/bord/notice'}
];
return (
<div style={{ position: 'fixed', height: '100%', width: '100%', top: 0 }}>
<TabBar
unselectedTintColor="#949494"
tintColor="#33A3F4"
barTintColor="white"
>
{tabItem.map(item => (
<TabBar.Item
key={item.key}
title={item.title}
icon={<div style={{
width: '22px',
height: '22px',
background: `url(https://zos.alipayobjects.com/rmsportal/sifuoDUQdAFKAVcFGROC.svg) center center / 22px 22px no-repeat`
}}/>}
selectedIcon={<div style={{
width: '22px',
height: '22px',
background: `url(https://zos.alipayobjects.com/rmsportal/sifuoDUQdAFKAVcFGROC.svg) center center / 22px 22px no-repeat`
}}/>}
badge={item.badge || null}
onPress={() => tabClick(item.key, item.onPress)}
selected={current === item.key}
/>
))}
</TabBar>
</div>
);
};
return (
<div style={{ position: 'fixed', width: '100%', bottom: 0 }}>
<TabBar
unselectedTintColor="#949494"
tintColor="#33A3F4"
barTintColor="white"
>
{tabItem.map(item => (
<TabBar.Item
key={item.key}
title={item.title}
icon={<div style={{
width: '22px',
height: '22px',
background: `url(https://zos.alipayobjects.com/rmsportal/sifuoDUQdAFKAVcFGROC.svg) center center / 22px 22px no-repeat`
}}/>}
selectedIcon={<div style={{
width: '22px',
height: '22px',
background: `url(https://zos.alipayobjects.com/rmsportal/sifuoDUQdAFKAVcFGROC.svg) center center / 22px 22px no-repeat`
}}/>}
badge={item.badge || null}
onPress={() => this.tabClick(item.key, item.onPress)}
selected={this.state.current === item.key}
/>
))}
</TabBar>
</div>
);
}
}
export default Footer;
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
<g fill="#61DAFB">
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
<circle cx="420.9" cy="296.5" r="45.7"/>
<path d="M520.5 78.1z"/>
</g>
</svg>
// This optional code is used to register a service worker.
// register() is not called by default.
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4.
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export function register(config) {
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
// serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA'
);
});
if (!isLocalhost) {
// Is not local host. Just register service worker
registerValidSW(swUrl);
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
// This is running on localhost. Lets check if a service worker still exists or not.
checkValidServiceWorker(swUrl);
}
});
}
}
function registerValidSW(swUrl, config) {
function registerValidSW(swUrl) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.');
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
......@@ -98,17 +72,14 @@ function registerValidSW(swUrl, config) {
});
}
function checkValidServiceWorker(swUrl, config) {
function checkValidServiceWorker(swUrl) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, {
headers: { 'Service-Worker': 'script' },
})
fetch(swUrl)
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
response.headers.get('content-type').indexOf('javascript') === -1
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
......@@ -118,7 +89,7 @@ function checkValidServiceWorker(swUrl, config) {
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
registerValidSW(swUrl);
}
})
.catch(() => {
......@@ -130,12 +101,8 @@ function checkValidServiceWorker(swUrl, config) {
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready
.then(registration => {
registration.unregister();
})
.catch(error => {
console.error(error.message);
});
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
......@@ -6,6 +6,7 @@ import CommonLayout from './layout/CommonLayout';
import Backlog from './Pages/Backlog/Backlog'
import Work from './Pages/Work/Work'
import Notice from './Pages/Notice/Notice'
import Communicate from './Pages/Communicate/Communicate'
import NoFound from './Pages/NoFound'
......@@ -19,6 +20,7 @@ const ReactRouter = () => {
<CommonLayout>
<Route path="/bord/backlog" component={Backlog}/>
<Route path="/bord/work" component={Work}/>
<Route path="/bord/communicate" component={Communicate}/>
<Route path="/bord/notice" component={Notice}/>
</CommonLayout>
}/>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment