- 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",
"value": 3,
"mainColor": "#fffdea",
"accentColor": "5c5c5c",
"accentColor": "#5c5c5c",
"backgroundColor": "#1a1a1a"
},
{

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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