-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previous entries, SpeedDial UI and performance improvements (#56)
* Add previouesEntries to Contentful edit URL * Improve tree update performance and add speed dial as default UI
- Loading branch information
1 parent
c0d5403
commit f234ff2
Showing
13 changed files
with
523 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
10.15.0 | ||
16.13.0 |
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
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
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,6 +1,13 @@ | ||
import getContentfulVars from './getContentfulVars'; | ||
|
||
export default (contentId) => { | ||
export default (contentId, selectedPath = []) => { | ||
const [CONTENTFUL_CURRENT_SPACE_ID, CONTENTFUL_ENVIRONMENT] = getContentfulVars(); | ||
return `https://app.contentful.com/spaces/${CONTENTFUL_CURRENT_SPACE_ID}/environments/${CONTENTFUL_ENVIRONMENT}/entries/${contentId}`; | ||
const reversed = [...selectedPath].reverse(); | ||
const previousEntries = selectedPath | ||
? `?previousEntries=${reversed | ||
.filter((node) => node.id && node.id !== contentId) | ||
.map((node) => node.id) | ||
.join(',')}` | ||
: ''; | ||
return `https://app.contentful.com/spaces/${CONTENTFUL_CURRENT_SPACE_ID}/environments/${CONTENTFUL_ENVIRONMENT}/entries/${contentId}${previousEntries}`; | ||
}; |
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,26 @@ | ||
import React from 'react'; | ||
export default (defaultValue, key) => { | ||
const [value, setValuestate] = React.useState(localStorage.getItem(key) ? JSON.parse(localStorage.getItem(key)) : defaultValue); | ||
// React.useEffect(() => { | ||
// chrome.storage.sync.get([key], (storageValue) => { | ||
// if (typeof storageValue[key] !== 'undefined') { | ||
// setValuestate(storageValue[key]); | ||
// } | ||
// }); | ||
|
||
// chrome.storage.onChanged.addListener((changes) => { | ||
// if (changes[key] && changes[key].newValue !== changes[key].oldValue) { | ||
// setValuestate(changes[key].newValue); | ||
// } | ||
// }); | ||
// }, [defaultValue]); | ||
|
||
const setValue = newValue => { | ||
setValuestate(newValue); | ||
localStorage.setItem(key, newValue); | ||
// TODO: The next line makes the extension disappear without error | ||
// chrome.storage.sync.set({ [key]: newValue }); | ||
|
||
}; | ||
return [value, setValue]; | ||
}; |
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,11 @@ | ||
import { createTheme } from '@mui/material/styles'; | ||
|
||
const theme = createTheme({ | ||
palette: { | ||
primary: { | ||
main: '#9146ff' | ||
} | ||
} | ||
}); | ||
|
||
export default theme; |
Oops, something went wrong.