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