diff --git a/app/[locale]/(admin)/admin/categories/update/[id]/page.tsx b/app/[locale]/(admin)/admin/categories/update/[id]/page.tsx index a58c3fd..88ae7b8 100644 --- a/app/[locale]/(admin)/admin/categories/update/[id]/page.tsx +++ b/app/[locale]/(admin)/admin/categories/update/[id]/page.tsx @@ -6,7 +6,7 @@ const page = () => { return (
-
+
diff --git a/app/[locale]/(admin)/admin/management-user/detail/[id]/page.tsx b/app/[locale]/(admin)/admin/management-user/detail/[id]/page.tsx index 31d12b3..44bc842 100644 --- a/app/[locale]/(admin)/admin/management-user/detail/[id]/page.tsx +++ b/app/[locale]/(admin)/admin/management-user/detail/[id]/page.tsx @@ -150,10 +150,10 @@ export default function UserDetailPage() {

{user.statusId}

-
+ {/*
-

{user.keycloakId}

-
+

{user.keycloakId}

+
*/}
@@ -185,10 +185,10 @@ export default function UserDetailPage() {

{formatDateToIndonesian(user.updatedAt)}

-
+ {/*

{user.profilePicturePath ? "Tersedia" : "Tidak ada"}

-
+
*/} {/* Additional Information (only show if data exists) */} diff --git a/app/[locale]/globals.css b/app/[locale]/globals.css index 685a31e..3732f90 100644 --- a/app/[locale]/globals.css +++ b/app/[locale]/globals.css @@ -133,25 +133,6 @@ } } -@layer base { - /* CKEditor – force light mode even in dark */ - .ck-viewer .ck.ck-editor__main > .ck-editor__editable { - @apply bg-white text-black; - } - - .ck-viewer .ck-content { - @apply text-black; - } - - .ck-viewer .ck-content h1, - .ck-viewer .ck-content h2, - .ck-viewer .ck-content h3, - .ck-viewer .ck-content p, - .ck-viewer .ck-content li { - @apply text-black; - } -} - /* @import "tailwindcss"; @import "tw-animate-css"; diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 2e7cd5f..1efe891 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -7,7 +7,7 @@ import Navbar from "@/components/landing-page/navbar"; export default function Home() { return (
-
+
diff --git a/components/editor/custom-editor.js b/components/editor/custom-editor.js index d2a16e4..12ed008 100644 --- a/components/editor/custom-editor.js +++ b/components/editor/custom-editor.js @@ -2,40 +2,213 @@ import React from "react"; import { CKEditor } from "@ckeditor/ckeditor5-react"; -import Editor from "@/vendor/ckeditor5/build/ckeditor"; +import Editor from "ckeditor5-custom-build"; function CustomEditor(props) { + const maxHeight = props.maxHeight || 600; + return ( - { - const data = editor.getData(); - console.log({ event, editor, data }); - props.onChange(data); - }} - config={{ - toolbar: [ - "heading", - "fontsize", - "bold", - "italic", - "link", - "numberedList", - "bulletedList", - "undo", - "redo", - "alignment", - "outdent", - "indent", - "blockQuote", - "insertTable", - "codeBlock", - "sourceEditing", - ], - }} - /> +
+ { + const data = editor.getData(); + console.log({ event, editor, data }); + props.onChange(data); + }} + config={{ + toolbar: [ + "heading", + "fontsize", + "bold", + "italic", + "link", + "numberedList", + "bulletedList", + "undo", + "redo", + "alignment", + "outdent", + "indent", + "blockQuote", + "insertTable", + "codeBlock", + "sourceEditing", + ], + content_style: ` + body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + font-size: 14px; + line-height: 1.6; + color: #111 !important; + background: #fff !important; + margin: 0; + padding: 1rem; + } + p { + margin: 0.5em 0; + } + h1, h2, h3, h4, h5, h6 { + margin: 1em 0 0.5em 0; + color: inherit !important; + } + ul, ol { + margin: 0.5em 0; + padding-left: 2em; + } + blockquote { + margin: 1em 0; + padding: 0.5em 1em; + border-left: 4px solid #d1d5db; + background-color: #f9fafb; + color: inherit !important; + } + `, + height: props.height || 400, + removePlugins: ["Title"], + mobile: { + theme: "silver", + }, + }} + /> + +
); } export default CustomEditor; + +// // components/custom-editor.js + +// import React from "react"; +// import { CKEditor } from "@ckeditor/ckeditor5-react"; +// import Editor from "@/vendor/ckeditor5/build/ckeditor"; + +// function CustomEditor(props) { +// return ( +// { +// const data = editor.getData(); +// console.log({ event, editor, data }); +// props.onChange(data); +// }} +// config={{ +// toolbar: [ +// "heading", +// "fontsize", +// "bold", +// "italic", +// "link", +// "numberedList", +// "bulletedList", +// "undo", +// "redo", +// "alignment", +// "outdent", +// "indent", +// "blockQuote", +// "insertTable", +// "codeBlock", +// "sourceEditing", +// ], +// }} +// /> +// ); +// } + +// export default CustomEditor; diff --git a/components/editor/view-editor.js b/components/editor/view-editor.js index 96c53c3..2dae74e 100644 --- a/components/editor/view-editor.js +++ b/components/editor/view-editor.js @@ -1,39 +1,18 @@ -// import React from "react"; -// import { CKEditor } from "@ckeditor/ckeditor5-react"; -// import Editor from "@/vendor/ckeditor5/build/ckeditor"; - -// function ViewEditor(props) { -// return ( -// -// ); -// } - -// export default ViewEditor; - import React from "react"; import { CKEditor } from "@ckeditor/ckeditor5-react"; import Editor from "@/vendor/ckeditor5/build/ckeditor"; -function ViewEditor({ initialData }) { +function ViewEditor(props) { return ( -
- -
+ ); } diff --git a/components/form/categories/categories-update-form.tsx b/components/form/categories/categories-update-form.tsx index 856e7cb..cf893ba 100644 --- a/components/form/categories/categories-update-form.tsx +++ b/components/form/categories/categories-update-form.tsx @@ -122,11 +122,28 @@ export default function CategoriesUpdateForm() { // 🔹 hanya kirim data mandatory const payload = { id: formData.id, - description: formData.description || "", - statusId: formData.statusId || 1, - title: formData.title || "", + title: formData.title, + description: formData.description, + statusId: formData.statusId, + + // ⬇️ FIELD KRUSIAL (WAJIB) + isActive: true, + is_active: true, + isPublish: formData.isPublish, + publishedAt: formData.publishedAt, + parentId: formData.parentId, + slug: formData.slug, + createdById: formData.createdById, }; + // const payload = { + // id: formData.id, + // description: formData.description || "", + // statusId: formData.statusId || 1, + // title: formData.title || "", + // }; + console.log("UPDATE PAYLOAD:", payload); + const res = await updateArticleCategory(Number(id), payload); if (!res?.error) { diff --git a/components/landing-page/category.tsx b/components/landing-page/category.tsx index 591bd1e..1bd0eba 100644 --- a/components/landing-page/category.tsx +++ b/components/landing-page/category.tsx @@ -56,7 +56,7 @@ export default function Category() { return (
-
+

{loading ? t("loadCategory") @@ -89,7 +89,7 @@ export default function Category() { return ( {showProfileMenu && ( -
+
-

+

{t("features")}

@@ -331,7 +331,7 @@ export default function Navbar() { } setIsSidebarOpen(false); }} - className="block text-[15px] text-gray-800 text-left w-full" + className="block text-[15px] text-gray-800 dark:text-white text-left w-full" > {item.label} @@ -340,19 +340,19 @@ export default function Navbar() {
- + {t("about")} - + {t("advertising")} - + {t("contact")} {!isLoggedIn ? ( <> - + {t("login")}