From 9132167a6cd9a18a325bc4fec2b7021a46f5ba9b Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Tue, 12 Nov 2019 17:30:37 +0100 Subject: [PATCH] Add title option to Button and remove IconButton --- .../src/__snapshots__/storyshots.test.ts.snap | 20 ------- scm-ui/ui-components/src/buttons/Button.tsx | 17 +++++- .../ui-components/src/buttons/IconButton.tsx | 56 ------------------- .../src/buttons/index.stories.tsx | 2 - scm-ui/ui-components/src/buttons/index.ts | 1 - 5 files changed, 16 insertions(+), 80 deletions(-) delete mode 100644 scm-ui/ui-components/src/buttons/IconButton.tsx diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index b7852bd927..0350b44219 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -282,26 +282,6 @@ exports[`Storyshots Buttons|EditButton Default 1`] = ` `; -exports[`Storyshots Buttons|IconButton Default 1`] = ` -
- -
-`; - exports[`Storyshots Buttons|SubmitButton Default 1`] = `
{ }; render() { - const { label, loading, disabled, type, color, className, icon, fullWidth, reducedMobile, children } = this.props; + const { + label, + title, + loading, + disabled, + type, + color, + className, + icon, + fullWidth, + reducedMobile, + children + } = this.props; const loadingClass = loading ? "is-loading" : ""; const fullWidthClass = fullWidth ? "is-fullwidth" : ""; const reducedMobileClass = reducedMobile ? "is-reduced-mobile" : ""; @@ -46,6 +59,7 @@ class Button extends React.Component { return ( - ); - } -} - -export default withRouter(IconButton); diff --git a/scm-ui/ui-components/src/buttons/index.stories.tsx b/scm-ui/ui-components/src/buttons/index.stories.tsx index 4da801f8a1..79d5be448c 100644 --- a/scm-ui/ui-components/src/buttons/index.stories.tsx +++ b/scm-ui/ui-components/src/buttons/index.stories.tsx @@ -3,7 +3,6 @@ import Button from "./Button"; import { storiesOf } from "@storybook/react"; import styled from "styled-components"; import { MemoryRouter } from "react-router-dom"; -import IconButton from "./IconButton"; import AddButton from "./AddButton"; import CreateButton from "./CreateButton"; import DeleteButton from "./DeleteButton"; @@ -49,7 +48,6 @@ const buttonStory = (name: string, storyFn: () => ReactElement) => { .addDecorator(SpacingDecorator) .add("Default", storyFn); }; -buttonStory("IconButton", () => ); buttonStory("AddButton", () => Add); buttonStory("CreateButton", () => Create); buttonStory("DeleteButton", () => Delete); diff --git a/scm-ui/ui-components/src/buttons/index.ts b/scm-ui/ui-components/src/buttons/index.ts index 3bbfd05c4b..c5d536133f 100644 --- a/scm-ui/ui-components/src/buttons/index.ts +++ b/scm-ui/ui-components/src/buttons/index.ts @@ -2,7 +2,6 @@ export { default as AddButton } from "./AddButton"; export { default as Button } from "./Button"; -export { default as IconButton } from "./IconButton"; export { default as CreateButton } from "./CreateButton"; export { default as DeleteButton } from "./DeleteButton"; export { default as EditButton } from "./EditButton";