Skip to content

Commit

Permalink
--ammend
Browse files Browse the repository at this point in the history
  • Loading branch information
ndahimana154 committed Jul 8, 2024
1 parent 1558cae commit 5bef4df
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
Binary file added public/email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/failed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="logo.png" type="image/png">
<title>E-Commerce Ninjas FrontEnd</title>
</head>

<body>
<div id="root"></div>
</body>
</html>

</html>
10 changes: 8 additions & 2 deletions src/components/GoogleCallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import React, { useEffect, useState } from 'react';
import { useAppDispatch } from '../store/store';
import { googleAuthCallback } from '../store/features/auth/authSlice';
import { useNavigate } from 'react-router-dom';
import { PuffLoader } from 'react-spinners';
import "../../src/styles/Loader.scss";

const GoogleCallback = () => {
const dispatch = useAppDispatch();
Expand Down Expand Up @@ -42,11 +44,15 @@ const GoogleCallback = () => {
}, [dispatch, navigate]);

if (loading) {
return <div>Loading...</div>;
return (
<div className="loader">
<PuffLoader color="#ff6d18" size={300} loading={loading} />
</div>
);
}

if (error) {
return <div>{error}</div>;
return <div className="error-message">{error}</div>;
}

return <div>Authenticating....</div>;
Expand Down
2 changes: 0 additions & 2 deletions src/pages/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ const LandingPage: React.FC = () => {
const dispatch = useAppDispatch();
const { products, isError, isSuccess, isLoading, message } = useAppSelector((state: any) => state.products);

console.log(localStorage.getItem('token'))
const welcomeMessage: IWelcomeMessage = useAppSelector((state) => state.initialMessage.welcomeMessage);
useEffect(() => {
dispatch(fetchProducts());
}, [dispatch]);
Expand Down
7 changes: 7 additions & 0 deletions src/styles/Loader.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.loader {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

4 changes: 2 additions & 2 deletions src/styles/signup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
border-radius: 20px;
border: 1px solid $border-color;
background-color: $white-color;
width: 400px;
width: 300px;
height: 3.5rem;
cursor: pointer;
p {
Expand All @@ -216,7 +216,7 @@
}

.google-icon {
font-size: 50px;
font-size: 30px;
color: $primary-color;
}
}
Expand Down

0 comments on commit 5bef4df

Please sign in to comment.