Skip to content

Commit 5c78325

Browse files
FusRoDah061xcv58
authored andcommitted
Changing "Save" button color whenever a draft is available (#87)
* Changing Save button color whenever a draft is available * Refactoring to use the Material UI native color props to change the Save button color
1 parent b3097e5 commit 5c78325

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/js/components/AutoSave.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export default observer(() => {
77
const { saved, autoSaveHandle } = useStore().AppStore
88
const content =
99
(autoSaveHandle && <CircularProgress size={24} />) ||
10-
(saved && <InputLabel>Draft saved</InputLabel>)
10+
(saved && (
11+
<InputLabel>Draft saved. Click "Save" to apply the script.</InputLabel>
12+
))
1113
return <span>{content}</span>
1214
})

src/js/components/Save.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { useStore } from './StoreContext'
44
import { observer } from 'mobx-react'
55

66
export default observer(({ onSave }) => {
7-
const { differentURL, tabMode } = useStore().AppStore
7+
const { differentURL, tabMode, saved, draft } = useStore().AppStore
88
return (
99
<Button
10-
color='primary'
10+
color={saved || draft ? 'secondary' : 'primary'}
1111
disabled={differentURL && !tabMode}
1212
onClick={onSave}
1313
>

0 commit comments

Comments
 (0)