- Fixed "Blackboard" theme
- Removed "fetch[]" functions, eliminating console warnings
- Fixed error where pressing "Apply" without having a theme selected would crash the site
This commit is contained in:
Bastian Meissner 2020-06-10 14:27:25 +02:00
parent 30b37a95d2
commit d2b35f7339
7 changed files with 11 additions and 16 deletions

View file

@ -25,7 +25,7 @@
"label": "Blackboard", "label": "Blackboard",
"value": 3, "value": 3,
"mainColor": "#fffdea", "mainColor": "#fffdea",
"accentColor": "5c5c5c", "accentColor": "#5c5c5c",
"backgroundColor": "#1a1a1a" "backgroundColor": "#1a1a1a"
}, },
{ {

View file

@ -75,8 +75,7 @@ const useAppData = () => {
const AppList = () => { const AppList = () => {
const { const {
appData: { apps, error }, appData: { apps, error }
fetchAppData
} = useAppData(); } = useAppData();
return ( return (
<ListContainer> <ListContainer>

View file

@ -66,8 +66,7 @@ const useBookmarkData = () => {
const BookmarkList = () => { const BookmarkList = () => {
const { const {
bookmarkData: { groups, error }, bookmarkData: { groups, error }
fetchBookmarkData
} = useBookmarkData(); } = useBookmarkData();
return ( return (
<ListContainer> <ListContainer>

View file

@ -25,7 +25,7 @@
"label": "Blackboard", "label": "Blackboard",
"value": 3, "value": 3,
"mainColor": "#fffdea", "mainColor": "#fffdea",
"accentColor": "5c5c5c", "accentColor": "#5c5c5c",
"backgroundColor": "#1a1a1a" "backgroundColor": "#1a1a1a"
}, },
{ {

View file

@ -42,8 +42,7 @@ const useSearchProviders = () => {
const SearchBar = () => { const SearchBar = () => {
const { const {
searchProviders: { providers, error }, searchProviders: { providers, error }
fetchSearchProviders
} = useSearchProviders(); } = useSearchProviders();
let [input, setInput] = useState(); let [input, setInput] = useState();

View file

@ -59,11 +59,6 @@ const HeadCell = styled.th`
background: none; background: none;
`; `;
const InfoText = styled.p`
font-weight: 400;
padding: 0.5rem 0 0.5rem 0;
`;
const SelectorStyle = { const SelectorStyle = {
control: provided => ({ control: provided => ({
...provided, ...provided,
@ -111,6 +106,7 @@ const SelectorStyle = {
const useThemeData = () => { const useThemeData = () => {
const [themeData, setThemeData] = useState({ themes: [], error: false }); const [themeData, setThemeData] = useState({ themes: [], error: false });
const fetchThemeData = useCallback(() => { const fetchThemeData = useCallback(() => {
(process.env.NODE_ENV === 'production' (process.env.NODE_ENV === 'production'
? fetch('/data/themes.json').then(handleResponse) ? fetch('/data/themes.json').then(handleResponse)
@ -135,8 +131,7 @@ const SettingsModal = () => {
const [newTheme, setNewTheme] = useState(); const [newTheme, setNewTheme] = useState();
const { const {
themeData: { themes, error }, themeData: { themes, error }
fetchThemeData
} = useThemeData(); } = useThemeData();
return ( return (

View file

@ -7,7 +7,10 @@ const defaultTheme = {
}; };
const setTheme = theme => { const setTheme = theme => {
localStorage.setItem('theme', theme); if (theme !== undefined) {
localStorage.setItem('theme', theme);
}
window.location.reload(); window.location.reload();
}; };