From 6384d60efc455f848e78c290d6e562befc47d112 Mon Sep 17 00:00:00 2001 From: Danish Ahmed Mirza <77742477+try-catch-stack@users.noreply.github.com> Date: Fri, 20 May 2022 22:07:57 +0530 Subject: [PATCH] Chore: Migrate containers/Button to Typescript and Hooks (#4071) --- app/containers/Button/Button.stories.js | 28 +++++ app/containers/Button/Button.test.tsx | 71 +++++++++++ .../__snapshots__/Button.stories.storyshot | 11 ++ app/containers/Button/index.tsx | 113 +++++++++--------- app/containers/LoginServices.tsx | 1 - app/containers/TwoFactor/index.tsx | 10 +- app/containers/UIKit/Actions.tsx | 4 +- app/containers/UIKit/DatePicker.tsx | 4 +- app/containers/UIKit/MultiSelect/index.tsx | 2 +- app/containers/UIKit/index.tsx | 2 - app/containers/message/Attachments.tsx | 2 +- app/views/CannedResponseDetail.tsx | 8 +- .../CannedResponseItem.tsx | 1 - .../CannedResponseItem.stories.storyshot | 2 +- app/views/E2EEncryptionSecurityView.tsx | 2 - app/views/E2EEnterYourPasswordView.tsx | 1 - app/views/E2ESaveYourPasswordView.tsx | 3 - app/views/ForgotPasswordView.tsx | 1 - app/views/InviteUsersEditView/index.tsx | 3 +- app/views/InviteUsersView/index.tsx | 4 +- app/views/LivechatEditView.tsx | 2 +- app/views/LoginView.tsx | 2 - app/views/NewServerView/index.tsx | 2 - app/views/ProfileView/index.tsx | 2 - app/views/RegisterView.tsx | 1 - app/views/RoomView/JoinCode.tsx | 2 - app/views/RoomsListView/ServerDropdown.tsx | 1 - app/views/SendEmailConfirmationView.tsx | 1 - app/views/SetUsernameView.tsx | 1 - app/views/WorkspaceView/index.tsx | 3 +- .../stories/__snapshots__/Message.storyshot | 2 +- storybook/stories/index.js | 1 + 32 files changed, 178 insertions(+), 115 deletions(-) create mode 100644 app/containers/Button/Button.stories.js create mode 100644 app/containers/Button/Button.test.tsx create mode 100644 app/containers/Button/__snapshots__/Button.stories.storyshot diff --git a/app/containers/Button/Button.stories.js b/app/containers/Button/Button.stories.js new file mode 100644 index 000000000..165c8b49b --- /dev/null +++ b/app/containers/Button/Button.stories.js @@ -0,0 +1,28 @@ +import React from 'react'; +import { storiesOf } from '@storybook/react-native'; + +import Button from '.'; + +const buttonProps = { + title: 'Press me!', + type: 'primary', + onPress: () => {}, + testID: 'testButton', + fontSize: 16, + style: { + padding: 10, + justifyContent: 'center' + } +}; + +const stories = storiesOf('Button', module); + +stories.add('primary button', () =>