Skip to content

Commit

Permalink
Changing "Save" button color whenever a draft is available (#87)
Browse files Browse the repository at this point in the history
* Changing Save button color whenever a draft is available

* Refactoring to use the Material UI native color props to change the Save button color
  • Loading branch information
FusRoDah061 authored and xcv58 committed Jan 7, 2020
1 parent b3097e5 commit 5c78325
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/js/components/AutoSave.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export default observer(() => {
const { saved, autoSaveHandle } = useStore().AppStore
const content =
(autoSaveHandle && <CircularProgress size={24} />) ||
(saved && <InputLabel>Draft saved</InputLabel>)
(saved && (
<InputLabel>Draft saved. Click "Save" to apply the script.</InputLabel>
))
return <span>{content}</span>
})
4 changes: 2 additions & 2 deletions src/js/components/Save.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { useStore } from './StoreContext'
import { observer } from 'mobx-react'

export default observer(({ onSave }) => {
const { differentURL, tabMode } = useStore().AppStore
const { differentURL, tabMode, saved, draft } = useStore().AppStore
return (
<Button
color='primary'
color={saved || draft ? 'secondary' : 'primary'}
disabled={differentURL && !tabMode}
onClick={onSave}
>
Expand Down

0 comments on commit 5c78325

Please sign in to comment.