Skip to content

Commit

Permalink
examples
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Aug 2, 2017
1 parent d6757c8 commit 5eee917
Show file tree
Hide file tree
Showing 52 changed files with 243 additions and 381 deletions.
2 changes: 1 addition & 1 deletion components/Picker/StackPicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class PickerStack extends Component {
{
list.map((item, index) => (
<div
key={index}
key={+index}
className={
classnames({
[`${prefixCls}-stack-item`]: true,
Expand Down
24 changes: 4 additions & 20 deletions examples/components/App.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import React, { Component } from 'react';
import { Component, Children } from 'react';
// import Eruda from 'eruda';
// import Events from '../utils/events';

// page styles
import '../styles/core/index';
import '../styles/components/App';

// components styles
import '../../styles/index';
import '../styles/core/index'; // page styles
import '../../styles/index'; // components styles

class App extends Component {

Expand All @@ -17,19 +13,7 @@ class App extends Component {
}

render() {
return (
<div>
<div className="app-container">
{this.props.children}
</div>
<footer>
<div className="copyright">
<div className="copyright-cn">众安·体验设计中心</div>
<div className="copyright-en">Zhongan UX Densign</div>
</div>
</footer>
</div>
);
return this.props.children ? Children.only(this.props.children) : null;
}
}

Expand Down
23 changes: 23 additions & 0 deletions examples/components/Container.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { Component } from 'react';
import classnames from 'classnames';
import '../styles/components/Container';

class Container extends Component {

render() {
const { className, children } = this.props;

const cls = classnames({
'app-container': true,
[className]: !!className,
});

return (
<div className={cls} style={{ minHeight: window.screen.height }}>
{children}
</div>
);
}
}

export default Container;
20 changes: 20 additions & 0 deletions examples/components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React, { Component } from 'react';
import '../styles/components/Footer.scss';

class Footer extends Component {

render() {
const { title } = this.props;

return (
<footer>
<div className="copyright">
<div className="copyright-cn">众安·体验设计中心</div>
<div className="copyright-en">Zhongan UX Densign</div>
</div>
</footer>
);
}
}

export default Footer;
4 changes: 1 addition & 3 deletions examples/components/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ class Header extends Component {
const { title } = this.props;

return (
<header className="Header">
{title}
</header>
<header className="Header">{title}</header>
);
}
}
Expand Down
42 changes: 0 additions & 42 deletions examples/decorators/withContext.js

This file was deleted.

22 changes: 0 additions & 22 deletions examples/devServer.js

This file was deleted.

Binary file removed examples/images/logo.jpg
Binary file not shown.
Binary file removed examples/images/lottery/item1.png
Binary file not shown.
Binary file removed examples/images/lottery/item2.png
Binary file not shown.
Binary file removed examples/images/lottery/item3.png
Binary file not shown.
Binary file removed examples/images/lottery/item4.png
Binary file not shown.
Binary file removed examples/images/lottery/item5.png
Binary file not shown.
Binary file removed examples/images/lottery/item6.png
Binary file not shown.
Binary file removed examples/images/lottery/item7.png
Binary file not shown.
Binary file removed examples/images/lottery/item8.png
Binary file not shown.
Binary file removed examples/images/lottery/lottery-bg.png
Binary file not shown.
Binary file removed examples/images/lottery/pointer.png
Binary file not shown.
10 changes: 0 additions & 10 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,6 @@ const rootRoute = {
});
},
},

// 其他
// {
// path: 'lottery',
// getComponent(location, cb) {
// require.ensure([], (require) => {
// cb(null, require('./pages/LotteryPage'));
// });
// },
// },
{
path: '*',
getComponent(location, cb) {
Expand Down
7 changes: 5 additions & 2 deletions examples/pages/ActionSheetPage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { Component } from 'react';
import Container from '../components/Container';
import Header from '../components/Header';
import Footer from '../components/Footer';
import { Panel, Cell, ActionSheet, Button } from '../../components';

class Page extends Component {
Expand All @@ -20,7 +22,7 @@ class Page extends Component {

render() {
return (
<div className="actionsheet-page">
<Container className="actionsheet-page">
<Header title="动作面板 ActionSheet" />
<main>
<Panel>
Expand Down Expand Up @@ -77,7 +79,8 @@ class Page extends Component {
]}
/>
</main>
</div>
<Footer />
</Container>
);
}
}
Expand Down
7 changes: 5 additions & 2 deletions examples/pages/BadgePage.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React, { Component } from 'react';
import Container from '../components/Container';
import Header from '../components/Header';
import Footer from '../components/Footer';
import { Panel, Cell, Badge } from '../../components';
import '../styles/pages/BadgePage';

class Page extends Component {

render() {
return (
<div className="badge-page">
<Container className="badge-page">
<Header title="徽标 Badge" />
<main>
<Panel>
Expand Down Expand Up @@ -43,7 +45,8 @@ class Page extends Component {
</Panel>

</main>
</div>
<Footer />
</Container>
);
}
}
Expand Down
7 changes: 5 additions & 2 deletions examples/pages/ButtonPage.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React, { Component } from 'react';
import Container from '../components/Container';
import Header from '../components/Header';
import Footer from '../components/Footer';
import { Panel, Icon, Button } from '../../components';
import '../styles/pages/ButtonPage';

class Page extends Component {

render() {
return (
<div className="button-page">
<Container className="button-page">
<Header title="按钮 Button" />
<main>
<Panel>
Expand Down Expand Up @@ -86,7 +88,8 @@ class Page extends Component {
</Panel.Body>
</Panel>
</main>
</div>
<Footer />
</Container>
);
}
}
Expand Down
7 changes: 5 additions & 2 deletions examples/pages/CellPage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { Component } from 'react';
import Container from '../components/Container';
import Header from '../components/Header';
import Footer from '../components/Footer';
import { Panel, Icon, Cell } from '../../components';

const img = require('../images/icons/state.png');
Expand All @@ -8,7 +10,7 @@ class Page extends Component {

render() {
return (
<div className="cell-page">
<Container className="cell-page">
<Header title="列表项 Cell" />
<main>
<Panel>
Expand Down Expand Up @@ -82,7 +84,8 @@ class Page extends Component {
</Panel.Body>
</Panel>
</main>
</div>
<Footer />
</Container>
);
}
}
Expand Down
7 changes: 5 additions & 2 deletions examples/pages/CheckboxPage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { PureComponent } from 'react';
import Container from '../components/Container';
import Header from '../components/Header';
import Footer from '../components/Footer';
import { Panel, Cell, Checkbox } from '../../components';

class Page extends PureComponent {
Expand All @@ -13,7 +15,7 @@ class Page extends PureComponent {

render() {
return (
<div className="checkbox-page">
<Container className="checkbox-page">
<Header title="复选框 Checkbox" />
<main>
<Panel>
Expand Down Expand Up @@ -139,7 +141,8 @@ class Page extends PureComponent {
</Panel.Body>
</Panel>
</main>
</div>
<Footer />
</Container>
);
}
}
Expand Down
9 changes: 6 additions & 3 deletions examples/pages/IconPage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { Component } from 'react';
import Container from '../components/Container';
import Header from '../components/Header';
import Footer from '../components/Footer';
import { Panel, Icon } from '../../components';
import '../styles/pages/IconPage';

Expand All @@ -20,7 +22,7 @@ class Page extends Component {

render() {
return (
<div className="icon-page">
<Container className="icon-page">
<Header title="图标 Icon" />
<main>
<Panel>
Expand All @@ -32,7 +34,7 @@ class Page extends Component {
{
ICONS.sort().map((icon, i) => {
return (
<div className="grid-column" key={i}>
<div className="grid-column" key={+i}>
<Icon theme="primary" type={icon} />
<span className="icon-name">{icon}</span>
</div>
Expand All @@ -43,7 +45,8 @@ class Page extends Component {
</Panel.Body>
</Panel>
</main>
</div>
<Footer />
</Container>
);
}
}
Expand Down
17 changes: 5 additions & 12 deletions examples/pages/Index.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React, { PureComponent } from 'react';
import { hashHistory } from 'react-router';
import Container from '../components/Container';
import Footer from '../components/Footer';
import { Panel, Cell } from '../../components';
import '../styles/pages/IndexPage';

class Page extends PureComponent {

render() {
return (
<div className="index-page">
<Container className="index-page">
<header>
<section className="brand">
<div className="brand-title">Zarm UI</div>
Expand Down Expand Up @@ -57,18 +59,9 @@ class Page extends PureComponent {
<Cell hasArrow title="标签页 Tab" onClick={() => hashHistory.push('/tab')} />
</Panel.Body>
</Panel>
{
// <Panel>
// <Panel.Header>
// <Panel.Title>基础组件</Panel.Title>
// </Panel.Header>
// <Panel.Body>
// <Cell hasArrow title="大转盘 Lottery" onClick={() => hashHistory.push('/lottery')} />
// </Panel.Body>
// </Panel>
}
</main>
</div>
<Footer />
</Container>
);
}
}
Expand Down
Loading

0 comments on commit 5eee917

Please sign in to comment.