From 89b35f8f049fab7ed26f0d9b5553bfe1ed921754 Mon Sep 17 00:00:00 2001 From: cuilanxin <57083007+cuilanxin@users.noreply.github.com> Date: Sat, 14 Aug 2021 21:40:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20SpeedDial=20=E6=82=AC=E6=B5=AE=E6=A0=87?= =?UTF-8?q?=E8=AE=B0,=20=E4=BC=98=E5=8C=96=E7=B1=BB=E5=9E=8B=20(#177)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 编写选项卡组件 * 类型名称请调整,添加组件文档在网站上展示 * #162修复报错 * fix:#162修复报错 * SpeedDial 悬浮标记 * 优化类型 --- example/examples/src/routes.tsx | 8 + .../examples/src/routes/SpeedDial/index.tsx | 77 +++++++ packages/core/src/Rating/README.md | 4 +- packages/core/src/Rating/index.tsx | 4 +- packages/core/src/SpeedDial/README.md | 129 ++++++++++++ packages/core/src/SpeedDial/SpeedDialItem.tsx | 96 +++++++++ packages/core/src/SpeedDial/index.tsx | 198 ++++++++++++++++++ packages/core/src/Tabs/README.md | 8 +- packages/core/src/Tabs/index.tsx | 3 + packages/core/src/index.tsx | 3 + .../src/pages/components/speeddial/index.tsx | 11 + website/src/routes/menus.ts | 1 + website/src/routes/router.tsx | 3 + 13 files changed, 538 insertions(+), 7 deletions(-) create mode 100644 example/examples/src/routes/SpeedDial/index.tsx create mode 100644 packages/core/src/SpeedDial/README.md create mode 100644 packages/core/src/SpeedDial/SpeedDialItem.tsx create mode 100644 packages/core/src/SpeedDial/index.tsx create mode 100644 website/src/pages/components/speeddial/index.tsx diff --git a/example/examples/src/routes.tsx b/example/examples/src/routes.tsx index 2dc9a90a7..e284baba9 100644 --- a/example/examples/src/routes.tsx +++ b/example/examples/src/routes.tsx @@ -330,4 +330,12 @@ export const stackPageData: Routes[] = [ description: '通告栏', }, }, + { + name: 'SpeedDial', + component: require('./routes/SpeedDial').default, + params: { + title: 'SpeedDial 悬浮标记', + description: 'SpeedDial 悬浮标记组件按下时,浮动动作按钮可以以快速显示标记的形式显示指定相关动作。', + }, + }, ]; diff --git a/example/examples/src/routes/SpeedDial/index.tsx b/example/examples/src/routes/SpeedDial/index.tsx new file mode 100644 index 000000000..8033ce7ec --- /dev/null +++ b/example/examples/src/routes/SpeedDial/index.tsx @@ -0,0 +1,77 @@ +import React, { Component } from 'react'; +import { StyleSheet, View, Text } from 'react-native'; +import Layout, { Container } from '../../Layout'; +import { SpeedDial, Icon, IconsName } from '@uiw/react-native'; +import { ComProps } from '../../routes'; + + +const { Header, Body, Card, Footer } = Layout; + +export interface listItem { + title: string | React.ReactElement | React.ReactNode; + icon: IconsName | React.ReactElement | React.ReactNode; +} +export interface IndexProps extends ComProps { } +export interface IndexState { + visible: boolean +} + +export default class Index extends Component { + constructor(props: IndexProps) { + super(props); + this.state = { + visible: false + }; + } + + render() { + const { route } = this.props; + const description = route.params.description; + const title = route.params.title; + + return ( + + +
+ + , + title: 'Add', + onPress:()=>console.log('Add') + }, + { + icon: , + title: 'Star' + }, + { + icon: , + title: 'Mail-asdlfslasdkfsdklajfsadf' + }, + { + icon: , + title: 'Share' + } + ]} + /> + +