-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a save button to the template data input for safety
Signed-off-by: Axel Boberg <[email protected]>
- Loading branch information
1 parent
8218520
commit 38cf3e8
Showing
8 changed files
with
79 additions
and
9 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
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
19 changes: 19 additions & 0 deletions
19
plugins/caspar/app/components/TemplateDataHeader/index.jsx
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,19 @@ | ||
import React from 'react' | ||
import './style.css' | ||
|
||
export const TemplateDataHeader = ({ hasUnsavedChanges, onSave = () => {} }) => { | ||
if (!hasUnsavedChanges) { | ||
return <></> | ||
} | ||
|
||
return ( | ||
<header className='TemplateDataHeader'> | ||
<div className='TemplateDataHeader-section'> | ||
Save changes | ||
</div> | ||
<div className='TemplateDataHeader-section'> | ||
<button className='Button Button--ghost' disabled={!hasUnsavedChanges} onClick={() => onSave()}>Save</button> | ||
</div> | ||
</header> | ||
) | ||
} |
17 changes: 17 additions & 0 deletions
17
plugins/caspar/app/components/TemplateDataHeader/style.css
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,17 @@ | ||
.TemplateDataHeader { | ||
display: flex; | ||
|
||
width: 100%; | ||
padding: 5px 5px 5px 10px; | ||
|
||
border-radius: 6px; | ||
background: var(--base-color--accent5); | ||
|
||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
|
||
.TemplateDataHeader-section { | ||
display: flex; | ||
align-items: center; | ||
} |
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 |
---|---|---|
|
@@ -24,4 +24,8 @@ html, body, .View--flex { | |
|
||
.u-width--100pct { | ||
width: 100%; | ||
} | ||
|
||
.u-marginBottom--5px { | ||
margin-bottom: 5px; | ||
} |
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