Skip to content

Commit

Permalink
remove size from EmptySelectorButton
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed Sep 27, 2024
1 parent 1847b66 commit 4e8d1f0
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 29 deletions.
8 changes: 0 additions & 8 deletions components/src/atoms/buttons/EmptySelectorButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ const meta: Meta<typeof EmptySelectorButtonComponent> = {
title: 'Library/Atoms/Buttons/EmptySelectorButton',
component: EmptySelectorButtonComponent,
argTypes: {
size: {
control: {
type: 'select',
options: ['large', 'small'],
},
defaultValue: 'large',
},
textAlignment: {
controls: {
type: 'select',
Expand All @@ -37,7 +30,6 @@ export const EmptySelectorButton: Story = {
args: {
text: 'mock text',
iconName: 'plus',
size: 'small',
textAlignment: 'left',
onClick: () => {},
},
Expand Down
13 changes: 2 additions & 11 deletions components/src/atoms/buttons/EmptySelectorButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,19 @@ interface EmptySelectorButtonProps {
text: string
textAlignment: 'left' | 'middle'
iconName?: IconName
size?: 'large' | 'small'
disabled?: boolean
}

// used for helix and Opentrons Ai
export function EmptySelectorButton(
props: EmptySelectorButtonProps
): JSX.Element {
const {
onClick,
text,
iconName,
size = 'large',
textAlignment,
disabled = false,
} = props
const buttonSizing = size === 'large' ? '100%' : FLEX_MAX_CONTENT
const { onClick, text, iconName, textAlignment, disabled = false } = props

const StyledButton = styled.button`
border: none;
width: ${FLEX_MAX_CONTENT};
height: ${buttonSizing};
height: ${FLEX_MAX_CONTENT};
cursor: ${disabled ? CURSOR_DEFAULT : CURSOR_POINTER};
&:focus-visible {
outline: 2px solid ${COLORS.white};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe('EmptySelectorButton', () => {
text: 'mock text',
iconName: 'add',
textAlignment: 'left',
size: 'large',
}
})
it('renders the props and button cta', () => {
Expand All @@ -33,7 +32,6 @@ describe('EmptySelectorButton', () => {
})
it('renders middled aligned button', () => {
props.textAlignment = 'middle'
props.size = 'small'
props.iconName = undefined
render(props)
expect(screen.getByTestId('EmptySelectorButton_container')).toHaveStyle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ export function EditInstrumentsModal(
text={t('add_pip')}
textAlignment="left"
iconName="plus"
size="large"
/>
)}
{rightPip != null &&
Expand Down Expand Up @@ -305,7 +304,6 @@ export function EditInstrumentsModal(
text={t('add_pip')}
textAlignment="left"
iconName="plus"
size="large"
/>
)}
</Flex>
Expand Down Expand Up @@ -367,7 +365,6 @@ export function EditInstrumentsModal(
text={t('protocol_overview:add_gripper')}
textAlignment="left"
iconName="plus"
size="large"
/>
)}
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export function SelectFixtures(props: WizardTileProps): JSX.Element | null {
disabled={numSlotsAvailable === 0}
key={equipment}
textAlignment={TYPOGRAPHY.textAlignLeft}
size="small"
iconName="plus"
text={t(`${equipment}`)}
onClick={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export function SelectModules(props: WizardTileProps): JSX.Element | null {
numMagneticBlocks === 4)
}
textAlignment={TYPOGRAPHY.textAlignLeft}
size="small"
iconName="plus"
text={getModuleDisplayName(moduleModel)}
onClick={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ export function SelectPipettes(props: WizardTileProps): JSX.Element | null {
text={t('add_pip')}
textAlignment="left"
iconName="plus"
size="large"
/>
)}
{pipettesByMount.right.pipetteName != null &&
Expand Down Expand Up @@ -480,7 +479,6 @@ export function SelectPipettes(props: WizardTileProps): JSX.Element | null {
text={t('add_pip')}
textAlignment="left"
iconName="plus"
size="large"
/>
)}
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export function OffDeckDetails(props: OffDeckDetailsProps): JSX.Element {
onClick={addLabware}
text={t('add_labware')}
textAlignment="middle"
size="large"
iconName="plus"
/>
</Flex>
Expand Down

0 comments on commit 4e8d1f0

Please sign in to comment.