Skip to content

Commit f239b20

Browse files
committed
Improve sign-in and auth
1 parent de3a3d6 commit f239b20

File tree

6 files changed

+189
-18
lines changed

6 files changed

+189
-18
lines changed

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@dnd-kit/utilities": "^3.2.2",
1919
"@radix-ui/react-avatar": "^1.1.3",
2020
"@radix-ui/react-dialog": "^1.1.6",
21+
"@radix-ui/react-dropdown-menu": "^2.1.6",
2122
"@radix-ui/react-popover": "^1.1.6",
2223
"@radix-ui/react-switch": "^1.1.3",
2324
"@radix-ui/react-tooltip": "^1.1.8",

web/pnpm-lock.yaml

Lines changed: 140 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/src/components/MusicRadio.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ export const MusicRadio: FC = () => {
345345
};
346346

347347
return (
348-
<div className="card w-full">
349-
<div className="flex items-center justify-between mb-4">
348+
<div className="card w-full flex flex-col gap-4">
349+
<div className="flex items-center justify-between">
350350
<h1 className="text-primary">Fishing Village Radio</h1>
351351
<div className="flex items-center gap-2 flex-wrap justify-end">
352352
<button
@@ -362,7 +362,7 @@ export const MusicRadio: FC = () => {
362362
</div>
363363
</div>
364364

365-
<p className="text-secondary mb-2">
365+
<p className="text-secondary grow">
366366
{isIOS ? 'Tap Listen to start the radio' : 'Enjoy the tunes in sync with the party'}
367367
</p>
368368

web/src/components/Navbar.tsx

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ import { FaSteam } from "react-icons/fa";
77
import { BsMusicNoteBeamed } from "react-icons/bs";
88
import { useGuestAuth, useUser } from "@/api/auth";
99
import { Avatar } from "./auth/Avatar";
10-
import { LuLogOut } from "react-icons/lu";
10+
import { LuLogOut, LuSettings } from "react-icons/lu";
1111
import { toast } from "sonner";
1212
import { baseUrl } from "@/api/api";
1313
import { useApp } from '@/hooks/context';
14+
import {
15+
DropdownMenu,
16+
DropdownMenuContent,
17+
DropdownMenuItem,
18+
DropdownMenuTrigger
19+
} from "@radix-ui/react-dropdown-menu";
20+
import { NotImplemented } from "./modal/NotImplemented";
1421

1522
export const Navbar = () => {
1623
return (
@@ -49,27 +56,47 @@ export const UserProfile: FC<{}> = () => {
4956

5057
return (
5158
<div className="flex items-center gap-1 text-ellipsis overflow-hidden">
52-
<div className="flex items-center gap-1">
53-
<Avatar src={user?.avatar_url} seed={user?.user_id} />
54-
<span className="break-words block overflow-hidden text-ellipsis whitespace-nowrap">{user?.name}</span>
55-
</div>
56-
<button className="button flex items-center gap-1" onClick={logout}>
57-
<LuLogOut className="size-4" />
58-
<span className="hidden sm:block">Logout</span>
59-
</button>
59+
<DropdownMenu>
60+
<DropdownMenuTrigger asChild>
61+
<button className="flex items-center gap-1 cursor-pointer outline-none px-3 mr-2 button border-b border-b-primarybg">
62+
<Avatar src={user?.avatar_url} seed={user?.user_id} />
63+
<span className="break-words block overflow-hidden text-ellipsis whitespace-nowrap">{user?.name}</span>
64+
</button>
65+
</DropdownMenuTrigger>
66+
<DropdownMenuContent
67+
align="end"
68+
sideOffset={5}
69+
className="bg-primary border border-tertiary rounded-md p-2 shadow-md z-50 min-w-[200px]"
70+
>
71+
<DropdownMenuItem className="focus:outline-none focus:bg-secondary rounded-md">
72+
<NotImplemented>
73+
<button className="button flex items-center gap-2 w-full">
74+
<LuSettings className="size-4" />
75+
<span>Preferences</span>
76+
</button>
77+
</NotImplemented>
78+
</DropdownMenuItem>
79+
<DropdownMenuItem className="focus:outline-none focus:bg-secondary rounded-md">
80+
<button className="button button-rust flex items-center gap-2 w-full" onClick={logout}>
81+
<LuLogOut className="size-4" />
82+
<span>Logout</span>
83+
</button>
84+
</DropdownMenuItem>
85+
</DropdownMenuContent>
86+
</DropdownMenu>
6087
</div>
6188
);
6289
};
6390

6491
export const LoginModal: FC = () => {
6592
const { isLoginOpen, closeLogin, openLogin } = useApp();
66-
93+
6794
return (
6895
<Dialog open={isLoginOpen} onOpenChange={closeLogin}>
6996
{/* <DialogTrigger asChild> */}
70-
<button className="button" onClick={openLogin}>
71-
<span>Login</span>
72-
</button>
97+
<button className="button" onClick={openLogin}>
98+
<span>Login</span>
99+
</button>
73100
{/* </DialogTrigger> */}
74101
<Modal size="medium">
75102
<LoginModalContent />

web/src/components/party/codes/CodeEntryMod.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const CodeEntryMod: FC<{}> = () => {
1010
const results = codes.slice(0, codeCount);
1111

1212
return (
13-
<div className="card h-fit w-full flex flex-col gap-2 !pb-2" style={{ gridColumn: '-2 / -1' }}>
13+
<div className="card w-full flex flex-col gap-2 !pb-2" style={{ gridColumn: '-2 / -1' }}>
1414
<div className="flex items-center justify-between">
1515
<h1 className="text-primary">Code Entry (WIP)</h1>
1616
<div className="flex items-center gap-1">
@@ -22,7 +22,7 @@ export const CodeEntryMod: FC<{}> = () => {
2222
</ToolTip>
2323
</div>
2424
</div>
25-
<div className="w-full -mx-4 px-4 box-content bg-primary py-2">
25+
<div className="w-full -mx-4 px-4 box-content bg-primary py-2 grow">
2626
<ul className="space-y-1">
2727
{
2828
results.map((code) => (

web/tailwind.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ export default {
1111
colors: {
1212
accent: '#CCC46A',
1313
primary: '#F5F5F5',
14+
primarybg: '#3F3D3C',
1415
secondary: '#858585',
16+
secondarybg: '#53504D',
17+
tertiary: '#2d2b29',
1518
rust: '#AA4735',
1619
'rust-active': '#852E1E',
1720
// background: 'var(--theme-bg-color)',

0 commit comments

Comments
 (0)