-
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.
✨ [#462] Add wrapper for disabled-clickable button
- Loading branch information
1 parent
67973f8
commit 7ac7b53
Showing
4 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/components/SummaryConfirmation/DisabledClickableButtonWrapper.js
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,20 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
|
||
const DisabledClickableButtonWrapper = ({disabled, onDisabledClick, children}) => { | ||
if (!disabled) return <>{children}</>; | ||
|
||
return ( | ||
<div onClick={onDisabledClick} className="openforms-disabled-clickable-button"> | ||
<div className="openforms-disabled-clickable-button__clickable-wrap">{children}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
DisabledClickableButtonWrapper.propTypes = { | ||
disabled: PropTypes.bool.isRequired, | ||
onDisabledClick: PropTypes.func.isRequired, | ||
children: PropTypes.node.isRequired, | ||
}; | ||
|
||
export default DisabledClickableButtonWrapper; |
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,15 @@ | ||
@import '../mixins/prefix'; | ||
|
||
.#{prefix(disabled-clickable-button)} { | ||
position: relative; | ||
|
||
&__clickable-wrap::before { | ||
cursor: var(--utrecht-action-disabled-cursor, not-allowed); | ||
content: ''; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
} |
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