Skip to content

Commit 038e362

Browse files
committed
Fixed: login page colour difference on dark mode
1 parent 7434561 commit 038e362

File tree

2 files changed

+30
-38
lines changed

2 files changed

+30
-38
lines changed

src/views/Login.css

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/views/Login.jsx

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useNavigate } from 'react-router-dom';
44
import { Button } from '@/components/ui/button';
55
import { Eclipse, Sun } from 'lucide-react';
66
import { Context } from '../Context';
7-
import './Login.css';
87

98
function Login() {
109
const { darkMode, setDarkMode } = useContext(Context);
@@ -22,37 +21,39 @@ function Login() {
2221
};
2322

2423
return (
25-
<div
26-
className={`${darkMode && 'dark'} flex justify-center items-center h-screen`}
27-
>
28-
<div className="bg-transparent text-white w-11/12 max-w-lg p-8 ">
29-
<div className="flex justify-center items-center mb-6">
30-
{darkMode ? (
31-
<img src="grocerease-light.png" alt="Shopping app logo" />
32-
) : (
33-
<img src="grocerease.png" alt="Shopping app logo" />
34-
)}
35-
</div>
36-
<div className="flex justify-center items-center h-2/5">
37-
<div className="flex justify-center items-center bg-pink-500 hover:bg-pink-500 hover:bg-opacity-80 w-2/4 h-1/4 rounded-xl p-2">
38-
<button type="button" onClick={signIn}>
39-
Sign In
40-
</button>
24+
<div className={`${darkMode && 'dark'} min-h-screen`}>
25+
<div className="flex justify-center items-center h-screen dark:text-white bg-white dark:bg-black">
26+
<div className="bg-transparent text-white w-11/12 max-w-lg p-8 ">
27+
<div className="flex justify-center items-center mb-6">
28+
{darkMode ? (
29+
<img src="grocerease-light.png" alt="Shopping app logo" />
30+
) : (
31+
<img src="grocerease.png" alt="Shopping app logo" />
32+
)}
33+
</div>
34+
<div className="flex justify-center items-center h-2/5">
35+
<div className="flex justify-center items-center bg-pink-500 hover:bg-pink-500 hover:bg-opacity-80 w-2/4 h-1/4 rounded-xl p-2">
36+
<button type="button" onClick={signIn}>
37+
Sign In
38+
</button>
39+
</div>
4140
</div>
4241
</div>
43-
</div>
44-
<Button
45-
onClick={toggleDarkMode}
46-
className="fixed w-16 bottom-16 right-16 p-2 rounded-full text-primary-pink hover:text-primary-pink hover:text-opacity-60 font-semibold"
47-
>
48-
<abbr title={darkMode ? 'Switch to light mode' : 'Switch to dark mode'}>
49-
<button
50-
className={`${darkMode && 'dark'} rounded-full text-primary-pink hover:text-opacity-60`}
42+
<Button
43+
onClick={toggleDarkMode}
44+
className="fixed w-16 bottom-16 right-16 p-2 rounded-full text-primary-pink hover:text-primary-pink hover:text-opacity-60 font-semibold"
45+
>
46+
<abbr
47+
title={darkMode ? 'Switch to light mode' : 'Switch to dark mode'}
5148
>
52-
{darkMode ? <Eclipse /> : <Sun />}
53-
</button>
54-
</abbr>
55-
</Button>
49+
<button
50+
className={`${darkMode && 'dark'} rounded-full text-primary-pink hover:text-opacity-60`}
51+
>
52+
{darkMode ? <Eclipse /> : <Sun />}
53+
</button>
54+
</abbr>
55+
</Button>
56+
</div>
5657
</div>
5758
);
5859
}

0 commit comments

Comments
 (0)