Skip to content

Commit

Permalink
Darkmode lightmode rewrite (#64)
Browse files Browse the repository at this point in the history
* moved the used css variables to their own file

* Removed theme switch button

* Removed the change theme button and related functionality

* Changed colors

* changed colors for navbarlinks

* removed mobile navmenu double borders

* bös commit

* removed unused import

* Changed to use npm instead of yarn and fixed linting

---------

Co-authored-by: Simon Westlin Green <[email protected]>
  • Loading branch information
ViktorYeet and simon-wg authored Sep 26, 2024
1 parent 6bf2dcf commit 9aa7e78
Show file tree
Hide file tree
Showing 16 changed files with 5,123 additions and 2,878 deletions.
6 changes: 3 additions & 3 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ FROM node:lts-alpine
COPY . /app

workdir /app
run yarn install
run npm install


run yarn build
run npm run build
expose 3000
cmd ["yarn", "start"]
cmd ["npm", "run", "start"]
71 changes: 0 additions & 71 deletions frontend/components/elements/DarkModeSwitch.module.scss

This file was deleted.

19 changes: 0 additions & 19 deletions frontend/components/elements/DarkModeSwitch.tsx

This file was deleted.

27 changes: 6 additions & 21 deletions frontend/components/elements/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
import Image from "next/image";

import { Category } from "../../data/category";
import NavBar from "../views/NavBar";

import DarkModeSwitch from "./DarkModeSwitch";
import styles from "./Header.module.scss";

export interface HeaderProps {
categories: Category[];
show: boolean;
setShow: any;
darkMode: boolean;
setDarkMode: any;
}
const Header = ({
categories,
show,
setShow,
darkMode,
setDarkMode
}: HeaderProps) => (
const Header = ({ categories, show, setShow }: HeaderProps) => (
<nav className={`${styles.headerStyle}`}>
<NavBar
categories={categories}
show={show}
setShow={setShow}
darkMode={darkMode}
setDarkMode={setDarkMode}
/>
<NavBar categories={categories} show={show} setShow={setShow} />
<h1 className={`${styles.titleStyle}`}>findIT</h1>
<div className={styles.catList}>
{categories.map((category) => (
Expand All @@ -37,10 +24,8 @@ const Header = ({
</a>
))}
</div>
<div className={styles.darkModeSwitchInHeaderStyle}>
<DarkModeSwitch darkMode={darkMode} setDarkMode={setDarkMode} />
</div>
<img
<Image
alt="show navigation"
className={styles.showNav}
src="images/Hamburger_icon.png"
onClick={() => {
Expand Down
3 changes: 2 additions & 1 deletion frontend/components/views/NavBar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@
display: flex;
flex-direction: column;
height: $space-giant;
border: 1px solid black;
border-bottom: 1px solid black;
text-align: center;
align-items: center;
justify-content: center;

&:hover {
background-color: var(--highlight1);
color: var(--text);
Expand Down
12 changes: 1 addition & 11 deletions frontend/components/views/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
import { Category } from "../../data/category";
import DarkModeSwitch from "../elements/DarkModeSwitch";

import styles from "./NavBar.module.scss";

export interface NavBarProps {
categories: Category[];
show: boolean;
setShow: any;
darkMode: boolean;
setDarkMode: any;
}
function NavBar({
categories,
show,
setShow,
darkMode,
setDarkMode
}: NavBarProps) {
function NavBar({ categories, show, setShow }: NavBarProps) {
return (
<div
className={`${styles.navStyle} ${show ? styles.shown : styles.hidden}`}>
Expand All @@ -30,7 +21,6 @@ function NavBar({
</a>
</p>
))}
<DarkModeSwitch darkMode={darkMode} setDarkMode={setDarkMode} />
</div>
);
}
Expand Down
6 changes: 1 addition & 5 deletions frontend/components/views/ServiceCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
:hover{
cursor:pointer;
}

}

.aClass{
position:absolute;
color: var(--text);
Expand Down Expand Up @@ -36,10 +36,6 @@
font-size: $font-size-large;
color: var(--text);
}
/*.darkCard {
background-color: var(--background);
color: var(--text);
}*/
.cardClass {
background-color: var(--background);
color: var(--text);
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/views/ServiceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function ServiceCard({ service }: ServiceCardProps) {
return (
<div className={`${styles.cardClass} card`}>
<p>
<img
<Image
src={src}
className={`${styles.iconClass} marginTop marginLeft marginRight`}
alt={`${service.title}'s icon`}
Expand Down
Loading

0 comments on commit 9aa7e78

Please sign in to comment.