fix: auto scroll in modal landing
This commit is contained in:
parent
fb976f01bb
commit
bd5d87c7ce
|
|
@ -151,8 +151,10 @@ const EventModal = ({
|
||||||
satker: false,
|
satker: false,
|
||||||
international: false,
|
international: false,
|
||||||
});
|
});
|
||||||
|
const levelNumber = getCookiesDecrypt("ulne");
|
||||||
const [agendaType, setAgendaType] = React.useState(""); // State untuk agendaType
|
const userLevelId = getCookiesDecrypt("ulie");
|
||||||
|
const poldaState = Cookies.get("state");
|
||||||
|
const [agendaType, setAgendaType] = React.useState("");
|
||||||
const [selectedPolda, setSelectedPolda] = useState<string[]>([]);
|
const [selectedPolda, setSelectedPolda] = useState<string[]>([]);
|
||||||
const [selectedPolres, setSelectedPolres] = useState<string[]>([]);
|
const [selectedPolres, setSelectedPolres] = useState<string[]>([]);
|
||||||
const [selectedSatker, setSelectedSatker] = useState<string[]>([]);
|
const [selectedSatker, setSelectedSatker] = useState<string[]>([]);
|
||||||
|
|
@ -253,7 +255,7 @@ const EventModal = ({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsDatePickerOpen(false);
|
setIsDatePickerOpen(false);
|
||||||
}, [onClose])
|
}, [onClose]);
|
||||||
|
|
||||||
const handleCheckboxChange = (levelId: number) => {
|
const handleCheckboxChange = (levelId: number) => {
|
||||||
setCheckedLevels((prev) => {
|
setCheckedLevels((prev) => {
|
||||||
|
|
@ -393,13 +395,7 @@ const EventModal = ({
|
||||||
setIsAudioUploadFinish(true);
|
setIsAudioUploadFinish(true);
|
||||||
}
|
}
|
||||||
audioFiles.map(async (item: FileWithPreview, index: number) => {
|
audioFiles.map(async (item: FileWithPreview, index: number) => {
|
||||||
await uploadResumableFile(
|
await uploadResumableFile(index, String(id), item, "4", "0");
|
||||||
index,
|
|
||||||
String(id),
|
|
||||||
item,
|
|
||||||
"4",
|
|
||||||
"0"
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
if (publish) {
|
if (publish) {
|
||||||
setIsPublishing(true);
|
setIsPublishing(true);
|
||||||
|
|
@ -742,7 +738,10 @@ const EventModal = ({
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-1.5">
|
<div className="space-y-1.5">
|
||||||
<Label htmlFor="date">Tanggal</Label>
|
<Label htmlFor="date">Tanggal</Label>
|
||||||
<Popover open={isDatePickerOpen} onOpenChange={() => setIsDatePickerOpen(true)}>
|
<Popover
|
||||||
|
open={isDatePickerOpen}
|
||||||
|
onOpenChange={() => setIsDatePickerOpen(true)}
|
||||||
|
>
|
||||||
<PopoverTrigger asChild>
|
<PopoverTrigger asChild>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|
@ -789,6 +788,7 @@ const EventModal = ({
|
||||||
<div className="space-y-1.5">
|
<div className="space-y-1.5">
|
||||||
<Label htmlFor="wilayahPublish">Jenis Agenda</Label>
|
<Label htmlFor="wilayahPublish">Jenis Agenda</Label>
|
||||||
<div className="flex flex-wrap items-center gap-2">
|
<div className="flex flex-wrap items-center gap-2">
|
||||||
|
{roleId === 1 && (
|
||||||
<div>
|
<div>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id="semua"
|
id="semua"
|
||||||
|
|
@ -799,6 +799,8 @@ const EventModal = ({
|
||||||
Semua
|
Semua
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
{roleId === 1 && (
|
||||||
<div>
|
<div>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id="nasional"
|
id="nasional"
|
||||||
|
|
@ -809,6 +811,8 @@ const EventModal = ({
|
||||||
Nasional
|
Nasional
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id="polda"
|
id="polda"
|
||||||
|
|
@ -829,6 +833,7 @@ const EventModal = ({
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
{(roleId === 1 || roleId === 4 || roleId === 3) && (
|
||||||
<div>
|
<div>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id="polres"
|
id="polres"
|
||||||
|
|
@ -849,6 +854,8 @@ const EventModal = ({
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
{(roleId === 1 || roleId === 2) && (
|
||||||
<div>
|
<div>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id="satker"
|
id="satker"
|
||||||
|
|
@ -869,6 +876,8 @@ const EventModal = ({
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
{roleId === 1 && (
|
||||||
<div>
|
<div>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id="international"
|
id="international"
|
||||||
|
|
@ -882,6 +891,7 @@ const EventModal = ({
|
||||||
Internasional
|
Internasional
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ const HeroModal = ({
|
||||||
pagination={{ dynamicBullets: true }}
|
pagination={{ dynamicBullets: true }}
|
||||||
modules={[Pagination, Autoplay]}
|
modules={[Pagination, Autoplay]}
|
||||||
onSwiper={(swiper) => (swiperRef.current = swiper)}
|
onSwiper={(swiper) => (swiperRef.current = swiper)}
|
||||||
autoplay={{ delay: 3000 }}
|
autoplay={{ delay: 10000 }}
|
||||||
className="mySwiper w-full"
|
className="mySwiper w-full"
|
||||||
>
|
>
|
||||||
{dataContent?.map((list: any) => (
|
{dataContent?.map((list: any) => (
|
||||||
|
|
@ -311,7 +311,7 @@ const HeroNew = (props: { group?: string }) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}, 3000);
|
}, 10000);
|
||||||
|
|
||||||
return () => clearTimeout(timer);
|
return () => clearTimeout(timer);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue