-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from ahsanzizan/main
Major fixes in organisasi segment
- Loading branch information
Showing
26 changed files
with
170 additions
and
268 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
prisma/migrations/20240612030730_add_organisasi_image_description/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `image_description` to the `Organisasi` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE `Organisasi` ADD COLUMN `image_description` VARCHAR(191) NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
import { Organisasi_Type } from "@prisma/client"; | ||
|
||
import { findOrganisasi } from "@/utils/database/organisasi.query"; | ||
import { findLatestPeriod } from "@/utils/database/period.query"; | ||
|
||
export default async function Edit({ | ||
params, | ||
}: { | ||
params: { organisasi: string }; | ||
}) { | ||
console.log(params); | ||
const latestPeriod = await findLatestPeriod(); | ||
const organisasi = await findOrganisasi({ | ||
organisasi_period_id: { | ||
period_id: latestPeriod.id, | ||
organisasi: params.organisasi as Organisasi_Type, | ||
}, | ||
}); | ||
|
||
console.log(organisasi); | ||
|
||
return <></>; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import { H1 } from "@/app/_components/global/Text"; | ||
|
||
export default function SubOrgan() { | ||
return <H1>Sub-organ</H1>; | ||
export default function SuborAdmin() { | ||
return ( | ||
<> | ||
<H1>TOLONG DISLICE</H1> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Organisasi_Type } from "@prisma/client"; | ||
import { notFound } from "next/navigation"; | ||
|
||
import { findOrganisasi } from "@/utils/database/organisasi.query"; | ||
import { findPeriod } from "@/utils/database/period.query"; | ||
|
||
export default async function OrganisasiByPeriod({ | ||
param, | ||
}: { | ||
param: { slug: string; period: string }; | ||
}) { | ||
const period = await findPeriod(param.period); | ||
if (!period) return notFound(); | ||
|
||
const organisasi = await findOrganisasi({ | ||
organisasi_period_id: { | ||
organisasi: param.slug.toUpperCase() as Organisasi_Type, | ||
period_id: period.id, | ||
}, | ||
}); | ||
console.log(organisasi); | ||
|
||
return <></>; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/app/(main)/organisasi/[slug]/components/parts/Overview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { SelectField } from "@/app/_components/global/Input"; | ||
import { H2, P } from "@/app/_components/global/Text"; | ||
import { SectionWrapper } from "@/app/_components/global/Wrapper"; | ||
|
||
export default function Overview() { | ||
return ( | ||
<SectionWrapper id={"overview"}> | ||
<div className="flex flex-col gap-[58px] w-full"> | ||
<div className="w-full flex flex-col gap-[18px]"> | ||
<div className="flex md:gap-0 items-center justify-between"> | ||
<div className="flex flex-col gap-[44px]"> | ||
<div className="bg-primary-50 rounded-full w-[106px] h-[106px] border border-primary-400 flex justify-center items-center"></div> | ||
<H2 className="font-bold">Media Moklet</H2> | ||
</div> | ||
<SelectField | ||
name="Periode" | ||
options={[{ label: "2023/2024", value: "2023/2024" }]} | ||
/> | ||
</div> | ||
<P> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam | ||
volutpat tellus quis urna gravida, quis ultrices arcu consequat. | ||
Praesent aliquet ante molestie faucibus facilisis. Integer | ||
fermentum, sapien ac tempor tempor. | ||
</P> | ||
</div> | ||
</div> | ||
</SectionWrapper> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Organisasi_Type } from "@prisma/client"; | ||
|
||
import { findOrganisasi } from "@/utils/database/organisasi.query"; | ||
import { findLatestPeriod } from "@/utils/database/period.query"; | ||
import { findNewestPost } from "@/utils/database/post.query"; | ||
|
||
import Contact from "./components/parts/Contact"; | ||
import OrgGallery from "./components/parts/Gallery"; | ||
import Overview from "./components/parts/Overview"; | ||
import RelatedNews from "./components/parts/RelatedNews"; | ||
import Structure from "./components/parts/Stucture"; | ||
import VisiMisi from "./components/parts/VisiMisi"; | ||
|
||
const image = "https://placehold.co/750x500?text=1"; | ||
|
||
export default async function Organ({ params }: { params: { slug: string } }) { | ||
const organisasiType = params.slug.toUpperCase() as Organisasi_Type; | ||
const latestPeriod = await findLatestPeriod(); | ||
const organisasi = await findOrganisasi({ | ||
organisasi_period_id: { | ||
organisasi: organisasiType, | ||
period_id: latestPeriod.id, | ||
}, | ||
}); | ||
const relatedNews = await findNewestPost(5, { | ||
tags: { some: { tagName: organisasiType } }, | ||
}); | ||
|
||
return ( | ||
<> | ||
<Overview /> | ||
<VisiMisi /> | ||
<Structure /> | ||
<OrgGallery image={image} /> | ||
<RelatedNews data={relatedNews} orgName={organisasiType} /> | ||
<Contact /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
src/app/(main)/sub-organ/page.tsx → src/app/(main)/organisasi/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.