Skip to content

Commit

Permalink
runfix: wrap buttons to new line (#17742)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykBuniX authored Aug 12, 2024
1 parent 07ef40d commit 428436c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@

import {CSSObject} from '@emotion/react';

export const singleActionButtonStyle: CSSObject = {
export const singleActionButtonStyle = (oneButtonPerRow = false): CSSObject => ({
width: '100%',
margin: '0 8px',
};
margin: 0,
flex: oneButtonPerRow ? '1' : '1 1 125px',
minWidth: 'unset',
overflow: 'unset',
});
12 changes: 8 additions & 4 deletions src/script/components/panel/SingleAction/SingleAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,24 @@ export interface SingleActionProps {
const SingleAction = ({item, onCancel, oneButtonPerRow = false}: SingleActionProps) => {
return (
<FlexBox
flexWrap={oneButtonPerRow ? 'wrap-reverse' : 'nowrap'}
css={{rowGap: '8px'}}
css={{
rowGap: 8,
columnGap: 16,
flexDirection: oneButtonPerRow ? 'column-reverse' : 'row',
flexWrap: 'wrap-reverse',
}}
justify="space-evenly"
className="modal__buttons"
>
<Button
variant={ButtonVariant.SECONDARY}
onClick={onCancel}
data-uie-name="do-close"
css={singleActionButtonStyle}
css={singleActionButtonStyle(oneButtonPerRow)}
>
{t('modalConfirmSecondary')}
</Button>
<Button onClick={item.click} data-uie-name={item.identifier} css={singleActionButtonStyle}>
<Button onClick={item.click} data-uie-name={item.identifier} css={singleActionButtonStyle(oneButtonPerRow)}>
{item.label}
</Button>
</FlexBox>
Expand Down

0 comments on commit 428436c

Please sign in to comment.