mirror of
https://github.com/SrIzan10/hctv.git
synced 2026-06-06 00:56:56 +00:00
fix: skyfall feedback stuff
This commit is contained in:
@@ -40,7 +40,6 @@ export default async function RootLayout({
|
||||
{/* this promise is ugly but i'm lazy to fix the type errors */}
|
||||
<Navbar editLivestream={Promise.resolve(<EditLivestream />)} />
|
||||
<div className="flex flex-1 pt-16">
|
||||
{' '}
|
||||
{/* pt-16 for navbar height */}
|
||||
<Sidebar className="pt-16" />
|
||||
<main className="flex-1 overflow-auto">{children}</main>
|
||||
|
||||
@@ -55,15 +55,16 @@ export default function EditLivestreamDialog(props: Props) {
|
||||
|
||||
React.useEffect(() => {
|
||||
if (data && selectedChannel) {
|
||||
console.log('data', data);
|
||||
const stream = data.find((stream) => stream.username === selectedChannel);
|
||||
setStreamInfo(stream);
|
||||
}
|
||||
}, [data, selectedChannel]);
|
||||
|
||||
React.useEffect(() => {
|
||||
console.log(selectedChannel);
|
||||
}, [selectedChannel]);
|
||||
if (props.ownedChannels.length > 0 && !selectedChannel) {
|
||||
setSelectedChannel(props.ownedChannels[0].name);
|
||||
}
|
||||
}, [props.ownedChannels, selectedChannel]);
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
@@ -88,7 +89,11 @@ export default function EditLivestreamDialog(props: Props) {
|
||||
>
|
||||
HOW TO STREAM (github gist link)
|
||||
</Link>
|
||||
<ChannelSelect channelList={props.ownedChannels} onSelect={setSelectedChannel} />
|
||||
<ChannelSelect
|
||||
channelList={props.ownedChannels}
|
||||
onSelect={setSelectedChannel}
|
||||
value={selectedChannel}
|
||||
/>
|
||||
{streamInfo && data ? (
|
||||
<Form username={selectedChannel} streamInfo={streamInfo} />
|
||||
) : (
|
||||
@@ -143,7 +148,7 @@ function FormSkeleton() {
|
||||
export function ChannelSelect(props: SelectProps) {
|
||||
const { channelList } = props;
|
||||
return (
|
||||
<Select onValueChange={props.onSelect}>
|
||||
<Select onValueChange={props.onSelect} value={props.value}>
|
||||
<SelectTrigger className="w-[180px]">
|
||||
<SelectValue placeholder="Channel" />
|
||||
</SelectTrigger>
|
||||
@@ -173,5 +178,6 @@ interface FormProps {
|
||||
}
|
||||
interface SelectProps {
|
||||
channelList: Channel[];
|
||||
value?: string;
|
||||
onSelect: (value: string) => void;
|
||||
}
|
||||
|
||||
@@ -38,10 +38,10 @@ export default function Navbar(props: Props) {
|
||||
return (
|
||||
<>
|
||||
<nav className="flex items-center h-16 px-4 border-b gap-3 w-full z-20 fixed top-0 left-0 shadow-md bg-mantle">
|
||||
<div className="flex items-center">
|
||||
<div className="flex items-center space-x-5">
|
||||
<SidebarTrigger />
|
||||
<Link href="/" className="flex items-center">
|
||||
<Button>hackclub.tv</Button>
|
||||
<Button variant={'ghost'}>hackclub.tv</Button>
|
||||
</Link>
|
||||
</div>
|
||||
<MobileNavbarLinks />
|
||||
@@ -51,7 +51,6 @@ export default function Navbar(props: Props) {
|
||||
</div>
|
||||
<div className="flex-1" />
|
||||
{props.editLivestream}
|
||||
<ThemeSwitcher />
|
||||
{user ? (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild className="cursor-pointer">
|
||||
@@ -73,6 +72,10 @@ export default function Navbar(props: Props) {
|
||||
Sign out
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuGroup>
|
||||
<ThemeSwitcher />
|
||||
</DropdownMenuGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
) : (
|
||||
|
||||
@@ -34,10 +34,6 @@ export default function Sidebar({ ...props }: React.ComponentProps<typeof UISide
|
||||
|
||||
return (
|
||||
<UISidebar {...props}>
|
||||
<SidebarHeader>
|
||||
<h2 className="text-sm font-medium">FOLLOWED CHANNELS</h2>
|
||||
</SidebarHeader>
|
||||
|
||||
<SidebarContent>
|
||||
<SidebarGroup>
|
||||
<SidebarGroupLabel asChild>
|
||||
@@ -115,10 +111,6 @@ function StreamerItem({ streamer }: { streamer: StreamInfoResponse[0] }) {
|
||||
function SidebarSkeleton({ ...props }: React.ComponentProps<typeof UISidebar>) {
|
||||
return (
|
||||
<UISidebar {...props}>
|
||||
<SidebarHeader>
|
||||
<h2 className="text-sm font-medium">FOLLOWED CHANNELS</h2>
|
||||
</SidebarHeader>
|
||||
|
||||
<SidebarContent>
|
||||
<SidebarGroup>
|
||||
<SidebarGroupLabel asChild>
|
||||
|
||||
Reference in New Issue
Block a user