fix:save button create article mobile
This commit is contained in:
parent
a614cbe33d
commit
06e3e84344
|
|
@ -706,7 +706,7 @@ export default function CreateArticleForm() {
|
||||||
name="category"
|
name="category"
|
||||||
render={({ field: { onChange, value } }) => (
|
render={({ field: { onChange, value } }) => (
|
||||||
<ReactSelect
|
<ReactSelect
|
||||||
className="basic-single text-black z-50"
|
className="basic-single text-black z-40"
|
||||||
classNames={{
|
classNames={{
|
||||||
control: (state: any) =>
|
control: (state: any) =>
|
||||||
"!rounded-lg bg-white !border-1 !border-gray-200 dark:!border-stone-500",
|
"!rounded-lg bg-white !border-1 !border-gray-200 dark:!border-stone-500",
|
||||||
|
|
@ -829,9 +829,33 @@ export default function CreateArticleForm() {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="mt-3 flex lg:hidden flex-row justify-end gap-3">
|
||||||
|
<Button
|
||||||
|
color="primary"
|
||||||
|
type="submit"
|
||||||
|
isDisabled={isScheduled && startDateValue == null}
|
||||||
|
onPress={() =>
|
||||||
|
isScheduled ? setStatus("scheduled") : setStatus("publish")
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Publish
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
color="success"
|
||||||
|
type="submit"
|
||||||
|
onPress={() => setStatus("draft")}
|
||||||
|
>
|
||||||
|
<p className="text-white">Draft</p>
|
||||||
|
</Button>
|
||||||
|
<Link href="/admin/article">
|
||||||
|
<Button color="danger" variant="bordered" type="button">
|
||||||
|
Kembali
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-row justify-end gap-3">
|
<div className="hidden lg:flex flex-row justify-end gap-3">
|
||||||
<Button
|
<Button
|
||||||
color="primary"
|
color="primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
|
||||||
|
|
@ -780,7 +780,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
name="category"
|
name="category"
|
||||||
render={({ field: { onChange, value } }) => (
|
render={({ field: { onChange, value } }) => (
|
||||||
<ReactSelect
|
<ReactSelect
|
||||||
className="basic-single text-black z-50"
|
className="basic-single text-black z-40"
|
||||||
classNames={{
|
classNames={{
|
||||||
control: (state: any) =>
|
control: (state: any) =>
|
||||||
"!rounded-lg bg-white !border-1 !border-gray-200 dark:!border-stone-500",
|
"!rounded-lg bg-white !border-1 !border-gray-200 dark:!border-stone-500",
|
||||||
|
|
|
||||||
|
|
@ -61,91 +61,91 @@ export default function Login() {
|
||||||
if (!username || !password) {
|
if (!username || !password) {
|
||||||
error("Username & Password Wajib Diisi !");
|
error("Username & Password Wajib Diisi !");
|
||||||
} else {
|
} else {
|
||||||
loading();
|
|
||||||
const response = await emailValidation(data);
|
|
||||||
if (response?.error) {
|
|
||||||
error("Username / Password Tidak Sesuai");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
close();
|
|
||||||
|
|
||||||
if (response?.data?.messages[0] === "Continue to setup email") {
|
|
||||||
setFirstLogin(true);
|
|
||||||
} else {
|
|
||||||
setNeedOtp(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// loading();
|
// loading();
|
||||||
// const response = await postSignIn(data);
|
// const response = await emailValidation(data);
|
||||||
// if (response?.error) {
|
// if (response?.error) {
|
||||||
// error("Username / Password Tidak Sesuai");
|
// error("Username / Password Tidak Sesuai");
|
||||||
// } else {
|
// return false;
|
||||||
// const profile = await getProfile(response?.data?.data?.access_token);
|
|
||||||
// const dateTime: any = new Date();
|
|
||||||
|
|
||||||
// const newTime: any = dateTime.getTime() + 10 * 60 * 1000;
|
|
||||||
|
|
||||||
// Cookies.set("access_token", response?.data?.data?.access_token, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("refresh_token", response?.data?.data?.refresh_token, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("time_refresh", newTime, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("is_first_login", "true", {
|
|
||||||
// secure: true,
|
|
||||||
// sameSite: "strict",
|
|
||||||
// });
|
|
||||||
// const resActivity = await saveActivity(
|
|
||||||
// {
|
|
||||||
// activityTypeId: 1,
|
|
||||||
// url: "https://kontenhumas.com/auth",
|
|
||||||
// userId: profile?.data?.data?.id,
|
|
||||||
// },
|
|
||||||
// accessData?.id_token
|
|
||||||
// );
|
|
||||||
// Cookies.set("profile_picture", profile?.data?.data?.profilePictureUrl, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("uie", profile?.data?.data?.id, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("ufne", profile?.data?.data?.fullname, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("ulie", profile?.data?.data?.userLevelGroup, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("username", profile?.data?.data?.username, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("urie", profile?.data?.data?.roleId, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("roleName", profile?.data?.data?.roleName, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("masterPoldaId", profile?.data?.data?.masterPoldaId, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("ulne", profile?.data?.data?.userLevelId, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("urce", profile?.data?.data?.roleCode, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// Cookies.set("email", profile?.data?.data?.email, {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
// router.push("/admin/dashboard");
|
|
||||||
// Cookies.set("status", "login", {
|
|
||||||
// expires: 1,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// close();
|
|
||||||
// }
|
// }
|
||||||
|
// close();
|
||||||
|
|
||||||
|
// if (response?.data?.messages[0] === "Continue to setup email") {
|
||||||
|
// setFirstLogin(true);
|
||||||
|
// } else {
|
||||||
|
// setNeedOtp(true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
loading();
|
||||||
|
const response = await postSignIn(data);
|
||||||
|
if (response?.error) {
|
||||||
|
error("Username / Password Tidak Sesuai");
|
||||||
|
} else {
|
||||||
|
const profile = await getProfile(response?.data?.data?.access_token);
|
||||||
|
const dateTime: any = new Date();
|
||||||
|
|
||||||
|
const newTime: any = dateTime.getTime() + 10 * 60 * 1000;
|
||||||
|
|
||||||
|
Cookies.set("access_token", response?.data?.data?.access_token, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("refresh_token", response?.data?.data?.refresh_token, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("time_refresh", newTime, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("is_first_login", "true", {
|
||||||
|
secure: true,
|
||||||
|
sameSite: "strict",
|
||||||
|
});
|
||||||
|
const resActivity = await saveActivity(
|
||||||
|
{
|
||||||
|
activityTypeId: 1,
|
||||||
|
url: "https://kontenhumas.com/auth",
|
||||||
|
userId: profile?.data?.data?.id,
|
||||||
|
},
|
||||||
|
accessData?.id_token
|
||||||
|
);
|
||||||
|
Cookies.set("profile_picture", profile?.data?.data?.profilePictureUrl, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("uie", profile?.data?.data?.id, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("ufne", profile?.data?.data?.fullname, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("ulie", profile?.data?.data?.userLevelGroup, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("username", profile?.data?.data?.username, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("urie", profile?.data?.data?.roleId, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("roleName", profile?.data?.data?.roleName, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("masterPoldaId", profile?.data?.data?.masterPoldaId, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("ulne", profile?.data?.data?.userLevelId, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("urce", profile?.data?.data?.roleCode, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
Cookies.set("email", profile?.data?.data?.email, {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
router.push("/admin/dashboard");
|
||||||
|
Cookies.set("status", "login", {
|
||||||
|
expires: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,7 @@ const SidebarMobile: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`flex lg:hidden absolute h-screen flex-grow ${
|
className={`z-50 flex lg:hidden absolute h-screen flex-grow ${
|
||||||
isOpen ? "min-w-[240px]" : "hidden"
|
isOpen ? "min-w-[240px]" : "hidden"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -478,7 +478,7 @@ export default function ArticleTable() {
|
||||||
<div className="flex flex-col gap-1 w-full lg:w-[230px]">
|
<div className="flex flex-col gap-1 w-full lg:w-[230px]">
|
||||||
<p className="font-semibold text-sm">Kategori</p>
|
<p className="font-semibold text-sm">Kategori</p>
|
||||||
<ReactSelect
|
<ReactSelect
|
||||||
className="basic-single text-black z-50"
|
className="basic-single text-black z-40"
|
||||||
classNames={{
|
classNames={{
|
||||||
control: (state: any) =>
|
control: (state: any) =>
|
||||||
"!rounded-lg bg-white !border-1 !border-gray-200 dark:!border-stone-500",
|
"!rounded-lg bg-white !border-1 !border-gray-200 dark:!border-stone-500",
|
||||||
|
|
@ -524,7 +524,7 @@ export default function ArticleTable() {
|
||||||
<p className="font-semibold text-sm">Author</p>
|
<p className="font-semibold text-sm">Author</p>
|
||||||
|
|
||||||
<ReactSelect
|
<ReactSelect
|
||||||
className="basic-single text-black z-50"
|
className="basic-single text-black z-40"
|
||||||
classNames={{
|
classNames={{
|
||||||
control: (state: any) =>
|
control: (state: any) =>
|
||||||
"!rounded-lg bg-white !border-1 !border-gray-200 dark:!border-stone-500",
|
"!rounded-lg bg-white !border-1 !border-gray-200 dark:!border-stone-500",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue