Skip to content

Commit

Permalink
Merge pull request #119 from bas-kirill/feat/favorite-dark-mode
Browse files Browse the repository at this point in the history
feat(favorite): dark mode
  • Loading branch information
bas-kirill authored Aug 25, 2024
2 parents 06a4111 + 640e811 commit e5ed4f3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
6 changes: 5 additions & 1 deletion client/src/pages/favorite/ui/Favorite.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ import { InstrumentCard } from "shared/instrument-card";
import { useJwt } from "shared/jwt/use-jwt";
import { useLoaderData } from "react-router-dom";
import { FavoriteLoader } from "pages/favorite";
import { useDarkMode } from "shared/dark-mode/use-dark-mode";

export const FavoritePage = () => {
useJwt();
const { darkMode } = useDarkMode();
const loader = useLoaderData() as FavoriteLoader;

return (
<>
<HeaderWidget />

<h1 className={styles.h1}>Favorite</h1>
<h1 className={`${styles.h1} ${darkMode && styles.h1__dark}`}>
Favorite
</h1>

{loader.instrumentDetails.length === 0 && (
<div className={styles.favorite__empty}>Favorite List is Empty</div>
Expand Down
4 changes: 4 additions & 0 deletions client/src/pages/favorite/ui/styles/Favorite.page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
margin: 0.5em 0;
}

.h1__dark {
color: #ffffff;
}

.favorite__empty {
text-align: center;
}
Expand Down
29 changes: 23 additions & 6 deletions client/src/shared/instrument-card/ui/InstrumentDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,50 @@ export const InstrumentDescription = (props: Props) => {
>
Type
</b>
: <span>{instrument_type}</span>
:{" "}
<span className={`${darkMode ? styles.primary__dark : styles.primary}`}>
{instrument_type}
</span>
<br />
<b
className={`${darkMode ? styles.secondary__dark : styles.secondary}`}
>
Manufacturer
</b>
: <span>{manufacturer_name}</span>
:{" "}
<span className={`${darkMode ? styles.primary__dark : styles.primary}`}>
{manufacturer_name}
</span>
<br />
<b
className={`${darkMode ? styles.secondary__dark : styles.secondary}`}
>
Manufacturer date
</b>
: <span>{manufacture_date}</span>
:{" "}
<span className={`${darkMode ? styles.primary__dark : styles.primary}`}>
{manufacture_date}
</span>
<br />
<b
className={`${darkMode ? styles.secondary__dark : styles.secondary}`}
>
Release Date
</b>
: <span>{release_date}</span>
:{" "}
<span className={`${darkMode ? styles.primary__dark : styles.primary}`}>
{release_date}
</span>
<br />
<b
className={`${darkMode ? styles.secondary__dark : styles.secondary}`}
>
Country
</b>
: <span>{country}</span>
:{" "}
<span className={`${darkMode ? styles.primary__dark : styles.primary}`}>
{country}
</span>
<br />
<b
className={`${darkMode ? styles.secondary__dark : styles.secondary}`}
Expand All @@ -69,7 +84,9 @@ export const InstrumentDescription = (props: Props) => {
:
<>
{basic_materials.map((basic_material, index) => (
<span>
<span
className={`${darkMode ? styles.primary__dark : styles.primary}`}
>
{index > 0 ? "," : ""} {basic_material.basic_material}
</span>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
color: #212529;
}

.primary__dark {
color: #ffffff;
}

.secondary {
color: #6c757d;
}
Expand Down

0 comments on commit e5ed4f3

Please sign in to comment.