Skip to content

Commit

Permalink
Merge pull request #81 from mokletdev/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
BaniHillabi committed May 20, 2024
2 parents ffa244d + 5885e41 commit 3c7742c
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 84 deletions.
2 changes: 2 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ enum Tipe {
}

enum Posisi {
CERDAS_CERMAT1
CERDAS_CERMAT2
OFFICIAL
DANTON
B1S1
Expand Down
Binary file added public/image/juri_placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/sponsors/Kemenpora.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions src/app/(main)/components/Juri.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import Image from "next/image";
const dummy = {
image: "/image/juri1.png",
name: "Adi prasetyo utomo",
title: "Professional cummer",
title: "Juri",
};

const comingSoon = {
image: "/image/juri_placeholder.png",
name: "Coming Soon!",
title: "",
}

interface JuriCardProps {
image: string;
name: string;
Expand All @@ -17,7 +23,7 @@ interface JuriCardProps {

export function JuriCard({ image, name, title }: Readonly<JuriCardProps>) {
return (
<figure className="relative w-full lg:w-[294px] flex items-center justify-center bg-white rounded-[20px] lg:bg-none lg:rounded-none py-6 lg:py-0">
<figure className="relative w-full lg:w-[294px] flex items-center justify-center bg-white rounded-[20px] lg:bg-transparent lg:rounded-none py-6 lg:py-0">
<div className="relative bg-primary-500 w-[191px] h-[258px] rounded-[24px]">
<Image
src={image}
Expand Down Expand Up @@ -54,9 +60,9 @@ export default function Juri() {
</div>
<div className="relative flex justify-center items-center gap-28 lg:gap-4 flex-col lg:flex-row">
<div className="absolute w-full rounded-[30px] bg-white min-h-[293px] -top-14 hidden lg:block"></div>
<JuriCard image={comingSoon.image} name={comingSoon.name} title={comingSoon.title} />
<JuriCard image={dummy.image} name={dummy.name} title={dummy.title} />
<JuriCard image={dummy.image} name={dummy.name} title={dummy.title} />
<JuriCard image={dummy.image} name={dummy.name} title={dummy.title} />
<JuriCard image={comingSoon.image} name={comingSoon.name} title={comingSoon.title} />
</div>
</div>
</SectionWrapper>
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/components/Kategori.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function Kategori() {
</div>
<div className="flex flex-col gap-2">
<span className="font-bold text-[20px] sm:text-[30px] text-white">
Rp 350.000
Rp 400.000
</span>
<span className="font-semibold text-xs sm:text-[18px] text-white">
Kategori SMP Paskibra
Expand Down
80 changes: 25 additions & 55 deletions src/app/(main)/components/Sponsor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
import { H3, P } from "@/app/components/global/Text";
import SectionWrapper from "@/app/components/global/Wrapper";
import Image from "next/image";
import Link from "next/link";

export function SponsorCard({
ImageSponsor,
Height=34,
Width=154
}: {
ImageSponsor: string;
Height?: number;
Width?: number;
}) {
return (
<Link target="_blank" href={"https://www.kemenpora.go.id/"} className="py-[23px] sm:py-[28px] px-[18px] sm:px-6 bg-white rounded-[20px] justify-center items-center flex flex-col w-[145px] sm:w-[206px] hover:scale-105 duration-500 transition-all">
<Image
src={ImageSponsor}
alt={"waw"}
width={Width}
height={Height}
unoptimized
/>
</Link>
);
}

export default function Sponsor() {
return (
Expand All @@ -11,61 +34,8 @@ export default function Sponsor() {
<P>Sampai bertemu di hari perlombaan!</P>
</div>
<div className="w-full flex gap-[10px] sm:gap-6 justify-center items-center flex-wrap">
<figure className="py-[23px] sm:py-[28px] px-[18px] sm:px-6 bg-white rounded-[20px] justify-center items-center flex flex-col w-[145px] sm:w-[206px]">
<Image
src={"https://dummyimage.com/154x34/ff1290/fff&text=sponsor"}
alt={"waw"}
width={154}
height={34}
unoptimized
/>
</figure>
<figure className="py-[23px] sm:py-[28px] px-[18px] sm:px-6 bg-white rounded-[20px] justify-center items-center flex flex-col w-[145px] sm:w-[206px]">
<Image
src={"https://dummyimage.com/154x34/ff1290/fff&text=sponsor"}
alt={"waw"}
width={154}
height={34}
unoptimized
/>
</figure>
<figure className="py-[23px] sm:py-[28px] px-[18px] sm:px-6 bg-white rounded-[20px] justify-center items-center flex flex-col w-[145px] sm:w-[206px]">
<Image
src={"/sponsors/byu.png"}
alt={"waw"}
width={54}
height={34}
unoptimized
className="w-[38px] h-6 sm:w-[54px] sm:h-[34px]"
/>
</figure>
<figure className="py-[23px] sm:py-[28px] px-[18px] sm:px-6 bg-white rounded-[20px] justify-center items-center flex flex-col w-[145px] sm:w-[206px]">
<Image
src={"https://dummyimage.com/154x34/ff1290/fff&text=sponsor"}
alt={"waw"}
width={154}
height={34}
unoptimized
/>
</figure>
<figure className="py-[23px] sm:py-[28px] px-[18px] sm:px-6 bg-white rounded-[20px] justify-center items-center flex flex-col w-[145px] sm:w-[206px]">
<Image
src={"https://dummyimage.com/154x34/ff1290/fff&text=sponsor"}
alt={"waw"}
width={154}
height={34}
unoptimized
/>
</figure>
<figure className="py-[23px] sm:py-[28px] px-[18px] sm:px-6 bg-white rounded-[20px] justify-center items-center flex flex-col w-[145px] sm:w-[206px]">
<Image
src={"https://dummyimage.com/154x34/ff1290/fff&text=sponsor"}
alt={"waw"}
width={154}
height={34}
unoptimized
/>
</figure>
<SponsorCard ImageSponsor={"sponsors/Kemenpora.png"} Height={34} Width={29}/>

</div>
</div>
</SectionWrapper>
Expand Down
77 changes: 53 additions & 24 deletions src/app/(main)/dashboard/components/ProfileTim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ function TimLayout({ tim }: Readonly<{ tim: TimWithRelations }>) {
const [official] = useState(
tim.anggotas.find((value) => value.posisi === "OFFICIAL")
);
const [cerdas_cermat1] = useState(
tim.anggotas.find((value) => value.posisi === "CERDAS_CERMAT1")
);
const [cerdas_cermat2] = useState(
tim.anggotas.find((value) => value.posisi === "CERDAS_CERMAT2")
);

return (
<div className="block">
Expand All @@ -52,69 +58,92 @@ function TimLayout({ tim }: Readonly<{ tim: TimWithRelations }>) {
</P>
)}
<div className="py-5 px-10 bg-neutral-300 rounded-lg flex flex-col gap-12">

<div className="pb-20">
{tim.jenjang === "SMP" && (
<AnggotaCardsWrapper>
<AnggotaCard
href={`/dashboard/anggota/cerdas_cermat1`}
image={
cerdas_cermat1?.foto ?? "/placeholder-profile-picture.jpg"
}
name={cerdas_cermat1?.nama ?? "Belum diisi"}
posisi={"CERDAS CERMAT"}
/>
<AnggotaCard
href={`/dashboard/anggota/cerdas_cermat2`}
image={
cerdas_cermat2?.foto ?? "/placeholder-profile-picture.jpg"
}
name={cerdas_cermat2?.nama ?? "Belum diisi"}
posisi={"CERDAS CERMAT"}
/>
</AnggotaCardsWrapper>
)}
</div>
<AnggotaCardsWrapper>
<AnggotaCard
href={`/dashboard/anggota/danton`}
image={danton?.foto ?? "/placeholder-profile-picture.jpg"}
name={danton?.nama ?? "Belum diisi"}
posisi={danton?.posisi ?? "DANTON"}
/>
/>
<AnggotaCard
href={`/dashboard/anggota/official`}
image={official?.foto ?? "/placeholder-profile-picture.jpg"}
name={official?.nama ?? "Belum diisi"}
posisi={official?.posisi ?? "OFFICIAL"}
/>
{tim.confirmed && tim.jenjang === "SMA" && (
/>
{tim.jenjang === "SMA" && (
<AnggotaCard
href={`/dashboard/mascot`}
image={tim.foto_mascot ?? "/placeholder-profile-picture.jpg"}
name={tim.foto_mascot ? "Mascot " + tim.nama_tim : "Belum diisi"}
posisi={"MASCOT"}
/>
/>
)}
</AnggotaCardsWrapper>
{tim.tipe_tim === "NORMAL"
? rowsMapNormal.map((row, i) => (
<AnggotaCardsWrapper key={i}>
{row.map((pos, i) => {
? rowsMapNormal.map((row, i) => (
<AnggotaCardsWrapper key={i}>
{row.map((pos, i) => {
const anggotaInPos = anggotas.find(
(value) => value.posisi === pos.toUpperCase()
);

return (
<AnggotaCard
href={`/dashboard/anggota/${pos}`}
image={
anggotaInPos?.foto ?? "/placeholder-profile-picture.jpg"
}
name={anggotaInPos?.nama ?? "Belum diisi"}
posisi={"Posisi " + (anggotaInPos?.posisi ?? pos)}
key={anggotaInPos?.id ?? i}
href={`/dashboard/anggota/${pos}`}
image={
anggotaInPos?.foto ?? "/placeholder-profile-picture.jpg"
}
name={anggotaInPos?.nama ?? "Belum diisi"}
posisi={"Posisi " + (anggotaInPos?.posisi ?? pos)}
key={anggotaInPos?.id ?? i}
/>
);
})}
</AnggotaCardsWrapper>
))
: rowsMapSmall.map((row, i) => (
<AnggotaCardsWrapper key={i}>
</AnggotaCardsWrapper>
))
: rowsMapSmall.map((row, i) => (
<AnggotaCardsWrapper key={i}>
{row.map((pos, i) => {
const anggotaInPos = anggotas.find(
(value) => value.posisi === pos.toUpperCase()
);

return (
<AnggotaCard
href={`/dashboard/anggota/${pos}`}
href={`/dashboard/anggota/${pos}`}
image={
anggotaInPos?.foto ?? "/placeholder-profile-picture.jpg"
}
name={anggotaInPos?.nama ?? "Belum diisi"}
posisi={anggotaInPos?.posisi ?? pos}
key={anggotaInPos?.id ?? i}
/>
);
})}
/>
);
})}
</AnggotaCardsWrapper>
))}
</div>
Expand Down

0 comments on commit 3c7742c

Please sign in to comment.