Skip to content

Commit

Permalink
watch page has mentions list
Browse files Browse the repository at this point in the history
  • Loading branch information
sphinxrave committed Dec 29, 2024
1 parent bc43c25 commit d540af9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/components/channel/ChannelCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function ChannelCard({
className="flex grow items-center gap-2 md:gap-4"
>
<ChannelImg
className={`h-12 w-auto md:h-20 lg:h-full ${inactive && "opacity-80 saturate-50"}`}
className={`h-12 w-auto md:h-20 lg:h-24 ${inactive && "opacity-80 saturate-50"}`}
channelId={id}
/>
<div className="flex flex-col overflow-hidden">
Expand Down
17 changes: 17 additions & 0 deletions packages/react/src/components/player/MentionsCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ChannelImg } from "../channel/ChannelImg";

export function Mentions({ mentions }: { mentions: ShortChannel[] }) {
return (
<div className="flex flex-row gap-2 rounded-lg bg-base-3 p-4">
{mentions.map((mention) => (
<ChannelImg
key={mention.id}
className="h-14"
channelId={mention.id}
photo={mention.photo}
size={40}
/>
))}
</div>
);
}
16 changes: 10 additions & 6 deletions packages/react/src/routes/watch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { ChatModal } from "@/components/chat/ChatModal";
import { PlayerWrapper } from "@/components/layout/PlayerWrapper";
import { ChatCard } from "@/components/player/ChatCard";
import { Controlbar } from "@/components/player/Controlbar";
import { PlayerDescription } from "@/components/player/PlayerDescription";
import { PlayerRecommendations } from "@/components/player/PlayerRecommendations";
import { Mentions } from "@/components/player/MentionsCard";
import { PlayerDescription as Description } from "@/components/player/PlayerDescription";
import { PlayerRecommendations as Recommendations } from "@/components/player/PlayerRecommendations";
import { PlayerStats } from "@/components/player/PlayerStats";
import { QueueList } from "@/components/player/QueueList";
import { useIsLgAndUp } from "@/hooks/useBreakpoint";
Expand Down Expand Up @@ -50,7 +51,7 @@ export function Watch() {
enabled: !!currentVideo,
placeholderData: () => {
if (location.state?.video && location.state?.video.channel)
return location.state?.video;
return location.state?.video.channel;
},
});

Expand Down Expand Up @@ -134,12 +135,15 @@ export function Watch() {
})}
>
{channel && <ChannelCard size="xs" variant="list" {...channel} />}
{currentVideo?.mentions && (
<Mentions mentions={currentVideo.mentions} />
)}
{!currentVideo?.link?.includes("twitch") &&
currentVideo?.description && (
<PlayerDescription description={currentVideo.description} />
<Description description={currentVideo.description} />
)}
<div className="flex @screen-lg:hidden">
<PlayerRecommendations {...currentVideo} />
<Recommendations {...currentVideo} />
</div>
</div>
</div>
Expand All @@ -156,7 +160,7 @@ export function Watch() {
<ChatCard {...currentVideo} />
</div>
)}
<PlayerRecommendations {...currentVideo} />
<Recommendations {...currentVideo} />
</div>
)}
</div>
Expand Down

0 comments on commit d540af9

Please sign in to comment.