提交 ec5087fb20f8ab737b9159b72419269841f3495d

作者 愚道
1 个父辈 70b9d7aa

update block name in package.json

1 1 {
2   - "name": "@umi-block/accountcenter",
  2 + "name": "@umi-block/account-center",
3 3 "version": "0.0.1",
4 4 "description": "AccountCenter",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/accountsettings",
  2 + "name": "@umi-block/account-settings",
3 3 "version": "0.0.1",
4 4 "description": "AccountSettings",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/advancedform",
  2 + "name": "@umi-block/advanced-form",
3 3 "version": "0.0.1",
4 4 "description": "AdvancedForm",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/advancedprofile",
  2 + "name": "@umi-block/advanced-profile",
3 3 "version": "0.0.1",
4 4 "description": "AdvancedProfile",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/basicform",
  2 + "name": "@umi-block/basic-form",
3 3 "version": "0.0.1",
4 4 "description": "BasicForm",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/basiclist",
  2 + "name": "@umi-block/basic-list",
3 3 "version": "0.0.1",
4 4 "description": "BasicList",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/basicprofile",
  2 + "name": "@umi-block/basic-profile",
3 3 "version": "0.0.1",
4 4 "description": "BasicProfile",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/cardlist",
  2 + "name": "@umi-block/card-list",
3 3 "version": "0.0.1",
4 4 "description": "CardList",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/exception403",
  2 + "name": "@umi-block/exception-403",
3 3 "version": "0.0.1",
4 4 "description": "Exception403",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/exception404",
  2 + "name": "@umi-block/exception-404",
3 3 "version": "0.0.1",
4 4 "description": "Exception404",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/exception500",
  2 + "name": "@umi-block/exception-500",
3 3 "version": "0.0.1",
4 4 "description": "Exception500",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/resultfail",
  2 + "name": "@umi-block/result-fail",
3 3 "version": "0.0.1",
4 4 "description": "ResultFail",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/resultsuccess",
  2 + "name": "@umi-block/result-success",
3 3 "version": "0.0.1",
4 4 "description": "ResultSuccess",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/searchlist",
  2 + "name": "@umi-block/search-list",
3 3 "version": "0.0.1",
4 4 "description": "SearchList",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/searchlistapplications",
  2 + "name": "@umi-block/search-list-applications",
3 3 "version": "0.0.1",
4 4 "description": "SearchListApplications",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/searchlistarticles",
  2 + "name": "@umi-block/search-list-articles",
3 3 "version": "0.0.1",
4 4 "description": "SearchListArticles",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/searchlistprojects",
  2 + "name": "@umi-block/search-list-projects",
3 3 "version": "0.0.1",
4 4 "description": "SearchListProjects",
5 5 "main": "src/index.js",
... ...
1 1 {
2   - "name": "@umi-block/tablelist",
  2 + "name": "@umi-block/table-list",
3 3 "version": "0.0.1",
4 4 "description": "TableList",
5 5 "main": "src/index.js",
... ...
1 1 export default {
2 2 plugins: [
3   - ['umi-plugin-block-dev', {}],
4   - ['umi-plugin-react', {
5   - dva: true,
6   - locale: true,
7   - antd: true,
8   - }],
  3 + [
  4 + 'umi-plugin-block-dev',
  5 + {
  6 + layout: 'ant-design-pro-user',
  7 + },
  8 + ],
  9 + [
  10 + 'umi-plugin-react',
  11 + {
  12 + dva: true,
  13 + locale: true,
  14 + antd: true,
  15 + },
  16 + ],
9 17 ],
10 18 };
... ...
1 1 {
2   - "name": "@umi-block/userregisterresult",
  2 + "name": "@umi-block/user-register-result",
3 3 "version": "0.0.1",
4 4 "description": "UserRegisterResult",
5 5 "main": "src/index.js",
... ...
1   -import React, { PureComponent } from 'react';
2   -import { Dropdown } from 'antd';
3   -import classNames from 'classnames';
4   -import styles from './index.less';
5   -
6   -export default class HeaderDropdown extends PureComponent {
7   - render() {
8   - const { overlayClassName, ...props } = this.props;
9   - return (
10   - <Dropdown overlayClassName={classNames(styles.container, overlayClassName)} {...props} />
11   - );
12   - }
13   -}
1   -@import '~antd/lib/style/themes/default.less';
2   -
3   -.container > *:global(:not(.ant-dropdown-menu)) {
4   - background-color: #fff;
5   - box-shadow: @shadow-1-down;
6   - border-radius: 4px;
7   -}
8   -
9   -@media screen and (max-width: @screen-xs) {
10   - .container {
11   - width: 100% !important;
12   - }
13   - .container > * {
14   - border-radius: 0 !important;
15   - }
16   -}
1   -import React, { PureComponent } from 'react';
2   -import { formatMessage, setLocale, getLocale } from 'umi/locale';
3   -import { Menu, Icon } from 'antd';
4   -import classNames from 'classnames';
5   -import HeaderDropdown from '../HeaderDropdown';
6   -import styles from './index.less';
7   -
8   -export default class SelectLang extends PureComponent {
9   - changeLang = ({ key }) => {
10   - setLocale(key);
11   - };
12   -
13   - render() {
14   - const { className } = this.props;
15   - const selectedLang = getLocale();
16   - const langMenu = (
17   - <Menu className={styles.menu} selectedKeys={[selectedLang]} onClick={this.changeLang}>
18   - <Menu.Item key="zh-CN">
19   - <span role="img" aria-label="简体中文">
20   - 🇨🇳
21   - </span>{' '}
22   - 简体中文
23   - </Menu.Item>
24   - <Menu.Item key="zh-TW">
25   - <span role="img" aria-label="繁体中文">
26   - 🇭🇰
27   - </span>{' '}
28   - 繁体中文
29   - </Menu.Item>
30   - <Menu.Item key="en-US">
31   - <span role="img" aria-label="English">
32   - 🇬🇧
33   - </span>{' '}
34   - English
35   - </Menu.Item>
36   - <Menu.Item key="pt-BR">
37   - <span role="img" aria-label="Português">
38   - 🇵🇹
39   - </span>{' '}
40   - Português
41   - </Menu.Item>
42   - </Menu>
43   - );
44   - return (
45   - <HeaderDropdown overlay={langMenu} placement="bottomRight">
46   - <span className={classNames(styles.dropDown, className)}>
47   - <Icon type="global" title={formatMessage({ id: 'navBar.lang' })} />
48   - </span>
49   - </HeaderDropdown>
50   - );
51   - }
52   -}
1   -@import '~antd/lib/style/themes/default.less';
2   -
3   -.menu {
4   - :global(.anticon) {
5   - margin-right: 8px;
6   - }
7   - :global(.ant-dropdown-menu-item) {
8   - min-width: 160px;
9   - }
10   -}
11   -
12   -.dropDown {
13   - cursor: pointer;
14   - vertical-align: top;
15   - line-height: @layout-header-height;
16   - > i {
17   - font-size: 14px !important;
18   - transform: none !important;
19   - svg {
20   - position: relative;
21   - top: -1px;
22   - }
23   - }
24   -}
1   -import React, { Fragment } from 'react';
2   -import { formatMessage } from 'umi/locale';
3   -import Link from 'umi/link';
4   -import { Icon } from 'antd';
5   -import { GlobalFooter } from 'ant-design-pro';
6   -import SelectLang from '../SelectLang';
7   -import styles from './index.less';
8   -import logo from './logo.svg';
9   -
10   -const links = [
11   - {
12   - key: 'help',
13   - title: formatMessage({ id: 'layout.user.link.help' }),
14   - href: '',
15   - },
16   - {
17   - key: 'privacy',
18   - title: formatMessage({ id: 'layout.user.link.privacy' }),
19   - href: '',
20   - },
21   - {
22   - key: 'terms',
23   - title: formatMessage({ id: 'layout.user.link.terms' }),
24   - href: '',
25   - },
26   -];
27   -
28   -const copyright = (
29   - <Fragment>
30   - Copyright <Icon type="copyright" /> 2018 蚂蚁金服体验技术部出品
31   - </Fragment>
32   -);
33   -
34   -class UserLayout extends React.PureComponent {
35   - // @TODO title
36   - // getPageTitle() {
37   - // const { routerData, location } = this.props;
38   - // const { pathname } = location;
39   - // let title = 'Ant Design Pro';
40   - // if (routerData[pathname] && routerData[pathname].name) {
41   - // title = `${routerData[pathname].name} - Ant Design Pro`;
42   - // }
43   - // return title;
44   - // }
45   -
46   - render() {
47   - const { children } = this.props;
48   - return (
49   - // @TODO <DocumentTitle title={this.getPageTitle()}>
50   - <div className={styles.container}>
51   - <div className={styles.lang}>
52   - <SelectLang />
53   - </div>
54   - <div className={styles.content}>
55   - <div className={styles.top}>
56   - <div className={styles.header}>
57   - <Link to="/">
58   - <img alt="logo" className={styles.logo} src={logo} />
59   - <span className={styles.title}>Ant Design</span>
60   - </Link>
61   - </div>
62   - <div className={styles.desc}>Ant Design 是西湖区最具影响力的 Web 设计规范</div>
63   - </div>
64   - {children}
65   - </div>
66   - <GlobalFooter links={links} copyright={copyright} />
67   - </div>
68   - );
69   - }
70   -}
71   -
72   -export default UserLayout;
1   -@import '~antd/lib/style/themes/default.less';
2   -
3   -.container {
4   - display: flex;
5   - flex-direction: column;
6   - height: 100vh;
7   - overflow: auto;
8   - background: @layout-body-background;
9   -}
10   -
11   -.lang {
12   - text-align: right;
13   - width: 100%;
14   - height: 40px;
15   - line-height: 44px;
16   - :global(.ant-dropdown-trigger) {
17   - margin-right: 24px;
18   - }
19   -}
20   -
21   -.content {
22   - padding: 32px 0;
23   - flex: 1;
24   -}
25   -
26   -@media (min-width: @screen-md-min) {
27   - .container {
28   - background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
29   - background-repeat: no-repeat;
30   - background-position: center 110px;
31   - background-size: 100%;
32   - }
33   -
34   - .content {
35   - padding: 32px 0 24px 0;
36   - }
37   -}
38   -
39   -.top {
40   - text-align: center;
41   -}
42   -
43   -.header {
44   - height: 44px;
45   - line-height: 44px;
46   - a {
47   - text-decoration: none;
48   - }
49   -}
50   -
51   -.logo {
52   - height: 44px;
53   - vertical-align: top;
54   - margin-right: 16px;
55   -}
56   -
57   -.title {
58   - font-size: 33px;
59   - color: @heading-color;
60   - font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
61   - font-weight: 600;
62   - position: relative;
63   - top: 2px;
64   -}
65   -
66   -.desc {
67   - font-size: @font-size-base;
68   - color: @text-color-secondary;
69   - margin-top: 12px;
70   - margin-bottom: 40px;
71   -}
1   -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2   -<svg width="200px" height="200px" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3   - <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch -->
4   - <title>Group 28 Copy 5</title>
5   - <desc>Created with Sketch.</desc>
6   - <defs>
7   - <linearGradient x1="62.1023273%" y1="0%" x2="108.19718%" y2="37.8635764%" id="linearGradient-1">
8   - <stop stop-color="#4285EB" offset="0%"></stop>
9   - <stop stop-color="#2EC7FF" offset="100%"></stop>
10   - </linearGradient>
11   - <linearGradient x1="69.644116%" y1="0%" x2="54.0428975%" y2="108.456714%" id="linearGradient-2">
12   - <stop stop-color="#29CDFF" offset="0%"></stop>
13   - <stop stop-color="#148EFF" offset="37.8600687%"></stop>
14   - <stop stop-color="#0A60FF" offset="100%"></stop>
15   - </linearGradient>
16   - <linearGradient x1="69.6908165%" y1="-12.9743587%" x2="16.7228981%" y2="117.391248%" id="linearGradient-3">
17   - <stop stop-color="#FA816E" offset="0%"></stop>
18   - <stop stop-color="#F74A5C" offset="41.472606%"></stop>
19   - <stop stop-color="#F51D2C" offset="100%"></stop>
20   - </linearGradient>
21   - <linearGradient x1="68.1279872%" y1="-35.6905737%" x2="30.4400914%" y2="114.942679%" id="linearGradient-4">
22   - <stop stop-color="#FA8E7D" offset="0%"></stop>
23   - <stop stop-color="#F74A5C" offset="51.2635191%"></stop>
24   - <stop stop-color="#F51D2C" offset="100%"></stop>
25   - </linearGradient>
26   - </defs>
27   - <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
28   - <g id="logo" transform="translate(-20.000000, -20.000000)">
29   - <g id="Group-28-Copy-5" transform="translate(20.000000, 20.000000)">
30   - <g id="Group-27-Copy-3">
31   - <g id="Group-25" fill-rule="nonzero">
32   - <g id="2">
33   - <path d="M91.5880863,4.17652823 L4.17996544,91.5127728 C-0.519240605,96.2081146 -0.519240605,103.791885 4.17996544,108.487227 L91.5880863,195.823472 C96.2872923,200.518814 103.877304,200.518814 108.57651,195.823472 L145.225487,159.204632 C149.433969,154.999611 149.433969,148.181924 145.225487,143.976903 C141.017005,139.771881 134.193707,139.771881 129.985225,143.976903 L102.20193,171.737352 C101.032305,172.906015 99.2571609,172.906015 98.0875359,171.737352 L28.285908,101.993122 C27.1162831,100.824459 27.1162831,99.050775 28.285908,97.8821118 L98.0875359,28.1378823 C99.2571609,26.9692191 101.032305,26.9692191 102.20193,28.1378823 L129.985225,55.8983314 C134.193707,60.1033528 141.017005,60.1033528 145.225487,55.8983314 C149.433969,51.69331 149.433969,44.8756232 145.225487,40.6706018 L108.58055,4.05574592 C103.862049,-0.537986846 96.2692618,-0.500797906 91.5880863,4.17652823 Z" id="Shape" fill="url(#linearGradient-1)"></path>
34   - <path d="M91.5880863,4.17652823 L4.17996544,91.5127728 C-0.519240605,96.2081146 -0.519240605,103.791885 4.17996544,108.487227 L91.5880863,195.823472 C96.2872923,200.518814 103.877304,200.518814 108.57651,195.823472 L145.225487,159.204632 C149.433969,154.999611 149.433969,148.181924 145.225487,143.976903 C141.017005,139.771881 134.193707,139.771881 129.985225,143.976903 L102.20193,171.737352 C101.032305,172.906015 99.2571609,172.906015 98.0875359,171.737352 L28.285908,101.993122 C27.1162831,100.824459 27.1162831,99.050775 28.285908,97.8821118 L98.0875359,28.1378823 C100.999864,25.6271836 105.751642,20.541824 112.729652,19.3524487 C117.915585,18.4685261 123.585219,20.4140239 129.738554,25.1889424 C125.624663,21.0784292 118.571995,14.0340304 108.58055,4.05574592 C103.862049,-0.537986846 96.2692618,-0.500797906 91.5880863,4.17652823 Z" id="Shape" fill="url(#linearGradient-2)"></path>
35   - </g>
36   - <path d="M153.685633,135.854579 C157.894115,140.0596 164.717412,140.0596 168.925894,135.854579 L195.959977,108.842726 C200.659183,104.147384 200.659183,96.5636133 195.960527,91.8688194 L168.690777,64.7181159 C164.472332,60.5180858 157.646868,60.5241425 153.435895,64.7316526 C149.227413,68.936674 149.227413,75.7543607 153.435895,79.9593821 L171.854035,98.3623765 C173.02366,99.5310396 173.02366,101.304724 171.854035,102.473387 L153.685633,120.626849 C149.47715,124.83187 149.47715,131.649557 153.685633,135.854579 Z" id="Shape" fill="url(#linearGradient-3)"></path>
37   - </g>
38   - <ellipse id="Combined-Shape" fill="url(#linearGradient-4)" cx="100.519339" cy="100.436681" rx="23.6001926" ry="23.580786"></ellipse>
39   - </g>
40   - </g>
41   - </g>
42   - </g>
43   -</svg>
\ No newline at end of file
... ... @@ -4,7 +4,6 @@ import { Button } from 'antd';
4 4 import Link from 'umi/link';
5 5 import { Result } from 'ant-design-pro';
6 6 import styles from './style.less';
7   -import UserLayout from './components/UserLayout';
8 7
9 8 const actions = (
10 9 <div className={styles.actions}>
... ... @@ -21,24 +20,22 @@ const actions = (
21 20 </div>
22 21 );
23 22
24   -const RegisterResult = ({ location }) => (
25   - <UserLayout>
26   - <Result
27   - className={styles.registerResult}
28   - type="success"
29   - title={
30   - <div className={styles.title}>
31   - <FormattedMessage
32   - id="app.register-result.msg"
33   - values={{ email: location.state ? location.state.account : 'AntDesign@example.com' }}
34   - />
35   - </div>
36   - }
37   - description={formatMessage({ id: 'app.register-result.activation-email' })}
38   - actions={actions}
39   - style={{ marginTop: 56 }}
40   - />
41   - </UserLayout>
  23 +const PAGE_NAME_UPPER_CAMEL_CASE = ({ location }) => (
  24 + <Result
  25 + className={styles.registerResult}
  26 + type="success"
  27 + title={
  28 + <div className={styles.title}>
  29 + <FormattedMessage
  30 + id="app.register-result.msg"
  31 + values={{ email: location.state ? location.state.account : 'AntDesign@example.com' }}
  32 + />
  33 + </div>
  34 + }
  35 + description={formatMessage({ id: 'app.register-result.activation-email' })}
  36 + actions={actions}
  37 + style={{ marginTop: 56 }}
  38 + />
42 39 );
43 40
44   -export default RegisterResult;
  41 +export default PAGE_NAME_UPPER_CAMEL_CASE;
... ...
注册登录 后发表评论