Welcome.tsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import React from 'react';
  2. import { PageHeaderWrapper } from '@ant-design/pro-layout';
  3. import { FormattedMessage } from 'umi-plugin-react/locale';
  4. import { Card, Typography, Alert } from 'antd';
  5. import styles from './Welcome.less';
  6. const CodePreview: React.FC<{}> = ({ children }) => (
  7. <pre className={styles.pre}>
  8. <code>
  9. <Typography.Text copyable>{children}</Typography.Text>
  10. </code>
  11. </pre>
  12. );
  13. export default (): React.ReactNode => (
  14. <PageHeaderWrapper>
  15. <Card>
  16. <Alert
  17. message="umi ui 现已发布,欢迎使用 npm run ui 启动体验。"
  18. type="success"
  19. showIcon
  20. banner
  21. style={{
  22. margin: -12,
  23. marginBottom: 24,
  24. }}
  25. />
  26. <Typography.Text strong>
  27. <a target="_blank" rel="noopener noreferrer" href="https://pro.ant.design/docs/block">
  28. <FormattedMessage
  29. id="app.welcome.link.block-list"
  30. defaultMessage="基于 block 开发,快速构建标准页面"
  31. />
  32. </a>
  33. </Typography.Text>
  34. <CodePreview>npx umi block list</CodePreview>
  35. <Typography.Text
  36. strong
  37. style={{
  38. marginBottom: 12,
  39. }}
  40. >
  41. <a
  42. target="_blank"
  43. rel="noopener noreferrer"
  44. href="https://pro.ant.design/docs/available-script#npm-run-fetchblocks"
  45. >
  46. <FormattedMessage id="app.welcome.link.fetch-blocks" defaultMessage="获取全部区块" />
  47. </a>
  48. </Typography.Text>
  49. <CodePreview> npm run fetch:blocks</CodePreview>
  50. </Card>
  51. <p style={{ textAlign: 'center', marginTop: 24 }}>
  52. Want to add more pages? Please refer to{' '}
  53. <a href="https://pro.ant.design/docs/block-cn" target="_blank" rel="noopener noreferrer">
  54. use block
  55. </a>
  56. </p>
  57. </PageHeaderWrapper>
  58. );