Skip to content

Commit

Permalink
Merge pull request #14 from azeddine-hmd/dev
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
azeddine-hmd authored Dec 15, 2023
2 parents 8518e14 + e3da6ef commit bdae163
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion frontend/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
21 changes: 10 additions & 11 deletions frontend/components/organisms/add-friends.tsx
Original file line number Diff line number Diff line change
@@ -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<HTMLInputElement>(null);
const [inputText, setInputText] = useState('');
const [inputText, setInputText] = useState("");
const [onLoading, setOnLoading] = useState(false);

useEffect(() => {
inputRef?.current?.focus();
}, [inputRef]);

function onSendFriendRequestClicked(
e: MouseEvent<HTMLButtonElement>,
setLoadingState: React.Dispatch<React.SetStateAction<boolean>>
) {
setLoadingState(true);
setTimeout(() => { console.log('simulating network request'); setLoadingState(false); }, 5000);
function sendFriendRequest() {
setOnLoading(true);
setTimeout(() => {
setOnLoading(false);
}, 5000);
}

return (
Expand All @@ -34,9 +34,8 @@ export default function AddFriends() {
<PrimaryDotLoadingButton
disabled={inputText.length == 0}
className="absolute right-4 top-1/2 h-8 -translate-y-1/2 bg-primary text-sm text-white"
onButtonClicked={(e, setLoadingState) =>
onSendFriendRequestClicked(e, setLoadingState)
}
onClick={() => sendFriendRequest()}
onLoading={onLoading}
>
Send Friend Request
</PrimaryDotLoadingButton>
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/organisms/friends-topbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ export default function FriendsTopBar({
<TopBar>
<div className="flex w-fit gap-2">
<BsPersonFill size="22" className="text-icon" />
<span className="text-white select-none">Friends</span>
<span className="select-none text-white">Friends</span>
</div>

<IconButton
className={twMerge(
"h-6 rounded-[4px] border-2 border-accent p-2 text-[16px] font-medium ",
activeOption === TopBarOptions.AddFriends &&
"border-none text-[#2dc06d] hover:bg-transparent hover:text-[#2dc06d] active:bg-transparent active:text-[#2dc06d]",
"border-none text-[#2dc06d] hover:bg-transparent hover:text-[#2dc06d] active:bg-transparent active:text-[#2dc06d]",
activeOption !== TopBarOptions.AddFriends &&
"bg-accent text-white hover:bg-accent hover:text-white active:bg-accent active:text-white"
"bg-accent text-white hover:bg-accent hover:text-white active:bg-accent active:text-white"
)}
onClick={(e) =>
activeOption !== TopBarOptions.AddFriends &&
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/organisms/server-sidebar.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/organisms/users-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit bdae163

Please sign in to comment.