Skip to content

Commit

Permalink
Merge pull request #18 from aswanthabam/dev
Browse files Browse the repository at this point in the history
fix : Login Button Label
  • Loading branch information
aswanthabam authored Dec 3, 2023
2 parents aa7ccba + 26810ba commit 24f69b9
Show file tree
Hide file tree
Showing 18 changed files with 88 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/apis/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios, {
AxiosResponse,
InternalAxiosRequestConfig,
} from "axios";
import { _EventInfo } from "../types";
import { _EventInfo } from "../utils/types";

/* set the token */

Expand Down
2 changes: 1 addition & 1 deletion src/apis/eventApi.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { _EventInfo } from "../types";
import { _EventInfo } from "../utils/types";
import {
ResponseStatus,
ResponseType,
Expand Down
7 changes: 6 additions & 1 deletion src/apis/userApi.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { _UserDetails, _UserLogin, _UserStep1, _UserStep2 } from "../types";
import {
_UserDetails,
_UserLogin,
_UserStep1,
_UserStep2,
} from "../utils/types";
import {
LoginStatus,
ResponseStatus,
Expand Down
18 changes: 11 additions & 7 deletions src/components/buttons/LoginButton/LoginButton.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@
height: auto;
padding: 10px 10px;
align-items: center;
justify-content: center;
border-radius: 30px;
background: var(--color-orange);

.icon {
margin-right: 10px;

display: flex;
align-items: center;
& img {
width: 15px;
}
}

.text {
color: var(--color-white);
font-family: Wallpoet;
font-size: 15px;
font-style: normal;
font-weight: 400;
line-height: normal;
& span {
color: var(--color-black);
/* font-family: Wallpoet; */
font-size: 17px;
font-style: normal;
font-weight: 400;
line-height: normal;
}
}
}

Expand Down
19 changes: 13 additions & 6 deletions src/components/buttons/LoginButton/LoginButton.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import styles from "./LoginButton.module.css";
import React from "react";
import googleIcon from "../../../assets/google.png";

interface LoginButtonProps {
onClick: () => void;
text: String;
iconVisible: boolean;
}
const LoginButton: React.FC<LoginButtonProps> = ({ onClick }) => {
const LoginButton: React.FC<LoginButtonProps> = ({
onClick,
text,
iconVisible,
}) => {
return (
<div onClick={onClick} className={styles.loginButton}>
<div className={styles.icon}>
<img src={googleIcon} />
</div>
{iconVisible && (
<div className={styles.icon}>
<img src={googleIcon} />
</div>
)}
<div className={styles.text}>
<span>Register</span>
<span>{text}</span>
</div>
{/* <div
className="g_id_signin"
Expand Down
2 changes: 1 addition & 1 deletion src/components/eventcard/EventCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Link } from "react-router-dom";
import style from "./EventCard.module.css";
import { _Event } from "../../types";
import { _Event } from "../../utils/types";
interface EventCardProps {
event: _Event;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/eventlist/EventList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import style from "./EventList.module.css";
import { useEffect, useState } from "react";
import EventCard from "../eventcard/EventCard";
import { getEvents } from "../../apis/eventApi";
import { _Event } from "../../types";
import { _Event } from "../../utils/types";
import { useLoader } from "../toploader/useLoader";
import { useToast } from "../toast/useToast";
interface EventListProps {}
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import style from "./Sidebar.module.css";
import { _Event } from "../../types";
import { _Event } from "../../utils/types";

interface SidebarProps {
state: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/toast/Toast.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import style from "./Toast.module.css";
import { _Event } from "../../types";
import { _Event } from "../../utils/types";
import { useEffect } from "react";
import { useToast } from "./useToast";
interface ToastProps {}
Expand Down
3 changes: 2 additions & 1 deletion src/components/topbar/topbar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
position: relative;
/* background: red; */
.account {
width: auto;
display: flex;
align-items: center;
justify-content: center;
Expand Down Expand Up @@ -35,7 +36,7 @@

.desktop {
display: none;
width: calc(100% - 140px);
width: calc(100% - 100px);
padding: 10px 50px;

.menuItems {
Expand Down
37 changes: 34 additions & 3 deletions src/components/topbar/topbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Link, useNavigate } from "react-router-dom";
import LoginButton from "../buttons/LoginButton/LoginButton";
import style from "./topbar.module.css";
import logo from "../../assets/logo.png";
import React from "react";
interface TopBarProps {
theme: string;
setTheme: (theme: string) => void;
Expand All @@ -15,10 +16,32 @@ const TopBar: React.FC<TopBarProps> = ({
setSidebarState,
sidebarState,
}) => {
const [text, setText] = React.useState<string>("Register");
const [link, setLink] = React.useState<string>("");
const [iconVisible, setIconVisible] = React.useState<boolean>(true);
const redirect = useNavigate();

const handleLoginClick = () => {
redirect("/register");
redirect(link);
};
React.useEffect(() => {
var step = localStorage.getItem("step") as any as number;
if (step)
if (step == 1) {
setText("Continue Registration");
setLink("/register/details");
setIconVisible(false);
return;
} else if (step == 2) {
setText("Dashboard");
setLink("/dashboard");
setIconVisible(false);
return;
}
setText("Register");
setLink("/register");
setIconVisible(true);
});
return (
<>
<div className={style.topbar + " " + style.mobile}>
Expand All @@ -44,7 +67,11 @@ const TopBar: React.FC<TopBarProps> = ({
<i className="bi bi-sun"></i>
)}
</span>
<LoginButton onClick={handleLoginClick} />
<LoginButton
onClick={handleLoginClick}
text={text}
iconVisible={iconVisible}
/>
</div>
</div>

Expand Down Expand Up @@ -80,7 +107,11 @@ const TopBar: React.FC<TopBarProps> = ({
<i className="bi bi-sun"></i>
)}
</span>
<LoginButton onClick={handleLoginClick} />
<LoginButton
onClick={handleLoginClick}
text={text}
iconVisible={iconVisible}
/>
</div>
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/components/usercard/UserCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import style from "./UserCard.module.css";
import { _Event, _UserDetails } from "../../types";
import { _Event, _UserDetails } from "../../utils/types";
import defaultProfile from "../../assets/frlIf.png";

interface UserCardProps {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { userDetails } from "../../apis/userApi";
import { useLoader } from "../../components/toploader/useLoader";
import { useToast } from "../../components/toast/useToast";
import { useNavigate } from "react-router-dom";
import { _UserDetails } from "../../types";
import { _UserDetails } from "../../utils/types";
import UserCard from "../../components/usercard/UserCard";
import EventList from "../../components/eventlist/EventList";
import { myEvents } from "../../apis/eventApi";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/event/Event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import style from "./Event.module.css";
// import SecondaryButton from '../../components/buttons/secondary_button/SecondaryButton';
import Footer from "../../components/footer/Footer";
import { useEffect, useState } from "react";
import { _EventInfo } from "../../types";
import { _EventInfo } from "../../utils/types";
import { getEvents } from "../../apis/eventApi";
import { useParams } from "react-router-dom";
import { useLoader } from "../../components/toploader/useLoader";
Expand Down
7 changes: 6 additions & 1 deletion src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import style from "./Login.module.css";
import { Link, useNavigate } from "react-router-dom";
// import logo from "../../assets/Logo KBM.png";
import alien from "../../assets/dehill-spacelove-1-dribble.gif";
import { _EventInfo, _UserDetails, _UserLogin, _UserStep1 } from "../../types";
import {
_EventInfo,
_UserDetails,
_UserLogin,
_UserStep1,
} from "../../utils/types";
import { loginEmail } from "../../apis/userApi";
import { useLoader } from "../../components/toploader/useLoader";
import { useToast } from "../../components/toast/useToast";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/register/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import style from "./Register.module.css";
import { Link, useNavigate } from "react-router-dom";
// import logo from "../../assets/Logo KBM.png";
import alien from "../../assets/dehill-spacelove-1-dribble.gif";
import { _EventInfo, _UserDetails, _UserStep1 } from "../../types";
import { _EventInfo, _UserDetails, _UserStep1 } from "../../utils/types";
import { createAccount } from "../../apis/userApi";
import { useLoader } from "../../components/toploader/useLoader";
import { useToast } from "../../components/toast/useToast";
Expand Down
7 changes: 6 additions & 1 deletion src/pages/register/RegisterStep2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import style from "./Register.module.css";
import { Link, useNavigate } from "react-router-dom";
// import logo from "../../assets/Logo KBM.png";
import alien from "../../assets/dehill-spacelove-1-dribble.gif";
import { _EventInfo, _UserDetails, _UserStep1, _UserStep2 } from "../../types";
import {
_EventInfo,
_UserDetails,
_UserStep1,
_UserStep2,
} from "../../utils/types";
import { useLoader } from "../../components/toploader/useLoader";
import { useToast } from "../../components/toast/useToast";
import { completeRegistration } from "../../apis/userApi";
Expand Down
File renamed without changes.

0 comments on commit 24f69b9

Please sign in to comment.