Skip to content

Commit

Permalink
Merge branch 'develop' into 728-bug-incorrect-banner-size-on-settings…
Browse files Browse the repository at this point in the history
…-page
  • Loading branch information
Mario-SO authored Jul 25, 2024
2 parents 8d9231a + 0f9421c commit 36a43e0
Show file tree
Hide file tree
Showing 313 changed files with 7,834 additions and 8,474 deletions.
16 changes: 12 additions & 4 deletions packages/app/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
{
"trailingComma": "es5",
"semi": false,
"semi": true,
"singleQuote": true,
"printWidth": 70,
"bracketSameLine": true,
"plugins": ["prettier-plugin-tailwindcss"]
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"endOfLine": "lf",
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css"
}
29 changes: 14 additions & 15 deletions packages/app/app/(legal)/privacy/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Card, CardTitle, CardFooter } from '@/components/ui/card'
import { promises as fs } from 'fs'
import Image from 'next/image'
import Footer from '@/components/Layout/Footer'
import Markdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import { Card, CardTitle, CardFooter } from '@/components/ui/card';
import { promises as fs } from 'fs';
import Image from 'next/image';
import Footer from '@/components/Layout/Footer';
import Markdown from 'react-markdown';
import remarkGfm from 'remark-gfm';

const Terms = async () => {
const year = new Date().getFullYear()
const year = new Date().getFullYear();
const file = await fs.readFile(
process.cwd() + '/public/legal/privacy.md',
'utf8'
)
);

return (
<div>
Expand All @@ -27,18 +27,17 @@ const Terms = async () => {
</CardTitle>
<Markdown
remarkPlugins={[remarkGfm]}
className="prose prose-sm my-5 max-w-full p-4">
className="prose prose-sm my-5 max-w-full p-4"
>
{file}
</Markdown>
</div>
<CardFooter>
© {year} StreamETH International B.V.
</CardFooter>
<CardFooter>© {year} StreamETH International B.V.</CardFooter>
</Card>
</div>
<Footer active={'privacy'} />
</div>
)
}
);
};

export default Terms
export default Terms;
29 changes: 14 additions & 15 deletions packages/app/app/(legal)/terms/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Card, CardTitle, CardFooter } from '@/components/ui/card'
import { promises as fs } from 'fs'
import Image from 'next/image'
import Footer from '@/components/Layout/Footer'
import Markdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import { Card, CardTitle, CardFooter } from '@/components/ui/card';
import { promises as fs } from 'fs';
import Image from 'next/image';
import Footer from '@/components/Layout/Footer';
import Markdown from 'react-markdown';
import remarkGfm from 'remark-gfm';

const Terms = async () => {
const year = new Date().getFullYear()
const year = new Date().getFullYear();
const file = await fs.readFile(
process.cwd() + '/public/legal/terms.md',
'utf8'
)
);

return (
<div>
Expand All @@ -27,18 +27,17 @@ const Terms = async () => {
</CardTitle>
<Markdown
remarkPlugins={[remarkGfm]}
className="prose prose-sm my-5 max-w-full p-4">
className="prose prose-sm my-5 max-w-full p-4"
>
{file}
</Markdown>
</div>
<CardFooter>
© {year} StreamETH International B.V.
</CardFooter>
<CardFooter>© {year} StreamETH International B.V.</CardFooter>
</Card>
</div>
<Footer active={'terms'} />
</div>
)
}
);
};

export default Terms
export default Terms;
45 changes: 20 additions & 25 deletions packages/app/app/(vod)/archive/page.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,50 @@
import { SearchPageProps } from '@/lib/types'
import { fetchOrganization } from '@/lib/services/organizationService'
import { fetchEvent } from '@/lib/services/eventService'
import { redirect } from 'next/navigation'
import {
generalMetadata,
archiveMetadata,
} from '@/lib/utils/metadata'
import { Metadata } from 'next'

export default async function ArchivePage({
searchParams,
}: SearchPageProps) {
import { SearchPageProps } from '@/lib/types';
import { fetchOrganization } from '@/lib/services/organizationService';
import { fetchEvent } from '@/lib/services/eventService';
import { redirect } from 'next/navigation';
import { generalMetadata, archiveMetadata } from '@/lib/utils/metadata';
import { Metadata } from 'next';

export default async function ArchivePage({ searchParams }: SearchPageProps) {
if (searchParams.organization) {
const organization = await fetchOrganization({
organizationSlug: searchParams.organization,
})
});

if (!organization) {
return redirect('/404')
return redirect('/404');
}

return redirect(`/${organization.slug}/videos`)
return redirect(`/${organization.slug}/videos`);
}

if (searchParams.event) {
const event = await fetchEvent({
eventSlug: searchParams.event,
})
});

const organization = await fetchOrganization({
organizationId: event?.organizationId as string,
})
});

if (!event || !organization) {
return redirect('/404')
return redirect('/404');
}

return redirect(`/${organization.slug}/videos`)
return redirect(`/${organization.slug}/videos`);
}

return <>Page moved</>
return <>Page moved</>;
}

export async function generateMetadata({
searchParams,
}: SearchPageProps): Promise<Metadata> {
if (!searchParams.event) return generalMetadata
if (!searchParams.event) return generalMetadata;
const event = await fetchEvent({
eventSlug: searchParams.event,
})
});

if (!event) return generalMetadata
return archiveMetadata({ event })
if (!event) return generalMetadata;
return archiveMetadata({ event });
}
55 changes: 24 additions & 31 deletions packages/app/app/(vod)/watch/page.tsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,41 @@
import { WatchPageProps } from '@/lib/types'
import { Metadata } from 'next'
import { apiUrl } from '@/lib/utils/utils'
import { notFound } from 'next/navigation'
import { generalMetadata, watchMetadata } from '@/lib/utils/metadata'
import { fetchSession } from '@/lib/services/sessionService'
import { redirect } from 'next/navigation'
import { fetchOrganization } from '@/lib/services/organizationService'
import { generateThumbnailAction } from '@/lib/actions/sessions'
export default async function Watch({
searchParams,
}: WatchPageProps) {
if (!searchParams.session) return notFound()
import { WatchPageProps } from '@/lib/types';
import { Metadata } from 'next';
import { apiUrl } from '@/lib/utils/utils';
import { notFound } from 'next/navigation';
import { generalMetadata, watchMetadata } from '@/lib/utils/metadata';
import { fetchSession } from '@/lib/services/sessionService';
import { redirect } from 'next/navigation';
import { fetchOrganization } from '@/lib/services/organizationService';
import { generateThumbnailAction } from '@/lib/actions/sessions';
export default async function Watch({ searchParams }: WatchPageProps) {
if (!searchParams.session) return notFound();
const video = await fetchSession({
session: searchParams.session,
})
});

if (!video) return notFound()
if (!video) return notFound();
const organization = await fetchOrganization({
organizationId: video.organizationId as string,
})
});
if (!organization) {
return notFound()
return notFound();
}

redirect(
`/${organization.slug}/watch?session=${searchParams.session}`
)
return 'loading...'
redirect(`/${organization.slug}/watch?session=${searchParams.session}`);
return 'loading...';
}

export async function generateMetadata({
searchParams,
}: WatchPageProps): Promise<Metadata> {
const response = await fetch(
`${apiUrl()}/sessions/${searchParams.session}`
)
const responseData = await response.json()
const video = responseData.data
const response = await fetch(`${apiUrl()}/sessions/${searchParams.session}`);
const responseData = await response.json();
const video = responseData.data;

if (!searchParams.session) return generalMetadata
if (!searchParams.session) return generalMetadata;

if (!video) return generalMetadata
const thumbnail =
video.coverImage ?? (await generateThumbnailAction(video))
if (!video) return generalMetadata;
const thumbnail = video.coverImage ?? (await generateThumbnailAction(video));

return watchMetadata({ session: video, thumbnail })
return watchMetadata({ session: video, thumbnail });
}
Loading

0 comments on commit 36a43e0

Please sign in to comment.