-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ramps-583-implement-relative-order-column-in-allocation…
…s_process_resources' into ramps-100-variable-marketplace merge AdvancedSettingsSection
- Loading branch information
Showing
10 changed files
with
445 additions
and
120 deletions.
There are no files selected for viewing
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,68 @@ | ||
import PropTypes from "prop-types"; | ||
import style from "./AdvancedSettingsSection.module.scss"; | ||
|
||
export const AdvancedSettingsSection = ({ | ||
headerText, | ||
header, | ||
children, | ||
isEditing = false, | ||
onEditingChange, | ||
warningMessage = "", | ||
}) => { | ||
const altWarningBanner = headerText && headerText.type === "label"; | ||
return ( | ||
<div className={style["advanced-settings"]}> | ||
{(headerText || header) && ( | ||
<div className={style["header-wrapper"]}> | ||
{headerText} | ||
{header && ( | ||
<div | ||
className={`${style["header-buttons-container"]} ${ | ||
!isEditing ? style["blurred"] : "" | ||
}`} | ||
> | ||
{header} | ||
</div> | ||
)} | ||
</div> | ||
)} | ||
<div style={{ width: "100%" }}> | ||
{!isEditing && ( | ||
<div | ||
className={ | ||
altWarningBanner | ||
? `${style["alt-warning-banner"]}` | ||
: style["warning-banner"] | ||
} | ||
> | ||
<span className={style["warning-text"]}> | ||
<strong>CAUTION! </strong> {warningMessage} | ||
</span> | ||
<button | ||
className="btn btn-danger" | ||
onClick={() => onEditingChange(true)} | ||
> | ||
I understand the risks | ||
</button> | ||
</div> | ||
)} | ||
<div | ||
className={`${style["content-container"]} ${ | ||
!isEditing ? style["blurred"] : "" | ||
}`} | ||
> | ||
{children} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
AdvancedSettingsSection.propTypes = { | ||
headerText: PropTypes.node, | ||
header: PropTypes.node, | ||
children: PropTypes.node.isRequired, | ||
isEditing: PropTypes.bool, | ||
onEditingChange: PropTypes.func.isRequired, | ||
warningMessage: PropTypes.string, | ||
}; |
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,48 @@ | ||
.advanced-settings { | ||
position: relative; | ||
} | ||
|
||
.header-wrapper { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
.content-container { | ||
transition: filter 0.3s ease; | ||
border-radius: 4px; | ||
} | ||
|
||
.blurred { | ||
filter: blur(4px) brightness(0.95); | ||
pointer-events: none; | ||
} | ||
|
||
.warning-banner { | ||
position: absolute; | ||
top: 50%; | ||
left: 0; | ||
right: 0; | ||
transform: translateY(-50%); | ||
z-index: 1; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 0.75rem; | ||
background-color: #fff3cd; | ||
border: 1px solid #ffeeba; | ||
border-radius: 4px; | ||
margin: 0 1rem; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||
color: #856404; | ||
} | ||
|
||
.alt-warning-banner { | ||
composes: warning-banner; | ||
position: relative; | ||
transform: none; | ||
margin: 0 0 1rem; | ||
height: 18px; | ||
max-width: 750px; | ||
padding: 0.75rem; | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.exchange-rates-grid { | ||
margin: 0.8rem 0; | ||
margin: 0.8rem 0 1.6rem; | ||
border: 0; | ||
|
||
.header-container { | ||
|
Oops, something went wrong.