diff --git a/src/app/App.tsx b/src/app/App.tsx index 2841211..472a1bf 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -11,7 +11,10 @@ import LanguageProvider from '@shared/Context/LanguageContext'; const App = () => { useEffect(() => { - const isLightTheme = localStorage.getItem(localStorageKeys.LIGHT_THEME); + const isLightTheme = + localStorage.getItem(localStorageKeys.LIGHT_THEME) || + (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches); + if (isLightTheme) { colorThemeSwitcher.setLight(); } diff --git a/src/components/Editor/lib/submitRequest.ts b/src/components/Editor/lib/submitRequest.ts index c3e9064..fdd07ae 100644 --- a/src/components/Editor/lib/submitRequest.ts +++ b/src/components/Editor/lib/submitRequest.ts @@ -6,7 +6,7 @@ async function sumbitRequest(currEndpoint: string, query: string, variables: str const isHeadersEmpty = typeof headers !== 'string' || headers.trim().length === 0; const headersToParse = isHeadersEmpty ? DEFAULT_HEADERS : headers; - if (!isHeadersEmpty && isValidJson(headersToParse)) { + if (!isHeadersEmpty && !isValidJson(headersToParse)) { const msg = 'Invalid headers'; return msg; // TODO maybe show toaster instead } diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index 9e90a22..2ef9b35 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -1,23 +1,23 @@ import { FC, HTMLAttributes } from 'react'; -import ghIcon from '@assets/github.svg'; import rsLogo from '@assets/rs_school.svg'; import cn from '@shared/lib/helpers/cn'; +import GithubIcon from '@shared/ui/GithubIcon'; const Footer: FC> = ({ className }) => { return (