Skip to content

Commit

Permalink
Merge pull request #84 from NeuralTeam/feature/update-education-page
Browse files Browse the repository at this point in the history
Feature/update education page
  • Loading branch information
Osbornnnnn authored Aug 30, 2024
2 parents a3b3f52 + 7985cb2 commit 8c3661d
Show file tree
Hide file tree
Showing 16 changed files with 845 additions and 260 deletions.
22 changes: 11 additions & 11 deletions src/app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ const AboutPage = () => {
<div className="space-y-4 pr-[70px]">
<h1 className="text-2xl font-bold">Галерея</h1>
<div className="grid w-full grid-cols-4 gap-5">
{Array.from({ length: 11 }).map((_, i) => (
<NewsOpenPhotoDialog key={i} isOpen={1 == i + 100} mediaId={i + 100} photo={cardNewsPlug}>
<Image
src={cardNewsPlug}
priority={false}
placeholder="blur"
alt="#"
className="aspect-video min-h-[100px] rounded-[10px] object-cover transition duration-200 hover:scale-105"
/>
</NewsOpenPhotoDialog>
))}
{/*{Array.from({ length: 11 }).map((_, i) => (*/}
{/* <NewsOpenPhotoDialog key={i} isOpen={1 == i + 100} mediaId={i + 100} photo={cardNewsPlug}>*/}
{/* <Image*/}
{/* src={cardNewsPlug}*/}
{/* priority={false}*/}
{/* placeholder="blur"*/}
{/* alt="#"*/}
{/* className="aspect-video min-h-[100px] rounded-[10px] object-cover transition duration-200 hover:scale-105"*/}
{/* />*/}
{/* </NewsOpenPhotoDialog>*/}
{/*))}*/}
</div>
</div>
</div>
Expand Down
16 changes: 9 additions & 7 deletions src/app/news/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface IPost {
title: string;
body: string;
preview_picture: string | null;
media_files: string[] | null;
type: number;
topic: { id: number; title: string } | null;
released_at: number;
Expand Down Expand Up @@ -77,6 +78,7 @@ const RecommendedPosts = async () => {
id={`${slugifyReplace(data.title, { lower: true, strict: true })}-${data.id}`}
title={data.title}
type={data.type}
img={data.preview_picture}
createdAt={data.released_at}
/>
))}
Expand Down Expand Up @@ -122,10 +124,10 @@ const NewsIDPage = async ({ params, searchParams }: { params: { id: string }; se
<div className="space-y-2">
<div className="flex items-center space-x-8">
<p className="text-[14px] font-normal leading-[16px] text-[#030303]">{fmtDate}</p>
<div className="flex items-center space-x-1">
<Eye size={20} strokeWidth={2} />
<p className="text-[14px] font-normal leading-[16px] text-[#030303]">1234</p>
</div>
{/*<div className="flex items-center space-x-1">*/}
{/* <Eye size={20} strokeWidth={2} />*/}
{/* <p className="text-[14px] font-normal leading-[16px] text-[#030303]">1234</p>*/}
{/*</div>*/}
</div>
{post.topic != null && (
<div className="flex text-[17px] font-normal leading-[20px] text-[#7C7C7C]">
Expand Down Expand Up @@ -159,7 +161,7 @@ const NewsIDPage = async ({ params, searchParams }: { params: { id: string }; se
<h1 className="text-[28px] font-medium leading-[32px] text-[#030303]">{post.title}</h1>

<div className="space-y-8">
<NewsOpenPhotoDialog isOpen={searchParams.mediaId == 0} mediaId={0} photo={cardNewsPlug}>
<NewsOpenPhotoDialog isOpen={searchParams.mediaId == 0} mediaId={0} photo={post.preview_picture}>
<div className="overflow-hidden rounded-[10px]">
<Image
src={
Expand All @@ -168,7 +170,7 @@ const NewsIDPage = async ({ params, searchParams }: { params: { id: string }; se
: `${process.env.NEXT_PUBLIC_API_DOMAIN}/v1/storage/${post.preview_picture}?bucket=posts`
}
width={1920}
height={250}
height={1080}
priority={true}
placeholder="empty"
alt="#"
Expand All @@ -181,7 +183,7 @@ const NewsIDPage = async ({ params, searchParams }: { params: { id: string }; se
<MDXRemote source={post.body} />
</div>

<NewsGallery mediaId={searchParams.mediaId} photoList={Array.from({ length: 11 }).map(() => cardNewsPlug)} />
{post.media_files !== null && <NewsGallery mediaId={searchParams.mediaId} photoList={post.media_files} />}
</div>

<ShareBlock />
Expand Down
4 changes: 3 additions & 1 deletion src/app/news/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const NewsPage = async ({
}>) => {
const postType = searchParams.type === undefined ? 1 : +searchParams.type;
const page = searchParams.page === undefined ? 1 : +searchParams.page;
const perPage = searchParams.perPage === undefined ? 3 : +searchParams.perPage;
const perPage = searchParams.perPage === undefined ? 10 : +searchParams.perPage;
const topic = searchParams.topic === undefined ? 0 : +searchParams.topic;

const url = new URL(`${process.env.NEXT_PUBLIC_API_DOMAIN}/v1/posts?type=${postType}`);
Expand Down Expand Up @@ -100,6 +100,7 @@ const NewsPage = async ({
id={`${slugifyReplace(data.title, { lower: true, strict: true })}-${data.id}`}
type={2}
title={data.title}
img={data.preview_picture}
createdAt={data.released_at}
/>
))}
Expand All @@ -110,6 +111,7 @@ const NewsPage = async ({
id={`${slugifyReplace(data.title, { lower: true, strict: true })}-${data.id}`}
type={1}
title={data.title}
img={data.preview_picture}
createdAt={data.released_at}
/>
))}
Expand Down
Loading

0 comments on commit 8c3661d

Please sign in to comment.