update fixing
This commit is contained in:
commit
9ae0c9269d
|
|
@ -24,6 +24,7 @@ auto-deploy:
|
|||
when: on_success
|
||||
only:
|
||||
- main
|
||||
- dev-landing-v2
|
||||
image: curlimages/curl:latest
|
||||
services:
|
||||
- docker:dind
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ export default function EditUserForm() {
|
|||
<PasswordChecklist
|
||||
rules={["minLength", "specialChar", "number", "capital", "match"]}
|
||||
minLength={8}
|
||||
value={passwordVal}
|
||||
value={passwordVal || ""}
|
||||
valueAgain={confPasswordVal}
|
||||
onChange={(isValid) => {
|
||||
form.setValue("isValidPassword", isValid);
|
||||
|
|
|
|||
|
|
@ -751,7 +751,7 @@ export default function CreateUserForm() {
|
|||
<PasswordChecklist
|
||||
rules={["minLength", "specialChar", "number", "capital", "match"]}
|
||||
minLength={8}
|
||||
value={passwordVal}
|
||||
value={passwordVal || ""}
|
||||
valueAgain={confPasswordVal}
|
||||
onChange={(isValid) => {
|
||||
form.setValue("isValidPassword", isValid);
|
||||
|
|
|
|||
|
|
@ -756,7 +756,7 @@ export default function EditUserForm() {
|
|||
<PasswordChecklist
|
||||
rules={["minLength", "specialChar", "number", "capital", "match"]}
|
||||
minLength={8}
|
||||
value={passwordVal}
|
||||
value={passwordVal || ""}
|
||||
valueAgain={confPasswordVal}
|
||||
onChange={(isValid) => {
|
||||
form.setValue("isValidPassword", isValid);
|
||||
|
|
|
|||
|
|
@ -437,6 +437,18 @@ const HeroNew = (props: { group?: string }) => {
|
|||
? Buffer.from(str).toString("base64")
|
||||
: window.btoa(str);
|
||||
|
||||
const [scrollIndex, setScrollIndex] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
if (!content || content.length < 3) return;
|
||||
|
||||
const interval = setInterval(() => {
|
||||
setScrollIndex((prevIndex) => (prevIndex + 1) % content.length);
|
||||
}, 3000);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
}, [content]);
|
||||
|
||||
return (
|
||||
<div className="flex items-start justify-center mx-auto w-auto">
|
||||
<div className="relative">
|
||||
|
|
@ -509,17 +521,21 @@ const HeroNew = (props: { group?: string }) => {
|
|||
</Carousel> */}
|
||||
|
||||
<div className="relative w-full">
|
||||
{content && content.length > 0 && (
|
||||
<Swiper
|
||||
modules={[Autoplay, Navigation]}
|
||||
autoplay={{ delay: 3000, disableOnInteraction: false }}
|
||||
autoplay={{
|
||||
delay: 3000,
|
||||
disableOnInteraction: false,
|
||||
}}
|
||||
loop={true}
|
||||
navigation={{
|
||||
nextEl: ".swiper-button-next",
|
||||
prevEl: ".swiper-button-prev",
|
||||
}}
|
||||
loop
|
||||
className="w-full"
|
||||
>
|
||||
{content?.map((list: any) => (
|
||||
{content.map((list: any) => (
|
||||
<SwiperSlide key={list?.id}>
|
||||
<div className="relative h-[310px] lg:h-[700px]">
|
||||
{/* Gambar */}
|
||||
|
|
@ -531,10 +547,10 @@ const HeroNew = (props: { group?: string }) => {
|
|||
className="object-cover w-full h-full"
|
||||
/>
|
||||
|
||||
{/* Overlay hitam transparan */}
|
||||
{/* Overlay */}
|
||||
<div className="absolute inset-0 bg-black/40 z-10" />
|
||||
|
||||
{/* Konten judul */}
|
||||
{/* Judul & Link */}
|
||||
<Link
|
||||
href={
|
||||
Number(list?.fileTypeId) === 1
|
||||
|
|
@ -568,11 +584,25 @@ const HeroNew = (props: { group?: string }) => {
|
|||
</SwiperSlide>
|
||||
))}
|
||||
</Swiper>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="hidden lg:flex flex-col gap-3 absolute bottom-4 right-[38px] w-[520px] bg-black/40 p-4 rounded-lg z-10">
|
||||
{newContent?.slice(0, 3).map((item: any) => (
|
||||
<li key={item?.id} className="flex gap-4 flex-row lg:w-full mx-2">
|
||||
<div className="hidden lg:flex flex-col gap-3 absolute bottom-4 right-[38px] w-[520px] bg-black/40 p-4 rounded-lg z-10 h-[250px] overflow-hidden">
|
||||
<div
|
||||
className="transition-transform duration-500 ease-in-out"
|
||||
style={{
|
||||
transform: "translateY(0%)",
|
||||
}}
|
||||
key={scrollIndex}
|
||||
>
|
||||
{content?.length >= 2 &&
|
||||
[0, 1].map((offset) => {
|
||||
const item = content[(scrollIndex + offset) % content.length];
|
||||
return (
|
||||
<li
|
||||
key={item?.id}
|
||||
className="flex gap-4 flex-row lg:w-full mx-2 mb-2"
|
||||
>
|
||||
<div className="flex-shrink-0 w-32 rounded-lg">
|
||||
<Image
|
||||
priority={true}
|
||||
|
|
@ -624,7 +654,9 @@ const HeroNew = (props: { group?: string }) => {
|
|||
</Link>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -31,45 +31,43 @@ export default function LocalSwitcher() {
|
|||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const params = useParams();
|
||||
const localActive = useLocale() || "in";
|
||||
const [selectedLang, setSelectedLang] = useState<string>("");
|
||||
const locale = useLocale() || "in";
|
||||
const [selectedLang, setSelectedLang] = useState<string>("in");
|
||||
const searchParams = useSearchParams();
|
||||
const [hasInitialized, setHasInitialized] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const storedLang = getLanguage();
|
||||
let joinParam = "";
|
||||
|
||||
if (searchParams) {
|
||||
joinParam = Array.from(searchParams.entries())
|
||||
.map(([key, value]) => `${key}=${value}`)
|
||||
.join("&");
|
||||
}
|
||||
|
||||
if (pathname.includes("polda")) {
|
||||
const redirectTo = (lang: string) => {
|
||||
startTransition(() => {
|
||||
router.replace(pathname + joinParam === "" ? "" : `?${joinParam}`, {
|
||||
locale: "in",
|
||||
router.replace(pathname + (joinParam ? `?${joinParam}` : ""), {
|
||||
locale: lang,
|
||||
});
|
||||
});
|
||||
} else {
|
||||
};
|
||||
|
||||
if (!hasInitialized) {
|
||||
if (!storedLang) {
|
||||
setLanguage("in");
|
||||
setSelectedLang("in");
|
||||
|
||||
startTransition(() => {
|
||||
router.replace(pathname + joinParam === "" ? "" : `?${joinParam}`, {
|
||||
locale: "in",
|
||||
});
|
||||
});
|
||||
redirectTo("in");
|
||||
} else {
|
||||
setSelectedLang(storedLang);
|
||||
startTransition(() => {
|
||||
router.replace(pathname + joinParam === "" ? "" : `?${joinParam}`, {
|
||||
locale: storedLang,
|
||||
});
|
||||
});
|
||||
if (locale !== storedLang) {
|
||||
redirectTo(storedLang);
|
||||
}
|
||||
}
|
||||
}, [searchParams]);
|
||||
setHasInitialized(true);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const onSelectChange = (nextLocale: string) => {
|
||||
setLanguage(nextLocale);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue