mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-13 20:15:35 +01:00
fix branding
This commit is contained in:
23
packages/web/src/components/BrandHeading.tsx
Normal file
23
packages/web/src/components/BrandHeading.tsx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
|
import { useThemeStore } from "@rahoot/web/stores/theme"
|
||||||
|
import clsx from "clsx"
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
className?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const BrandHeading = ({ className }: Props) => {
|
||||||
|
const { brandName } = useThemeStore()
|
||||||
|
const label = brandName || "Rahoot!"
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={clsx("text-center", className)}>
|
||||||
|
<div className="inline-flex rounded-md bg-white/90 px-4 py-2 text-3xl font-black text-[#f7931e] shadow-sm">
|
||||||
|
{label}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default BrandHeading
|
||||||
@@ -37,7 +37,7 @@ const GameWrapper = ({
|
|||||||
const { isConnected } = useSocket()
|
const { isConnected } = useSocket()
|
||||||
const { player } = usePlayerStore()
|
const { player } = usePlayerStore()
|
||||||
const { questionStates, setQuestionStates } = useQuestionStore()
|
const { questionStates, setQuestionStates } = useQuestionStore()
|
||||||
const { backgroundUrl, brandName, setBackground, setBrandName } = useThemeStore()
|
const { backgroundUrl, setBackground, setBrandName } = useThemeStore()
|
||||||
const [isDisabled, setIsDisabled] = useState(false)
|
const [isDisabled, setIsDisabled] = useState(false)
|
||||||
const next = statusName ? MANAGER_SKIP_BTN[statusName] : null
|
const next = statusName ? MANAGER_SKIP_BTN[statusName] : null
|
||||||
|
|
||||||
@@ -109,12 +109,6 @@ const GameWrapper = ({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="flex flex-1 items-center justify-center">
|
|
||||||
<span className="rounded-md bg-white/90 px-3 py-1 text-sm font-semibold text-gray-800 shadow">
|
|
||||||
{brandName}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{manager && next && (
|
{manager && next && (
|
||||||
<Button
|
<Button
|
||||||
className={clsx("self-end bg-white px-4 text-black!", {
|
className={clsx("self-end bg-white px-4 text-black!", {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import Button from "@rahoot/web/components/Button"
|
import Button from "@rahoot/web/components/Button"
|
||||||
import Form from "@rahoot/web/components/Form"
|
import Form from "@rahoot/web/components/Form"
|
||||||
import Input from "@rahoot/web/components/Input"
|
import Input from "@rahoot/web/components/Input"
|
||||||
|
import BrandHeading from "@rahoot/web/components/BrandHeading"
|
||||||
import { useEvent } from "@rahoot/web/contexts/socketProvider"
|
import { useEvent } from "@rahoot/web/contexts/socketProvider"
|
||||||
import { KeyboardEvent, useState } from "react"
|
import { KeyboardEvent, useState } from "react"
|
||||||
import toast from "react-hot-toast"
|
import toast from "react-hot-toast"
|
||||||
@@ -27,15 +28,18 @@ const ManagerPassword = ({ onSubmit }: Props) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form>
|
<div className="flex w-full max-w-xl flex-col items-center gap-6">
|
||||||
<Input
|
<BrandHeading />
|
||||||
type="password"
|
<Form>
|
||||||
onChange={(e) => setPassword(e.target.value)}
|
<Input
|
||||||
onKeyDown={handleKeyDown}
|
type="password"
|
||||||
placeholder="Manager password"
|
onChange={(e) => setPassword(e.target.value)}
|
||||||
/>
|
onKeyDown={handleKeyDown}
|
||||||
<Button onClick={handleSubmit}>Submit</Button>
|
placeholder="Manager password"
|
||||||
</Form>
|
/>
|
||||||
|
<Button onClick={handleSubmit}>Submit</Button>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
13
packages/web/src/components/game/join/BrandShell.tsx
Normal file
13
packages/web/src/components/game/join/BrandShell.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
|
import BrandHeading from "@rahoot/web/components/BrandHeading"
|
||||||
|
import { PropsWithChildren } from "react"
|
||||||
|
|
||||||
|
const BrandShell = ({ children }: PropsWithChildren) => (
|
||||||
|
<div className="flex min-h-screen flex-col items-center justify-center gap-6 px-4">
|
||||||
|
<BrandHeading />
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default BrandShell
|
||||||
@@ -3,6 +3,7 @@ import Form from "@rahoot/web/components/Form"
|
|||||||
import Input from "@rahoot/web/components/Input"
|
import Input from "@rahoot/web/components/Input"
|
||||||
import { useEvent, useSocket } from "@rahoot/web/contexts/socketProvider"
|
import { useEvent, useSocket } from "@rahoot/web/contexts/socketProvider"
|
||||||
import { usePlayerStore } from "@rahoot/web/stores/player"
|
import { usePlayerStore } from "@rahoot/web/stores/player"
|
||||||
|
import BrandShell from "@rahoot/web/components/game/join/BrandShell"
|
||||||
import { KeyboardEvent, useState } from "react"
|
import { KeyboardEvent, useState } from "react"
|
||||||
|
|
||||||
const Room = () => {
|
const Room = () => {
|
||||||
@@ -25,14 +26,16 @@ const Room = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form>
|
<BrandShell>
|
||||||
|
<Form>
|
||||||
<Input
|
<Input
|
||||||
onChange={(e) => setInvitation(e.target.value)}
|
onChange={(e) => setInvitation(e.target.value)}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
placeholder="PIN Code here"
|
placeholder="PIN Code here"
|
||||||
/>
|
/>
|
||||||
<Button onClick={handleJoin}>Submit</Button>
|
<Button onClick={handleJoin}>Submit</Button>
|
||||||
</Form>
|
</Form>
|
||||||
|
</BrandShell>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { STATUS } from "@rahoot/common/types/game/status"
|
|||||||
import Button from "@rahoot/web/components/Button"
|
import Button from "@rahoot/web/components/Button"
|
||||||
import Form from "@rahoot/web/components/Form"
|
import Form from "@rahoot/web/components/Form"
|
||||||
import Input from "@rahoot/web/components/Input"
|
import Input from "@rahoot/web/components/Input"
|
||||||
|
import BrandShell from "@rahoot/web/components/game/join/BrandShell"
|
||||||
import { useEvent, useSocket } from "@rahoot/web/contexts/socketProvider"
|
import { useEvent, useSocket } from "@rahoot/web/contexts/socketProvider"
|
||||||
import { usePlayerStore } from "@rahoot/web/stores/player"
|
import { usePlayerStore } from "@rahoot/web/stores/player"
|
||||||
|
|
||||||
@@ -42,14 +43,16 @@ const Username = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form>
|
<BrandShell>
|
||||||
<Input
|
<Form>
|
||||||
onChange={(e) => setUsername(e.target.value)}
|
<Input
|
||||||
onKeyDown={handleKeyDown}
|
onChange={(e) => setUsername(e.target.value)}
|
||||||
placeholder="Username here"
|
onKeyDown={handleKeyDown}
|
||||||
/>
|
placeholder="Username here"
|
||||||
<Button onClick={handleLogin}>Submit</Button>
|
/>
|
||||||
</Form>
|
<Button onClick={handleLogin}>Submit</Button>
|
||||||
|
</Form>
|
||||||
|
</BrandShell>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user