Skip to content

Commit

Permalink
[open-formulieren/open-forms#4917] Updated buttons styling
Browse files Browse the repository at this point in the history
  • Loading branch information
vaszig committed Jan 27, 2025
1 parent 49bd7cb commit 9f211a5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 55 deletions.
34 changes: 18 additions & 16 deletions src/components/ButtonsToolbar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,21 @@ const ButtonsToolbar = ({

return (
<>
<Toolbar modifiers={['mobile-reverse-order', 'bottom']}>
<Toolbar modifiers={['bottom']}>
<ToolbarList>
{previousPage && (
<PreviousLink to={previousPage} onClick={onNavigatePrevPage} position="end" />
{showSubmitButton && (
<OFButton
type="submit"
appearance="primary-action-button"
name="next"
disabled={!canSubmitStep}
>
{isCheckingLogic ? (
<Loader modifiers={['centered', 'only-child', 'small', 'gray']} />
) : (
<Literal name="nextText" />
)}
</OFButton>
)}
</ToolbarList>
<ToolbarList>
Expand All @@ -44,19 +55,10 @@ const ButtonsToolbar = ({
<Literal name="saveText" />
</OFButton>
)}
{showSubmitButton && (
<OFButton
type="submit"
appearance="primary-action-button"
name="next"
disabled={!canSubmitStep}
>
{isCheckingLogic ? (
<Loader modifiers={['centered', 'only-child', 'small', 'gray']} />
) : (
<Literal name="nextText" />
)}
</OFButton>
</ToolbarList>
<ToolbarList>
{previousPage && (
<PreviousLink to={previousPage} onClick={onNavigatePrevPage} position="end" />
)}
</ToolbarList>
</Toolbar>
Expand Down
16 changes: 8 additions & 8 deletions src/components/SummaryConfirmation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@ const SummaryConfirmation = ({submissionAllowed, prevPage, onPrevPage}) => {
showWarnings={showStatementWarnings}
/>
)}
<Toolbar modifiers={['mobile-reverse-order', 'bottom']}>
<ToolbarList>
{!!onPrevPage && (
<Link onClick={onPrevPage} to={prevPage}>
<Literal name="previousText" />
</Link>
)}
</ToolbarList>
<Toolbar modifiers={['bottom']}>
<ToolbarList>
{canSubmit ? (
<OFButton
Expand All @@ -55,6 +48,13 @@ const SummaryConfirmation = ({submissionAllowed, prevPage, onPrevPage}) => {
</OFButton>
) : null}
</ToolbarList>
<ToolbarList>
{!!onPrevPage && (
<Link onClick={onPrevPage} to={prevPage}>
<Literal name="previousText" />
</Link>
)}
</ToolbarList>
</Toolbar>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Toolbar = ({children, modifiers = []}) => {
Toolbar.propTypes = {
children: PropTypes.node,
modifiers: PropTypes.arrayOf(
PropTypes.oneOf(['start', 'bottom', 'reverse', 'compact', 'mobile-reverse-order', 'column'])
PropTypes.oneOf(['start', 'bottom', 'reverse', 'compact', 'column'])
),
};

Expand Down
36 changes: 6 additions & 30 deletions src/scss/components/_toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.#{prefix(toolbar)} {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: space-between;
position: relative;
Expand All @@ -21,6 +22,10 @@

@include bem.modifier('bottom') {
@include margin(true, $properties: margin-top);

.openforms-toolbar__list {
margin-block-end: 10px;
}
}

@include bem.modifier('reverse') {
Expand All @@ -45,31 +50,6 @@
}
}

@include bem.modifier('mobile-reverse-order') {
display: flex;
flex-direction: column-reverse;
margin-top: $typography-margin-text;

> * {
width: 100%;
}

@include bem.element('list') {
flex-direction: column-reverse;
&:not(:last-child) {
margin: $typography-margin-text 0 0 0;
}
}

@include bem.element('list-item') {
@include margin(auto, $properties: margin-bottom, $value-mobile: 0);
@include margin(auto, $properties: margin-top, $value-mobile: $typography-margin-list);
&:last-child {
padding-bottom: 0 !important;
}
}
}

@include bem.element('list') {
@include margin(auto, $properties: margin-bottom);
}
Expand All @@ -86,8 +66,8 @@
}

@include bem.element('list') {
@include responsive(flex-direction, column, column, row);
display: flex;
flex-direction: column;
justify-content: flex-end;
list-style: none;
margin: 0;
Expand All @@ -104,10 +84,6 @@
@include rows(1, 'min-height');
display: flex;
align-items: center;

@include laptop {
@include margin($properties: margin-right);
}
}

@include breakpoint($max: $breakpoint-laptop) {
Expand Down

0 comments on commit 9f211a5

Please sign in to comment.