Compare commits

..

23 Commits

Author SHA1 Message Date
26ae1dfb1b Test C 1 2025-11-28 11:58:05 +08:00
234a02e849 Merge branch 'nico/28-nov-25' into staging 2025-11-28 11:45:12 +08:00
56df11419d Merge pull request 'Balik ke awal' (#23) from nico/27-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/23
2025-11-27 18:53:50 +08:00
8fed1dfda4 Merge pull request 'Test hapus auth' (#22) from nico/test-hapus-auth into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/22
2025-11-27 18:14:45 +08:00
091c33a73c Test Hapus Auth 2025-11-27 18:13:29 +08:00
ff9c3668fc Merge pull request 'Fix eror registrasi 2' (#21) from nico/27-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/21
2025-11-27 17:10:27 +08:00
e2e8b47868 Merge pull request 'Fix eror registrasi 1' (#20) from nico/27-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/20
2025-11-27 16:47:07 +08:00
a389e5ee32 Merge pull request 'Tambah cookies di bagian verifikasi, agar kedeteksi user sudah regis apa belom' (#19) from nico/27-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/19
2025-11-27 14:47:48 +08:00
d7c694d237 Merge pull request 'Fix Seeder User, dan role' (#18) from nico/27-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/18
2025-11-27 12:19:17 +08:00
4d3b2dd3f3 Merge pull request 'Fix Seeder' (#17) from nico/26-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/17
2025-11-26 15:35:21 +08:00
662dfc939e Merge pull request 'nico/26-nov-25' (#16) from nico/26-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/16
2025-11-26 15:03:34 +08:00
fee1a6dfb2 Merge pull request 'Fix create admin & progress bar persentase' (#14) from nico/18-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/14
2025-11-18 17:24:52 +08:00
afe8c70cef Merge pull request 'Fix Edit di Admin APbdes, dan fix data real di apbdes user' (#13) from nico/18-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/13

Fix Edit di Admin APbdes, dan fix data real di apbdes user
2025-11-18 16:26:59 +08:00
fb010bd05a Merge pull request 'Fix Route APBdes' (#12) from nico/18-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/12
2025-11-18 14:30:00 +08:00
cfe60ed8fe Merge pull request 'Fix SDGs Desa Barchart sudah responsive, tabel dan bar progress di menu apbdes sudah sesuai dengan data' (#11) from nico/18-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/11
2025-11-18 11:57:24 +08:00
dc56a329dc Merge pull request 'nico/12-nov-25' (#10) from nico/12-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/10
2025-11-12 17:43:31 +08:00
a9195d30bd Merge pull request 'Fix Text to Speech Menu Landing Page && Add barchart Landing Page APBDes' (#9) from nico/6-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/9
2025-11-06 11:36:00 +08:00
569b0d408b Merge pull request 'nico/5-nov-25' (#8) from nico/5-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/8
2025-11-05 14:33:33 +08:00
40985f961a Merge pull request 'nico/4-nov-25' (#7) from nico/4-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/7
2025-11-04 15:10:07 +08:00
22424ef53e Merge pull request 'Fix QC Keano FrontEnd' (#6) from nico/3-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/6
2025-11-03 17:36:47 +08:00
14b49334ac Merge pull request 'nico/3-nov-25' (#5) from nico/3-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/5
2025-11-03 10:29:31 +08:00
4a6829c502 Merge pull request 'nico/28-okt-25' (#4) from nico/28-okt-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/4
2025-10-28 23:05:26 +08:00
60b035749d Merge pull request 'nico/27-okt-25' (#3) from nico/27-okt-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/desa-darmasaba/pulls/3
2025-10-27 22:19:56 +08:00
33 changed files with 424 additions and 244 deletions

View File

@@ -31,7 +31,7 @@ export default function Validasi() {
useEffect(() => {
const checkFlow = async () => {
try {
const res = await fetch('/api/auth/get-flow', {
const res = await fetch('/api/get-flow', {
credentials: 'include'
});
const data = await res.json();
@@ -60,7 +60,7 @@ export default function Validasi() {
setKodeId(storedKodeId);
const loadOtpData = async () => {
try {
const res = await fetch(`/api/auth/otp-data?kodeId=${encodeURIComponent(storedKodeId)}`);
const res = await fetch(`/api/otp-data?kodeId=${encodeURIComponent(storedKodeId)}`);
const result = await res.json();
if (res.ok && result.data?.nomor) {
@@ -124,7 +124,6 @@ export default function Validasi() {
return;
}
// ✅ Finalize registration
const finalizeRes = await fetch('/api/auth/finalize-registration', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -149,7 +148,7 @@ export default function Validasi() {
};
const handleLoginVerification = async () => {
const loginRes = await fetch('/api/auth/verify-otp-login', {
const loginRes = await fetch('/api/verify-otp-login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ nomor, otp, kodeId }),
@@ -207,7 +206,7 @@ export default function Validasi() {
// Clear cookie
try {
await fetch('/api/auth/clear-flow', {
await fetch('/api/clear-flow', {
method: 'POST',
credentials: 'include'
});
@@ -219,7 +218,7 @@ export default function Validasi() {
const handleResend = async () => {
if (!nomor) return;
try {
const res = await fetch('/api/auth/resend', {
const res = await fetch('/api/resend', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ nomor }),

View File

@@ -1,25 +0,0 @@
// src/app/admin/_com/getMenuIdsByRoleId.ts
import { navBar, role1, role2, role3 } from '@/app/admin/_com/list_PageAdmin';
/**
* Mengembalikan daftar ID menu (string[]) berdasarkan roleId
*/
export function getMenuIdsByRoleId(roleId: string | number): string[] {
const id = typeof roleId === 'string' ? parseInt(roleId, 10) : roleId;
switch (id) {
case 0:
// Asumsikan devBar ada dan punya struktur sama
return []; // atau sesuaikan jika ada devBar
case 1:
return navBar.map(section => section.id);
case 2:
return role1.map(section => section.id);
case 3:
return role2.map(section => section.id);
case 4:
return role3.map(section => section.id);
default:
return [];
}
}

View File

@@ -93,7 +93,6 @@ function ListUser({ search }: { search: string }) {
const success = await stateUser.update.submit({
id: userId,
roleId: newRoleId,
});
if (success) {
@@ -137,10 +136,9 @@ function ListUser({ search }: { search: string }) {
}
};
const filteredData = (data || []).filter((item) => {
return item.roleId !== "0" && item.roleId !== "1";
});
const filteredData = (data || []).filter(
(item) => item.roleId !== "0" // asumsikan id role SUPERADMIN = "0"
);
if (loading || !data) {
return (
@@ -185,7 +183,7 @@ function ListUser({ search }: { search: string }) {
<Select
placeholder="Pilih role"
data={stateRole.findMany.data
.filter(r => r.id !== "0" && r.id !== "1") // ❌ Sembunyikan SUPERADMIN dan DEVELOPER
.filter(r => r.id !== "0") // ❌ Sembunyikan SUPERADMIN
.map(r => ({
label: r.name,
value: r.id,

View File

@@ -435,7 +435,6 @@ export default function Layout({ children }: { children: React.ReactNode }) {
const [desktopOpened, { toggle: toggleDesktop }] = useDisclosure(true);
const router = useRouter();
const segments = useSelectedLayoutSegments().map((s) => _.lowerCase(s));
useEffect(() => {
const fetchUser = async () => {

View File

@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { getMenuIdsByRoleId } from "@/app/admin/(dashboard)/user&role/_com/getMenuIdByRole";
import prisma from "@/lib/prisma";
import { Context } from "elysia";
@@ -24,7 +23,7 @@ export default async function userUpdate(context: Context) {
const currentUser = await prisma.user.findUnique({
where: { id },
select: { roleId: true, isActive: true },
select: { roleId: true, isActive: true }
});
if (!currentUser) {
@@ -32,29 +31,7 @@ export default async function userUpdate(context: Context) {
}
const isRoleChanged = roleId && currentUser.roleId !== roleId;
const isActiveChanged =
isActive !== undefined && currentUser.isActive !== isActive;
// ✅ Jika role berubah, reset dan set ulang akses menu
if (isRoleChanged && roleId) {
// Hapus akses lama
await prisma.userMenuAccess.deleteMany({
where: { userId: id }
});
// Ambil menu default untuk role baru
const menuIds = getMenuIdsByRoleId(roleId);
if (menuIds.length > 0) {
// Buat akses baru
await prisma.userMenuAccess.createMany({
data: menuIds.map(menuId => ({
userId: id,
menuId
}))
});
}
}
const isActiveChanged = isActive !== undefined && currentUser.isActive !== isActive;
// Update user
const updatedUser = await prisma.user.update({
@@ -71,11 +48,10 @@ export default async function userUpdate(context: Context) {
nomor: true,
isActive: true,
roleId: true,
role: { select: { name: true } },
},
role: { select: { name: true } }
}
});
// ✅ HAPUS SEMUA SESI USER DI DATABASE
if (isRoleChanged) {
await prisma.userSession.deleteMany({ where: { userId: id } });
@@ -86,13 +62,11 @@ export default async function userUpdate(context: Context) {
roleChanged: isRoleChanged,
isActiveChanged,
data: updatedUser,
message: isRoleChanged
message: isRoleChanged
? `Role ${updatedUser.username} diubah. User akan logout otomatis.`
: isActiveChanged
? `${updatedUser.username} ${
isActive ? "diaktifkan" : "dinonaktifkan"
}.`
: "User berhasil diupdate",
? `${updatedUser.username} ${isActive ? 'diaktifkan' : 'dinonaktifkan'}.`
: "User berhasil diupdate"
};
} catch (e: any) {
console.error("❌ Error update user:", e);
@@ -101,4 +75,4 @@ export default async function userUpdate(context: Context) {
message: "Gagal mengupdate user: " + (e.message || "Unknown error"),
};
}
}
}

View File

@@ -0,0 +1,144 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
// app/api/_lib/api_fetch_auth.ts
// app/api/_lib/api_fetch_auth.ts
export const apiFetchLogin = async ({ nomor }: { nomor: string }) => {
if (!nomor || nomor.replace(/\D/g, '').length < 10) {
throw new Error('Nomor tidak valid');
}
const cleanPhone = nomor.replace(/\D/g, '');
const response = await fetch("/api/login", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ nomor: cleanPhone }),
credentials: 'include'
});
// Pastikan respons bisa di-parse sebagai JSON
let data;
try {
data = await response.json();
} catch (e) {
console.error("Non-JSON response from /api/login:", await response.text());
throw new Error('Respons server tidak valid');
}
if (!response.ok) {
throw new Error(data.message || 'Gagal memproses login');
}
// Validasi minimal respons
if (typeof data.success !== 'boolean' || typeof data.isRegistered !== 'boolean') {
throw new Error('Respons tidak sesuai format');
}
if (data.success) {
if (data.isRegistered && !data.kodeId) {
throw new Error('Kode verifikasi tidak ditemukan untuk user terdaftar');
}
return data; // { success, isRegistered, kodeId? }
} else {
throw new Error(data.message || 'Login gagal');
}
};
export const apiFetchRegister = async ({
username,
nomor,
}: {
username: string;
nomor: string;
}) => {
const cleanPhone = nomor.replace(/\D/g, '');
if (cleanPhone.length < 10) throw new Error('Nomor tidak valid');
const response = await fetch("/api/register", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ username: username.trim(), nomor: cleanPhone }),
credentials: 'include',
});
const data = await response.json();
if (!response.ok) throw new Error(data.message || 'Gagal mengirim OTP');
return data;
};
export const apiFetchOtpData = async ({ kodeId }: { kodeId: string }) => {
if (!kodeId) {
throw new Error('Kode ID tidak valid');
}
const response = await fetch("/api/otp-data", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ kodeId }),
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.message || 'Gagal memuat data OTP');
}
return data;
};
// Ganti endpoint ke verify-otp-login
export const apiFetchVerifyOtp = async ({ nomor, otp, kodeId }: { nomor: string; otp: string; kodeId: string }) => {
const response = await fetch('/api/verify-otp-login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ nomor, otp, kodeId }),
});
const data = await response.json();
return {
success: response.ok,
...data,
status: response.status,
};
};
// Di dalam api_fetch_auth.ts
export async function apiFetchUserMenuAccess(userId: string): Promise<{
success: boolean;
menuIds?: string[];
message?: string;
}> {
try {
const res = await fetch(`/api/admin/user-menu-access/${userId}`, {
method: 'GET',
headers: { 'Content-Type': 'application/json' },
});
const data = await res.json();
return data;
} catch (error) {
console.error('API Fetch User Menu Access Error:', error);
return { success: false, message: 'Gagal memuat menu akses' };
}
}
export async function apiUpdateUserMenuAccess(
userId: string,
menuIds: string[]
): Promise<{ success: boolean; message?: string }> {
try {
const res = await fetch('/api/admin/user-menu-access', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ userId, menuIds }),
});
const data = await res.json();
return data;
} catch (error) {
console.error('API Update User Menu Access Error:', error);
return { success: false, message: 'Gagal menyimpan menu akses' };
}
}

View File

@@ -0,0 +1,149 @@
// src/app/api/auth/finalize-registration/route.ts
import prisma from "@/lib/prisma";
import { NextResponse } from "next/server";
import { sessionCreate } from "../_lib/session_create";
// ✅ Gunakan STRING untuk roleId
const DEFAULT_MENUS_BY_ROLE: Record<string, string[]> = {
"0": [
"Landing Page", "PPID", "Desa", "Kesehatan", "Keamanan",
"Ekonomi", "Inovasi", "Lingkungan", "Pendidikan", "User & Role"
],
"1": [
"Landing Page", "PPID", "Desa", "Keamanan",
"Ekonomi", "Inovasi", "Lingkungan", "User & Role"
],
"2": ["Landing Page", "Desa", "Ekonomi", "Inovasi", "Lingkungan"],
"3": ["Kesehatan"],
"4": ["Pendidikan"],
};
export async function POST(req: Request) {
try {
const { nomor, username, kodeId } = await req.json();
const cleanNomor = nomor.replace(/\D/g, "");
if (!cleanNomor || !username || !kodeId) {
return NextResponse.json(
{ success: false, message: "Data tidak lengkap" },
{ status: 400 }
);
}
// Verify OTP
const otpRecord = await prisma.kodeOtp.findUnique({
where: { id: kodeId },
select: { nomor: true, isActive: true }
});
if (!otpRecord?.isActive || otpRecord.nomor !== cleanNomor) {
return NextResponse.json(
{ success: false, message: "OTP tidak valid" },
{ status: 400 }
);
}
// Check duplicate username
if (await prisma.user.findFirst({ where: { username } })) {
return NextResponse.json(
{ success: false, message: "Username sudah digunakan" },
{ status: 409 }
);
}
// Check duplicate nomor
if (await prisma.user.findUnique({ where: { nomor: cleanNomor } })) {
return NextResponse.json(
{ success: false, message: "Nomor sudah terdaftar" },
{ status: 409 }
);
}
// 🔥 Tentukan roleId sebagai STRING
const targetRoleId = "2"; // ✅ Default ADMIN_DESA (roleId "2")
// Validasi role exists
const roleExists = await prisma.role.findUnique({
where: { id: targetRoleId },
select: { id: true }
});
if (!roleExists) {
return NextResponse.json(
{ success: false, message: "Role tidak valid" },
{ status: 400 }
);
}
// ✅ Create user (inactive, waiting approval)
const newUser = await prisma.user.create({
data: {
username,
nomor: cleanNomor,
roleId: targetRoleId,
isActive: false, // Waiting for admin approval
},
});
// ✅ Berikan akses menu default based on role
const menuIds = DEFAULT_MENUS_BY_ROLE[targetRoleId] || [];
if (menuIds.length > 0) {
await prisma.userMenuAccess.createMany({
data: menuIds.map(menuId => ({
userId: newUser.id,
menuId,
})),
skipDuplicates: true, // ✅ Avoid duplicate errors
});
}
// ✅ Mark OTP as used
await prisma.kodeOtp.update({
where: { id: kodeId },
data: { isActive: false },
});
// ✅ Create session token
const token = await sessionCreate({
sessionKey: process.env.BASE_SESSION_KEY!,
jwtSecret: process.env.BASE_TOKEN_KEY!,
exp: "30 day",
user: {
id: newUser.id,
nomor: newUser.nomor,
username: newUser.username,
roleId: newUser.roleId,
isActive: false, // User belum aktif
},
invalidatePrevious: false,
});
// ✅ PENTING: Return JSON response (bukan redirect)
const response = NextResponse.json({
success: true,
message: "Registrasi berhasil. Menunggu persetujuan admin.",
userId: newUser.id,
});
// ✅ Set session cookie
const cookieName = process.env.BASE_SESSION_KEY || 'session';
response.cookies.set(cookieName, token, {
httpOnly: true,
secure: process.env.NODE_ENV === "production",
sameSite: 'lax',
path: "/",
maxAge: 30 * 24 * 60 * 60, // 30 days
});
return response;
} catch (error) {
console.error("❌ Finalize Registration Error:", error);
return NextResponse.json(
{ success: false, message: "Registrasi gagal. Silakan coba lagi." },
{ status: 500 }
);
} finally {
await prisma.$disconnect();
}
}

View File

@@ -0,0 +1,59 @@
// src/app/api/auth/me/route.ts
import { NextResponse } from 'next/server';
import { verifySession } from '../_lib/session_verify';
import prisma from '@/lib/prisma';
export async function GET() {
try {
const sessionUser = await verifySession();
if (!sessionUser) {
return NextResponse.json(
{ success: false, message: "Unauthorized", user: null },
{ status: 401 }
);
}
const [dbUser, menuAccess] = await Promise.all([
prisma.user.findUnique({
where: { id: sessionUser.id },
select: {
id: true,
username: true,
nomor: true,
roleId: true, // STRING!
isActive: true, // BOOLEAN!
},
}),
prisma.userMenuAccess.findMany({
where: { userId: sessionUser.id },
select: { menuId: true },
}),
]);
if (!dbUser) {
return NextResponse.json(
{ success: false, message: "User not found", user: null },
{ status: 404 }
);
}
return NextResponse.json({
success: true,
user: {
id: dbUser.id,
name: dbUser.username,
username: dbUser.username,
nomor: dbUser.nomor,
roleId: dbUser.roleId, // STRING!
isActive: dbUser.isActive, // BOOLEAN!
menuIds: menuAccess.map(m => m.menuId),
},
});
} catch (error) {
console.error("❌ Error in /api/me:", error);
return NextResponse.json(
{ success: false, message: "Internal server error", user: null },
{ status: 500 }
);
}
}

View File

@@ -1,7 +1,8 @@
// src/app/api/auth/finalize-registration/route.ts
import prisma from "@/lib/prisma";
import { NextResponse } from "next/server";
import { sessionCreate } from "../_lib/session_create";
import { sessionCreate } from "../../[auth]/_lib/session_create";
// ✅ Gunakan STRING untuk roleId
const DEFAULT_MENUS_BY_ROLE: Record<string, string[]> = {

View File

@@ -12,7 +12,6 @@ export async function GET() {
{ status: 401 }
);
}
const [dbUser, menuAccess] = await Promise.all([
prisma.user.findUnique({

View File

@@ -1,105 +1,31 @@
/* styles/globals.css */
/* ===================================
1. IMPORT CSS LIBRARIES
=================================== */
@import "@mantine/carousel/styles.css";
@import "@mantine/dropzone/styles.css";
@import "@mantine/charts/styles.css";
@import "@mantine/dates/styles.css";
@import "@mantine/tiptap/styles.css";
@import "animate.css";
@import "react-simple-toasts/dist/style.css";
@import "react-simple-toasts/dist/theme/dark.css";
@import "primereact/resources/themes/lara-light-blue/theme.css";
@import "primereact/resources/primereact.min.css";
@import "primeicons/primeicons.css";
/* ===================================
2. FONT FACE - OPTIMIZED
=================================== */
@font-face {
font-family: 'San Francisco';
src: url('/assets/fonts/font.otf') format('opentype');
font-weight: normal;
font-style: normal;
font-display: swap; /* ✅ TAMBAHKAN INI - Penting untuk PageSpeed! */
}
/* ===================================
3. RESET & BASE STYLES
=================================== */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
-webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
-moz-text-size-adjust: 100%;
text-size-adjust: 100%;
}
body {
margin: 0;
font-family: 'San Francisco', -apple-system, BlinkMacSystemFont, 'Segoe UI',
Roboto, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* ===================================
4. GLASS EFFECTS - OPTIMIZED
=================================== */
.glass {
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(40px);
-webkit-backdrop-filter: blur(40px);
backdrop-filter: blur(40px);
position: fixed;
z-index: 50;
width: 100%;
height: 100vh;
will-change: transform; /* ✅ Hardware acceleration */
}
.glass2 {
background: rgba(255, 255, 255, 0.3);
backdrop-filter: blur(40px);
-webkit-backdrop-filter: blur(40px);
backdrop-filter: blur(40px);
position: fixed;
z-index: 1;
will-change: transform; /* ✅ Hardware acceleration */
}
.glass3 {
background: rgba(255, 255, 255, 0.3);
backdrop-filter: blur(40px);
-webkit-backdrop-filter: blur(40px);
will-change: transform; /* ✅ Hardware acceleration */
backdrop-filter: blur(40px);
}
/* ===================================
5. PERFORMANCE OPTIMIZATION
=================================== */
img,
picture,
video,
canvas,
svg {
display: block;
max-width: 100%;
height: auto;
}
/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}

View File

@@ -1,89 +1,41 @@
// Import styles of packages that you've installed.
// All packages except `@mantine/hooks` require styles imports
import "@mantine/carousel/styles.css";
import "@mantine/core/styles.css";
import "./globals.css"; // Sisanya import di globals.css
import '@mantine/dropzone/styles.css';
import "animate.css";
import 'react-simple-toasts/dist/style.css';
import 'react-simple-toasts/dist/theme/dark.css';
import "./globals.css";
import '@mantine/charts/styles.css';
import '@mantine/dates/styles.css';
import '@mantine/tiptap/styles.css';
import "primereact/resources/themes/lara-light-blue/theme.css";
import "primereact/resources/primereact.min.css";
import "primeicons/primeicons.css";
import LoadDataFirstClient from "@/app/darmasaba/_com/LoadDataFirstClient";
import {
ColorSchemeScript,
MantineProvider,
createTheme,
// mantineHtmlProps,
mantineHtmlProps,
} from "@mantine/core";
// import { Metadata } from "next";
// import { ViewTransitions } from "next-view-transitions";
import { ViewTransitions } from "next-view-transitions";
import { ToastContainer } from "react-toastify";
// export const metadata: Metadata = {
// title: {
// default: "Desa Darmasaba",
// template: "%s | Desa Darmasaba",
// },
// description: "Website resmi Desa Darmasaba, Kabupaten Badung, Bali. Informasi layanan publik, berita, dan profil desa.",
// keywords: [
// "desa darmasaba",
// "darmasaba",
// "badung",
// "bali",
// "desa",
// "pemerintah desa",
// "layanan publik",
// "abang batan desa",
// ],
// authors: [{ name: "Pemerintah Desa Darmasaba" }],
// creator: "Desa Darmasaba",
// publisher: "Desa Darmasaba",
// robots: {
// index: true,
// follow: true,
// googleBot: {
// index: true,
// follow: true,
// "max-video-preview": -1,
// "max-image-preview": "large",
// "max-snippet": -1,
// },
// },
// icons: {
// icon: "/assets/images/darmasaba-icon.png",
// apple: "/assets/images/darmasaba-icon.png",
// },
// manifest: "/manifest.json",
// openGraph: {
// type: "website",
// locale: "id_ID",
// url: "https://cld-dkr-staging-desa-darmasaba.wibudev.com",
// siteName: "Desa Darmasaba",
// title: "Desa Darmasaba - Kabupaten Badung, Bali",
// description: "Website resmi Desa Darmasaba, Kabupaten Badung, Bali. Informasi layanan publik, berita, dan profil desa.",
// images: [
// {
// url: "/assets/images/darmasaba-icon.png",
// width: 1200,
// height: 630,
// alt: "Desa Darmasaba",
// },
// ],
// },
// twitter: {
// card: "summary_large_image",
// title: "Desa Darmasaba - Kabupaten Badung, Bali",
// description: "Website resmi Desa Darmasaba, Kabupaten Badung, Bali",
// images: ["/assets/images/darmasaba-icon.png"],
// },
// verification: {
// // google: "your-google-verification-code", // Tambahkan jika sudah punya
// // yandex: "your-yandex-verification-code",
// // yahoo: "your-yahoo-verification-code",
// },
// category: "government",
// other: {
// "msapplication-TileColor": "#ffffff",
// "theme-color": "#ffffff",
// },
// };
export const metadata = {
title: "Desa Darmasaba",
description: "Desa Darmasaba Kabupaten Badung",
};
const theme = createTheme({
fontFamily: "San Francisco, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif",
fontFamilyMonospace: "SFMono-Regular, Menlo, Monaco, Consolas, monospace",
fontFamily:
"San Francisco, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif",
fontFamilyMonospace:
"SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",
headings: { fontFamily: "San Francisco, sans-serif" },
});
@@ -93,22 +45,27 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<html lang="id" data-mantine-color-scheme="light">
<head>
<meta charSet="utf-8" />
<ColorSchemeScript />
</head>
<body>
<MantineProvider theme={theme}>
{children}
<LoadDataFirstClient />
</MantineProvider>
<ToastContainer
position="bottom-center"
hideProgressBar
style={{ zIndex: 9999 }}
/>
</body>
</html>
<ViewTransitions>
<html lang="en" {...mantineHtmlProps}>
<head>
<ColorSchemeScript />
<link
rel="icon"
href="/assets/images/darmasaba-icon.png"
sizes="any"
/>
</head>
<body>
<MantineProvider theme={theme}>
{children}
</MantineProvider>
<ToastContainer position="bottom-center" hideProgressBar style={{
zIndex: 9999
}} />
</body>
<LoadDataFirstClient />
</html>
</ViewTransitions>
);
}
}

View File

@@ -80,7 +80,7 @@ export default function WaitingRoom() {
// Force a session refresh
try {
const res = await fetch('/api/auth/refresh-session', {
const res = await fetch('/api/refresh-session', {
method: 'POST',
credentials: 'include'
});