From abeff9963a41904f38c102a7eadd1f04121b4710 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Fri, 24 Apr 2026 21:17:37 +0700 Subject: [PATCH] refactor: reorder settings form fields and improve code formatting --- .../js/pages/admin/system/settings/index.tsx | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/resources/js/pages/admin/system/settings/index.tsx b/resources/js/pages/admin/system/settings/index.tsx index 4511345..c5897b0 100644 --- a/resources/js/pages/admin/system/settings/index.tsx +++ b/resources/js/pages/admin/system/settings/index.tsx @@ -1,15 +1,15 @@ -import { Head, useForm } from '@inertiajs/react'; -import { ImagePlus, X, Save, Loader } from 'lucide-react'; -import React, { useRef, useState } from 'react'; -import { toast } from 'sonner'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { Field, FieldError } from "@/components/ui/field" -import { Input } from "@/components/ui/input" -import { Label } from "@/components/ui/label" +import { Field, FieldError } from "@/components/ui/field"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; import { Textarea } from '@/components/ui/textarea'; import systemRoutes from '@/routes/system'; import type { GeneralSetting } from '@/types'; +import { Head, useForm } from '@inertiajs/react'; +import { ImagePlus, Loader, Save, X } from 'lucide-react'; +import React, { useRef, useState } from 'react'; +import { toast } from 'sonner'; export default function SettingIndex({ setting }: { setting: GeneralSetting | null }) { const { data, setData, post, processing, errors } = useForm({ @@ -31,8 +31,8 @@ export default function SettingIndex({ setting }: { setting: GeneralSetting | nu const file = e.target.files?.[0]; if (!file) { -return; -} + return; + } setData('logo', file); const reader = new FileReader(); @@ -45,16 +45,16 @@ return; setLogoPreview(null); if (logoInputRef.current) { -logoInputRef.current.value = ''; -} + logoInputRef.current.value = ''; + } }; const handleIconChange = (e: React.ChangeEvent) => { const file = e.target.files?.[0]; if (!file) { -return; -} + return; + } setData('icon', file); const reader = new FileReader(); @@ -67,8 +67,8 @@ return; setIconPreview(null); if (iconInputRef.current) { -iconInputRef.current.value = ''; -} + iconInputRef.current.value = ''; + } }; const onSubmit = (e: React.FormEvent) => { @@ -99,19 +99,32 @@ iconInputRef.current.value = ''; Informasi Aplikasi - - - setData('name', e.target.value)} - autoComplete='off' - placeholder='Contoh: VN Grup Dress' - maxLength={100} - /> - - +
+ + + setData('phone', e.target.value)} + placeholder="0812xxxx" + /> + + + + + + setData('name', e.target.value)} + autoComplete='off' + placeholder='Contoh: VN Grup Dress' + maxLength={100} + /> + + +
@@ -125,19 +138,6 @@ iconInputRef.current.value = ''; -
- - - setData('phone', e.target.value)} - placeholder="0812xxxx" - /> - - -
-