Skip to content

Commit

Permalink
Merge pull request #262 from mokletdev/development
Browse files Browse the repository at this point in the history
Frontend fixes
  • Loading branch information
justpiple authored Jul 12, 2024
2 parents 149c5c1 + c41cb60 commit af2b1bc
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 58 deletions.
87 changes: 44 additions & 43 deletions src/app/(admin)/admin/components/MdEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ import { toast } from "sonner";
export default function Editor({
value,
onChange,
label,
}: {
value: string;
onChange: (
value?: string | undefined,
event?: ChangeEvent<HTMLTextAreaElement> | undefined,
) => void;
label?: string;
}) {
const insertImageRef = useRef<HTMLInputElement>(null);

Expand Down Expand Up @@ -96,48 +98,47 @@ export default function Editor({
}

return (
<>
<div data-color-mode="light">
<label>Text Editor</label>
<input
type="file"
hidden
name="insertImage"
ref={insertImageRef}
accept="image/gif,image/jpeg,image/jpg,image/png,image/webp,image/svg"
/>
<MDEditor
value={value}
onChange={onChange}
className=""
height={600}
style={{
backgroundColor: "#fff",
color: "#000",
fontFamily: "inherit",
padding: 0,
}}
commands={[
bold,
italic,
strikethrough,
hr,
title,
divider,
link,
quote,
code,
codeBlock,
comment,
insertImage,
table,
divider,
unorderedListCommand,
orderedListCommand,
checkedListCommand,
]}
/>
</div>
</>
<div data-color-mode="light">
<label htmlFor="textEditor">{label ?? "Text Editor"}</label>
<input
type="file"
hidden
name="insertImage"
ref={insertImageRef}
accept="image/gif,image/jpeg,image/jpg,image/png,image/webp,image/svg"
/>
<MDEditor
value={value}
onChange={onChange}
className=""
height={600}
style={{
backgroundColor: "#fff",
color: "#000",
fontFamily: "inherit",
padding: 0,
}}
id="textEditor"
commands={[
bold,
italic,
strikethrough,
hr,
title,
divider,
link,
quote,
code,
codeBlock,
comment,
insertImage,
table,
divider,
unorderedListCommand,
orderedListCommand,
checkedListCommand,
]}
/>
</div>
);
}
5 changes: 5 additions & 0 deletions src/app/(admin)/admin/organisasi/_components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { toast } from "sonner";
import SubmitButton from "@/app/_components/global/SubmitButton";
import { useRouter } from "next-nprogress-bar";
import { fileSizeToMb } from "@/utils/atomics";
import { P } from "@/app/_components/global/Text";

export default function Form({
organisasi,
Expand Down Expand Up @@ -188,11 +189,15 @@ export default function Form({
placeholder={`Misi organisasi ${organisasi.organisasi}`}
value={organisasi.mission!}
/>
<P className="text-black first-letter:capitalize after:text-red-500 after:content-['*']">
Struktur Organisasi
</P>
<Editor
value={structure}
onChange={(data) => {
setStructure(data!);
}}
label="Upload gambar/ketik"
/>
<SubmitButton />
</form>
Expand Down
25 changes: 10 additions & 15 deletions src/app/(main)/_components/parts/Opinions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export default function Opinions() {
<div className="flex w-full md:w-1/2 items-center justify-center rounded-2xl border border-neutral-400 px-[28px] py-[32px]">
<Saying
personData={{
name: "Rina Setiawan",
role: "Pembimbing Media Moklet",
name: "Lorem ipsum",
role: "Lorem ipsum dolor",
image:
"https://i.scdn.co/image/ab67616d00001e02f99ee9d6d91c399522b0baf9",
}}
Expand All @@ -27,29 +27,24 @@ export default function Opinions() {
<div className="flex w-full md:w-1/2 items-center justify-center rounded-2xl border border-neutral-400 px-[28px] py-[32px]">
<Saying
personData={{
name: "Ibani Hillabi",
role: "Ketua PASKATEMA 2023/2024",
name: "Duan Tangguh M. P.",
role: "Ketua MEMO 2023/2024",
image:
"https://i.scdn.co/image/ab67616d00001e02f99ee9d6d91c399522b0baf9",
"https://res.cloudinary.com/mokletorg/image/upload/v1720768436/assets/testimoni/duan_avfss1.webp",
}}
saying="Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nulla ullamcorper odio justo."
saying="Media Moklet atau biasa kita sapa dengan nama MeMo ini bener-bener jadi salah satu primadona buat anak-anak yang hobi banget di bidang multimedia, mulai dari acara, konten dan kegiatannya top semua pokoknya."
/>
</div>
</div>
<div className="flex w-full items-center justify-center rounded-2xl border border-neutral-400 px-[28px] py-[32px]">
<Saying
personData={{
name: "Pandhu Arya",
role: "Ketua Sregginllallik Periode 2023/2024",
name: "Ijlal Windhi Saputra",
role: "Ketua OSIS Masa Bakti 2021/2022",
image:
"https://i.scdn.co/image/ab67616d00001e02f99ee9d6d91c399522b0baf9",
"https://res.cloudinary.com/mokletorg/image/upload/v1720767929/assets/testimoni/Ijlal_Windhi_Saputra_fqdnzb_yu6d9y.jpg",
}}
saying="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla
ullamcorper odio justo, vitae blandit lacus facilisis
lobortis. Nulla facilisi. Nunc sodales magna nec ante
hendrerit, et vulputate elit fermentum. magna nec ante
hendrerit, et vulputate elit fermentum."
saying="Saya sangat bangga dengan semangat dan dedikasi seluruh anggota OSIS serta organisasi lainnya di SMK Telkom Malang. Melalui kolaborasi dan berbagai kegiatan bersama, kami berhasil menciptakan lingkungan sekolah yang inspiratif dan inovatif. Pengalaman ini tidak hanya memperkuat rasa kebersamaan di antara siswa, tetapi juga membentuk karakter dan kepemimpinan yang kuat. Saya berharap OSIS dan organisasi lainnya di SMK Telkom Malang terus berkontribusi positif dalam mengembangkan potensi siswa di masa depan."
/>
</div>
</div>
Expand Down

0 comments on commit af2b1bc

Please sign in to comment.