-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #718 from open-formulieren/feature/4544-configurab…
…le-formstep-previous-button ✨ [open-formulieren/open-forms#4544] Configurable form 'previous' link
- Loading branch information
Showing
12 changed files
with
144 additions
and
78 deletions.
There are no files selected for viewing
Submodule design-tokens
updated
3 files
+2 −2 | package-lock.json | |
+1 −1 | package.json | |
+11 −0 | src/components/previous-link.tokens.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import classNames from 'classnames'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
|
||
import FAIcon from 'components/FAIcon'; | ||
import Link from 'components/Link'; | ||
import Literal from 'components/Literal'; | ||
|
||
const VARIANTS = ['start', 'end']; | ||
|
||
const PreviousLink = ({to, onClick, position}) => { | ||
const className = classNames('openforms-previous-link', { | ||
[`openforms-previous-link--${position}`]: position, | ||
}); | ||
return ( | ||
<Link to={to} onClick={onClick} className={className}> | ||
<FAIcon icon="arrow-left-long" extraClassName="openforms-previous-link__icon" /> | ||
<Literal name="previousText" /> | ||
</Link> | ||
); | ||
}; | ||
|
||
PreviousLink.propTypes = { | ||
to: PropTypes.string.isRequired, | ||
onClick: PropTypes.func, | ||
position: PropTypes.oneOf(VARIANTS), | ||
}; | ||
|
||
export default PreviousLink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@use 'microscope-sass/lib/bem'; | ||
|
||
.openforms-previous-link { | ||
flex-direction: row; | ||
column-gap: 8px; | ||
|
||
@include bem.modifier('start') { | ||
margin-block-end: 20px; | ||
// NOTE: usually block elements should not define margins, but this is done deliberately | ||
// See https://github.com/open-formulieren/open-forms-sdk/pull/718#discussion_r1791617060 for | ||
// more discussion context. | ||
display: var(--of-previous-link-display-start, none); | ||
} | ||
|
||
@include bem.modifier('end') { | ||
display: var(--of-previous-link-display-end, inline-flex); | ||
} | ||
|
||
@include bem.element('icon') { | ||
display: var(--of-previous-link-icon-display, none); | ||
} | ||
} |
Oops, something went wrong.