diff --git a/frontend/app/(auth)/login/page.tsx b/frontend/app/(auth)/login/page.tsx index 4f17e95..3aefcba 100644 --- a/frontend/app/(auth)/login/page.tsx +++ b/frontend/app/(auth)/login/page.tsx @@ -12,7 +12,7 @@ import * as Yup from "yup"; import { useMutation } from "@tanstack/react-query"; import { api } from "@/config"; import { AxiosError } from "axios"; -import { HttpError } from "@/types/http-error"; +import { HttpError } from "@/types/http-error"; type LoginForm = { email: string; diff --git a/frontend/components/organisms/add-friends.tsx b/frontend/components/organisms/add-friends.tsx index 4a14625..85bd602 100644 --- a/frontend/components/organisms/add-friends.tsx +++ b/frontend/components/organisms/add-friends.tsx @@ -1,22 +1,22 @@ -import React, { MouseEvent, useEffect, useRef, useState } from "react"; +import React, { useEffect, useRef, useState } from "react"; import Hr from "../atoms/hr"; import FieldInput from "../atoms/field-input"; import PrimaryDotLoadingButton from "../molecules/primary-dot-loading-button"; export default function AddFriends() { const inputRef = useRef(null); - const [inputText, setInputText] = useState(''); + const [inputText, setInputText] = useState(""); + const [onLoading, setOnLoading] = useState(false); useEffect(() => { inputRef?.current?.focus(); }, [inputRef]); - function onSendFriendRequestClicked( - e: MouseEvent, - setLoadingState: React.Dispatch> - ) { - setLoadingState(true); - setTimeout(() => { console.log('simulating network request'); setLoadingState(false); }, 5000); + function sendFriendRequest() { + setOnLoading(true); + setTimeout(() => { + setOnLoading(false); + }, 5000); } return ( @@ -34,9 +34,8 @@ export default function AddFriends() { - onSendFriendRequestClicked(e, setLoadingState) - } + onClick={() => sendFriendRequest()} + onLoading={onLoading} > Send Friend Request diff --git a/frontend/components/organisms/friends-topbar.tsx b/frontend/components/organisms/friends-topbar.tsx index 2e7d071..15f3639 100644 --- a/frontend/components/organisms/friends-topbar.tsx +++ b/frontend/components/organisms/friends-topbar.tsx @@ -23,16 +23,16 @@ export default function FriendsTopBar({
- Friends + Friends
activeOption !== TopBarOptions.AddFriends && diff --git a/frontend/components/organisms/server-sidebar.tsx b/frontend/components/organisms/server-sidebar.tsx index dbf1c6e..7011873 100644 --- a/frontend/components/organisms/server-sidebar.tsx +++ b/frontend/components/organisms/server-sidebar.tsx @@ -1,6 +1,6 @@ "use client"; -import { BsDiscord, BsRobot, BsTv } from "react-icons/bs"; +import { BsRobot, BsTv } from "react-icons/bs"; import Divider from "../molecules/divider"; import ServerButton from "../molecules/server-button"; import { useState } from "react"; diff --git a/frontend/components/organisms/users-list.tsx b/frontend/components/organisms/users-list.tsx index 0bc1146..c775e89 100644 --- a/frontend/components/organisms/users-list.tsx +++ b/frontend/components/organisms/users-list.tsx @@ -2,7 +2,7 @@ import React, { useState, MouseEvent } from "react"; import SearchField from "../molecules/search-field"; -import { BsCheck, BsCheckCircle, BsCheckCircleFill, BsPersonDash, BsPersonDashFill, BsSearch, BsX } from "react-icons/bs"; +import { BsCheck, BsPersonDashFill, BsSearch, BsX } from "react-icons/bs"; import SearchResults from "../molecules/search-result-new"; import UserListItem from "../molecules/user-list-item"; import { User } from "@/models/user";