Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OF#4917] Update buttons styling (buttons position) #787

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading