Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛: Fixed Dynamic server usage error #848

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions packages/app/app/[organization]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ import SessionInfoBox from '@/components/sessions/SessionInfoBox';
import ChannelDescription from './components/ChannelDescription';
import { livestreamMetadata, generalMetadata } from '@/lib/utils/metadata';

export const dynamic = 'force-dynamic';

export async function generateStaticParams() {
const organizations = await fetchOrganizations();
const paths = organizations.map((organization) => ({
organization: organization.slug,
}));
return paths;

return organizations
.map((organization) => organization.slug)
.filter((slug): slug is string => typeof slug === 'string')
.map((slug) => ({ organization: slug }));
}

const OrganizationHome = async ({
Expand Down Expand Up @@ -65,12 +68,12 @@ const OrganizationHome = async ({
const stage = sortedStreams.length > 0 ? sortedStreams[0] : null;

return (
<div className="mx-auto w-full max-w-7xl space-y-4 md:p-4">
<div className="mx-auto space-y-4 w-full max-w-7xl md:p-4">
<div className="relative w-full">
{stage ? (
<>
<Player stage={stage} />
<div className="w-full px-4 md:p-0">
<div className="px-4 w-full md:p-0">
<SessionInfoBox
name={stage.name}
description={stage.description ?? ''}
Expand Down Expand Up @@ -100,9 +103,9 @@ const OrganizationHome = async ({
<StreamethLogoWhite />
</div>
)}
<div className="absolute left-0 top-0 h-full w-full bg-gradient-to-t from-black via-transparent to-transparent" />
<div className="absolute bottom-0 left-0 right-0 w-full space-y-2 p-4 text-white">
<div className="flex w-full flex-row justify-between">
<div className="absolute top-0 left-0 w-full h-full bg-gradient-to-t from-black via-transparent to-transparent" />
<div className="absolute right-0 bottom-0 left-0 p-4 space-y-2 w-full text-white">
<div className="flex flex-row justify-between w-full">
<div>
<h2 className="text-2xl font-bold">{organization.name}</h2>
<ChannelDescription description={organization.description} />
Expand All @@ -113,7 +116,7 @@ const OrganizationHome = async ({
</AspectRatio>
)}
</div>
<Card className="w-full space-y-6 border-none bg-white p-4 shadow-none md:p-0">
<Card className="p-4 space-y-6 w-full bg-white border-none shadow-none md:p-0">
<Suspense fallback={<UpcomingStreamsLoading />}>
<UpcomingStreams
organizationId={organization._id}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/components/misc/ConnectWalletButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ConnectWalletButton = ({
return (
<Button variant={'primary'} onClick={show} className={className}>
<span className="px-2 md:px-0">
{isConnected ? ensName ?? truncatedAddress : btnText}
{isConnected ? (ensName ?? truncatedAddress) : btnText}
</span>
</Button>
);
Expand Down
Loading