Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"lint-staged": "^10.2.11",
"prettier": "^2.0.5",
"pretty-quick": "^2.0.1",
"react-styleguidist": "^11.0.8"
"react-styleguidist": "^11.1.8"
},
"resolutions": {
"is-promise": "2.1.0",
Expand Down
12 changes: 7 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { renderRoutes } from 'react-router-config';
import { Switch, BrowserRouter } from 'react-router-dom';
import getRoutes from './routes';

const App = () => (
<BrowserRouter>
<Switch>{renderRoutes(getRoutes({ isLoggedUser: true }))}</Switch>
</BrowserRouter>
);
const App = function () {
return (
<BrowserRouter>
<Switch>{renderRoutes(getRoutes({ isLoggedUser: true }))}</Switch>
</BrowserRouter>
);
};

export default App;
34 changes: 18 additions & 16 deletions src/components/skeleton/content/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ import PropTypes from 'prop-types';

const { Content: AntContent } = Layout;

const Content = ({ children, matchedRoutes }) => (
<AntContent style={{ margin: '0 16px' }}>
<Breadcrumb style={{ margin: '16px 16px 0px 16px' }}>
{matchedRoutes.map(({ route }, idx) => (
<Breadcrumb.Item key={route.path}>
{idx === matchedRoutes.length - 1 ? (
route.title
) : (
<Link to={route.path}>{route.title}</Link>
)}
</Breadcrumb.Item>
))}
</Breadcrumb>
<div style={{ padding: 16 }}>{children}</div>
</AntContent>
);
const Content = function ({ children, matchedRoutes }) {
return (
<AntContent style={{ margin: '0 16px' }}>
<Breadcrumb style={{ margin: '16px 16px 0px 16px' }}>
{matchedRoutes.map(({ route }, idx) => (
<Breadcrumb.Item key={route.path}>
{idx === matchedRoutes.length - 1 ? (
route.title
) : (
<Link to={route.path}>{route.title}</Link>
)}
</Breadcrumb.Item>
))}
</Breadcrumb>
<div style={{ padding: 16 }}>{children}</div>
</AntContent>
);
};

Content.propTypes = {
children: PropTypes.oneOfType([
Expand Down
6 changes: 3 additions & 3 deletions src/components/skeleton/footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import PropTypes from 'prop-types';

const { Footer: AntFooter } = Layout;

const Footer = ({ footer }) => (
<AntFooter style={{ textAlign: 'center' }}>{footer}</AntFooter>
);
const Footer = function ({ footer }) {
return <AntFooter style={{ textAlign: 'center' }}>{footer}</AntFooter>;
};

Footer.propTypes = {
footer: PropTypes.string.isRequired,
Expand Down
34 changes: 18 additions & 16 deletions src/components/skeleton/header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,25 @@ const avatarMenu = (
</Menu>
);

const Header = ({ isSiderCollapsed, onToggleSider }) => (
<AntHeader style={{ background: '#fff', padding: 0 }}>
<LegacyIcon
className="trigger"
type={isSiderCollapsed ? 'menu-unfold' : 'menu-fold'}
onClick={onToggleSider}
/>
<Dropdown overlay={avatarMenu} trigger={['click']}>
<Avatar
size="large"
shape="square"
className="avatar"
icon={<UserOutlined />}
const Header = function ({ isSiderCollapsed, onToggleSider }) {
return (
<AntHeader style={{ background: '#fff', padding: 0 }}>
<LegacyIcon
className="trigger"
type={isSiderCollapsed ? 'menu-unfold' : 'menu-fold'}
onClick={onToggleSider}
/>
</Dropdown>
</AntHeader>
);
<Dropdown overlay={avatarMenu} trigger={['click']}>
<Avatar
size="large"
shape="square"
className="avatar"
icon={<UserOutlined />}
/>
</Dropdown>
</AntHeader>
);
};

Header.propTypes = {
isSiderCollapsed: PropTypes.bool.isRequired,
Expand Down
2 changes: 1 addition & 1 deletion src/components/skeleton/layout/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import { Footer, Sider, Header, Content } from '..';
import * as menuTypes from '../../../routes/menuTypes';

const Layout = ({ route, location }) => {
const Layout = function ({ route, location }) {
const { routes } = route;
const { pathname } = location;
const children = renderRoutes(routes);
Expand Down
2 changes: 1 addition & 1 deletion src/components/skeleton/sider/Sider.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import './Sider.css';
const { Sider: AntSider } = Layout;
const { SubMenu, Item } = Menu;

const Sider = ({ isCollapsed, mainMenuRoutes, matchedRoutes }) => {
const Sider = function ({ isCollapsed, mainMenuRoutes, matchedRoutes }) {
const activeKeys = matchedRoutes.map((item) => item.route.name);

return (
Expand Down
8 changes: 4 additions & 4 deletions src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { Statistic, Card, Row, Col, Avatar, Button, Calendar } from 'antd';

const { Meta } = Card;

export default () => (
<>
export default function () {
return (
<Row gutter={16} style={{ marginBottom: 20 }}>
<Col span={4}>
<Card
Expand Down Expand Up @@ -68,5 +68,5 @@ export default () => (
</Card>
</Col>
</Row>
</>
);
);
}
4 changes: 2 additions & 2 deletions src/pages/UserSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Security from './user-configs/Security';

const { TabPane } = Tabs;

export default () => {
export default function () {
return (
<Card bodyStyle={{ paddingLeft: 0 }}>
<Tabs defaultActiveKey="1" tabPosition="left">
Expand All @@ -23,4 +23,4 @@ export default () => {
</Tabs>
</Card>
);
};
}
5 changes: 1 addition & 4 deletions src/routes/withHelmet.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ const withHelmet = (Component) => {
const routeComponent = ({ route, ...props }) => (
<>
<Helmet>
<link
rel="shortcut icon"
href={route.title || 'favicons/favicon-32x32.png'}
/>
<link rel="icon" href={route.title || 'favicons/favicon-32x32.png'} />
<title>{route.title}</title>
</Helmet>
<Component {...props} route={route} />
Expand Down
Loading