mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-14 04:25:35 +01:00
refactor(components): use arrow function syntax and improve consistency
This commit is contained in:
@@ -8,7 +8,7 @@ import { useManagerStore } from "@rahoot/web/stores/manager"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { useState } from "react"
|
||||
|
||||
export default function Manager() {
|
||||
const Manager = () => {
|
||||
const { setGameId, setStatus } = useManagerStore()
|
||||
const router = useRouter()
|
||||
const { socket } = useSocket()
|
||||
@@ -40,3 +40,5 @@ export default function Manager() {
|
||||
|
||||
return <SelectQuizz quizzList={quizzList} onSelect={handleCreate} />
|
||||
}
|
||||
|
||||
export default Manager
|
||||
|
||||
@@ -7,7 +7,7 @@ import { usePlayerStore } from "@rahoot/web/stores/player"
|
||||
import { useEffect } from "react"
|
||||
import toast from "react-hot-toast"
|
||||
|
||||
export default function Home() {
|
||||
const Home = () => {
|
||||
const { isConnected, connect } = useSocket()
|
||||
const { player } = usePlayerStore()
|
||||
|
||||
@@ -27,3 +27,5 @@ export default function Home() {
|
||||
|
||||
return <Room />
|
||||
}
|
||||
|
||||
export default Home
|
||||
|
||||
@@ -15,7 +15,7 @@ import { GAME_STATE_COMPONENTS } from "@rahoot/web/utils/constants"
|
||||
import { useParams, useRouter } from "next/navigation"
|
||||
import toast from "react-hot-toast"
|
||||
|
||||
export default function Game() {
|
||||
const Game = () => {
|
||||
const router = useRouter()
|
||||
const { socket } = useSocket()
|
||||
const { gameId: gameIdParam }: { gameId?: string } = useParams()
|
||||
@@ -95,3 +95,5 @@ export default function Game() {
|
||||
|
||||
return <GameWrapper statusName={status.name}>{component}</GameWrapper>
|
||||
}
|
||||
|
||||
export default Game
|
||||
|
||||
@@ -17,7 +17,7 @@ import { GAME_STATE_COMPONENTS_MANAGER } from "@rahoot/web/utils/constants"
|
||||
import { useParams, useRouter } from "next/navigation"
|
||||
import toast from "react-hot-toast"
|
||||
|
||||
export default function ManagerGame() {
|
||||
const ManagerGame = () => {
|
||||
const router = useRouter()
|
||||
const { gameId: gameIdParam }: { gameId?: string } = useParams()
|
||||
const { socket } = useSocket()
|
||||
@@ -131,3 +131,5 @@ export default function ManagerGame() {
|
||||
</GameWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
export default ManagerGame
|
||||
|
||||
@@ -15,15 +15,15 @@ export const metadata: Metadata = {
|
||||
icons: "/icon.svg",
|
||||
}
|
||||
|
||||
export default function RootLayout({ children }: PropsWithChildren) {
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning={true} data-lt-installed="true">
|
||||
<body className={`${montserrat.variable} bg-secondary antialiased`}>
|
||||
<SocketProvider>
|
||||
<main className="text-base-[8px] flex flex-col">{children}</main>
|
||||
<Toaster />
|
||||
</SocketProvider>
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
}
|
||||
const RootLayout = ({ children }: PropsWithChildren) => (
|
||||
<html lang="en" suppressHydrationWarning={true} data-lt-installed="true">
|
||||
<body className={`${montserrat.variable} bg-secondary antialiased`}>
|
||||
<SocketProvider>
|
||||
<main className="text-base-[8px] flex flex-col">{children}</main>
|
||||
<Toaster />
|
||||
</SocketProvider>
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
|
||||
export default RootLayout
|
||||
|
||||
Reference in New Issue
Block a user