From da796745485d7db2b13ac7b11bdc422394dab7be Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Sat, 26 Dec 2020 23:05:17 +0100 Subject: [PATCH] Rewrite all buttons --- package.json | 1 + src/components/BottomSheet.tsx | 17 +- src/components/Button.tsx | 168 +++++++++++++++++- src/components/Button/ButtonRound.tsx | 60 ------- src/components/Button/ButtonRow.tsx | 89 ---------- src/components/Menu/Button.tsx | 78 -------- src/components/Menu/Container.tsx | 23 +-- src/components/Menu/Header.tsx | 8 +- src/components/Menu/Row.tsx | 10 +- src/components/ParseContent.tsx | 129 +++++++------- src/components/Timelines/Timeline/Empty.tsx | 4 +- .../Timelines/Timeline/Separator.tsx | 4 +- .../Timelines/Timeline/Shared/Actions.tsx | 4 +- .../Timeline/Shared/Attachment/Audio.tsx | 17 +- .../Shared/Attachment/Unsupported.tsx | 7 +- .../Timeline/Shared/Attachment/Video.tsx | 10 +- .../Timelines/Timeline/Shared/Poll.tsx | 133 +++++++------- src/screens/Me/Root/Login.tsx | 50 ++---- src/screens/Me/Root/Logout.tsx | 69 +++---- src/screens/Shared/Account/Information.tsx | 25 ++- src/screens/Shared/Announcements.tsx | 7 +- src/screens/Shared/Compose/Attachments.tsx | 52 ++++-- src/screens/Shared/Compose/Poll.tsx | 101 +++++------ src/utils/styles/themes.ts | 9 +- yarn.lock | 5 + 25 files changed, 497 insertions(+), 583 deletions(-) delete mode 100644 src/components/Button/ButtonRound.tsx delete mode 100644 src/components/Button/ButtonRow.tsx delete mode 100644 src/components/Menu/Button.tsx diff --git a/package.json b/package.json index 404314f0..07dd3ff5 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "react-dom": "16.13.1", "react-i18next": "^11.8.4", "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.0.tar.gz", + "react-native-animated-spinkit": "^1.4.2", "react-native-expo-image-cache": "^4.1.0", "react-native-gesture-handler": "~1.8.0", "react-native-htmlview": "^0.16.0", diff --git a/src/components/BottomSheet.tsx b/src/components/BottomSheet.tsx index 03ab7521..93541c53 100644 --- a/src/components/BottomSheet.tsx +++ b/src/components/BottomSheet.tsx @@ -10,7 +10,7 @@ import { import { useSafeAreaInsets } from 'react-native-safe-area-context' import { useTheme } from '@utils/styles/ThemeManager' import { StyleConstants } from '@utils/styles/constants' -import { ButtonRow } from '@components/Button' +import Button from '@components/Button' export interface Props { children: React.ReactNode @@ -84,12 +84,12 @@ const BottomSheet: React.FC = ({ children, visible, handleDismiss }) => { style={[styles.handle, { backgroundColor: theme.background }]} /> {children} - - closeModal.start(() => handleDismiss())} - text='取消' - /> - +