Skip to content

Commit

Permalink
hotfix: исправление цвета шрифта при загрузке/ошибке
Browse files Browse the repository at this point in the history
  • Loading branch information
southatelove committed Sep 4, 2024
1 parent 00fc49f commit ba43a50
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/Search/Search.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
font-size: 14px;
font-style: normal;
font-weight: 400;
color: var(--text-color);
color: var(--separator-color);
background-color: #fcfcfd;
border: 1px solid #efefef;
box-shadow: 15px 20px 45px 0px rgba(233, 233, 233, 0.25);
Expand Down
7 changes: 2 additions & 5 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Provider } from "react-redux";
import { store } from "./store/store";
import Success from "./pages/Success/Success";
import { ThemeProvider } from "./components/ThemeProvider/ThemeProvider";
import "./styles/index.css";

const Menu = lazy(() => import("./pages/Menu/Menu"));

Expand All @@ -34,11 +35,7 @@ const router = createBrowserRouter([
children: [
{
path: "/",
element: (
<Suspense fallback={<>Загрузка Меню...</>}>
<Menu />
</Suspense>
),
element: <Menu />,
},
{
path: "/success",
Expand Down
4 changes: 4 additions & 0 deletions src/pages/Menu/Menu.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
display: flex;
justify-content: space-between;
}

.error {
color: var(--separator-color);
}
11 changes: 7 additions & 4 deletions src/pages/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ const Menu = () => {
<Headling>Меню</Headling>
<Search placeholder="Введите блюдо или состав" onChange={onSearch} />
</div>

{error && <>{error}</>}
{!isLoading && <MenuList products={products} />}
{isLoading && <>Загружаем продукты...</>}
{!isLoading && products.length === 0 && (
<>Не найдено блюд по запросу...</>
)}
<div className={styles["error"]}>
{isLoading && <>Загружаем продукты...</>}
{!isLoading && products.length === 0 && (
<>Не найдено блюд по запросу...</>
)}
</div>
</>
);
};
Expand Down
3 changes: 0 additions & 3 deletions src/styles/themes/dark.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.app.dark {
--bg-color: #03031a;
/* --primary-color: #bdc7bd; */
/* --text-color: white;
--second-text-color: black; */
--text-color: white;
}

0 comments on commit ba43a50

Please sign in to comment.