Skip to content

Commit

Permalink
[frontend] Format code with prettier (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
lim396 authored Feb 29, 2024
1 parent afbea5d commit 1de9332
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion frontend/app/pong/GameList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { useToast } from "@/components/ui/use-toast";
import { useRouter } from "next/navigation";
import { useCallback, useEffect, useMemo, useState } from "react";
import { IoRefresh } from "react-icons/io5";
import { io } from "socket.io-client";
import { GameCard } from "../ui/pong/GameCard";
import { useRouter } from "next/navigation";

export default function GameList() {
const socket = useMemo(() => io("/pong", { forceNew: true }), []);
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/pong/[id]/PongBoard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import { useAuthContext } from "@/app/lib/client-auth";
import { PublicUserEntity } from "@/app/lib/dtos";
import { useUserMode } from "@/app/lib/hooks/useUserMode";
import { Button } from "@/components/ui/button";
import { useTheme } from "next-themes";
Expand All @@ -10,7 +11,6 @@ import { io } from "socket.io-client";
import { PongGame } from "./PongGame";
import PongInformationBoard from "./PongInformationBoard";
import { CANVAS_HEIGHT, CANVAS_WIDTH, TARGET_FRAME_MS } from "./const";
import { PublicUserEntity } from "@/app/lib/dtos";

type Status =
| "too-many-players"
Expand Down
1 change: 0 additions & 1 deletion frontend/app/ui/pong/GameCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import { Avatar } from "@/app/ui/user/avatar";
import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card";
import { TooltipProvider } from "@radix-ui/react-tooltip";
import { PublicUserEntity } from "../../lib/dtos";
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/ui/user/accept-friend-request-button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import { acceptFriendRequest } from "@/app/lib/actions";
import { Button } from "@/components/ui/button";
import { useFormState } from "react-dom";
import { toast } from "@/components/ui/use-toast";
import { useFormState } from "react-dom";

const showErrorToast = () => {
toast({
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/ui/user/add-friend-button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import { addFriend } from "@/app/lib/actions";
import { Button } from "@/components/ui/button";
import { useFormState } from "react-dom";
import { toast } from "@/components/ui/use-toast";
import { useFormState } from "react-dom";

const showErrorToast = () => {
toast({
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/ui/user/avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import { OnlineContext } from "@/app/lib/hooks/useOnlineStatus";
import { Skeleton } from "@/components/ui/skeleton";
import {
Tooltip,
Expand All @@ -9,7 +10,6 @@ import {
} from "@/components/ui/tooltip";
import Link from "next/link";
import { useContext } from "react";
import { OnlineContext } from "@/app/lib/hooks/useOnlineStatus";

export type AvatarSize = "small" | "medium" | "large";

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/ui/user/block-button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import { blockUser } from "@/app/lib/actions";
import { Button } from "@/components/ui/button";
import { useFormState } from "react-dom";
import { toast } from "@/components/ui/use-toast";
import { useFormState } from "react-dom";

const showErrorToast = () => {
toast({
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/ui/user/cancel-friend-request-button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import { cancelFriendRequest } from "@/app/lib/actions";
import { Button } from "@/components/ui/button";
import { useFormState } from "react-dom";
import { toast } from "@/components/ui/use-toast";
import { useFormState } from "react-dom";

const showErrorToast = () => {
toast({
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/ui/user/match-request-button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import { Button } from "@/components/ui/button";
import { useRequestMatch } from "@/app/lib/hooks/useRequestMatch";
import { Button } from "@/components/ui/button";

export default function MatchRequestButton({ id }: { id: number }) {
// TODO: Implement this
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/ui/user/reject-friend-request-button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import { rejectFriendRequest } from "@/app/lib/actions";
import { Button } from "@/components/ui/button";
import { useFormState } from "react-dom";
import { toast } from "@/components/ui/use-toast";
import { useFormState } from "react-dom";

const showErrorToast = () => {
toast({
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/ui/user/remove-friend-button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import { unfriend } from "@/app/lib/actions";
import { Button } from "@/components/ui/button";
import { useFormState } from "react-dom";
import { toast } from "@/components/ui/use-toast";
import { useFormState } from "react-dom";

const showErrorToast = () => {
toast({
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/ui/user/unblock-button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";
import { unblockUser } from "@/app/lib/actions";
import { Button } from "@/components/ui/button";
import { useFormState } from "react-dom";
import { toast } from "@/components/ui/use-toast";
import { useFormState } from "react-dom";

const showErrorToast = () => {
toast({
Expand Down
2 changes: 0 additions & 2 deletions frontend/app/ui/user/user-list.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"use client";

import type { PublicUserEntity } from "@/app/lib/dtos";
import { OnlineContext } from "@/app/lib/hooks/useOnlineStatus";
import { TooltipProvider } from "@/components/ui/tooltip";
import { useContext } from "react";
import { Avatar, AvatarSize } from "./avatar";

export default function UserList({
Expand Down

0 comments on commit 1de9332

Please sign in to comment.