fix:after login flow, feedback ui
This commit is contained in:
commit
6d21679cb6
|
|
@ -1,6 +1,6 @@
|
|||
"use client";
|
||||
import { Input } from "@heroui/input";
|
||||
import React, { useState } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { EyeFilledIcon, EyeSlashFilledIcon } from "../icons";
|
||||
import { Button } from "@heroui/button";
|
||||
import Link from "next/link";
|
||||
|
|
@ -26,6 +26,7 @@ import PasswordChecklist from "react-password-checklist";
|
|||
import { Image, InputOtp } from "@heroui/react";
|
||||
|
||||
export default function Login() {
|
||||
const accessToken = Cookies.get("access_token");
|
||||
const router = useRouter();
|
||||
const [isVisible, setIsVisible] = useState(false);
|
||||
const [isVisibleSetup, setIsVisibleSetup] = useState([false, false]);
|
||||
|
|
@ -47,6 +48,12 @@ export default function Login() {
|
|||
const [checkUsernameValue, setCheckUsernameValue] = useState("");
|
||||
const MySwal = withReactContent(Swal);
|
||||
|
||||
useEffect(() => {
|
||||
if (accessToken) {
|
||||
router.push("/admin/dashboard");
|
||||
}
|
||||
}, []);
|
||||
|
||||
const setValUsername = (e: any) => {
|
||||
const uname = e.replaceAll(/[^\w.-]/g, "");
|
||||
setUsername(uname.toLowerCase());
|
||||
|
|
|
|||
|
|
@ -16,9 +16,11 @@ import { useEffect, useState } from "react";
|
|||
import { error, success } from "@/config/swal";
|
||||
import { subscription } from "@/services/subscribe";
|
||||
import { Image } from "@heroui/react";
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
export default function FooterNew(props: { margin?: boolean }) {
|
||||
const [emailValue, setEmailValue] = useState("");
|
||||
const accessToken = Cookies.get("access_token");
|
||||
|
||||
const doSubscribe = async () => {
|
||||
const isValidEmail = (email: string): boolean => {
|
||||
|
|
@ -197,7 +199,7 @@ export default function FooterNew(props: { margin?: boolean }) {
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<Link href={`/auth`}>
|
||||
<Link href={accessToken ? "/admin/dashboard" : `/auth`}>
|
||||
<Button className="mt-1 bg-[#BE0106] text-white">
|
||||
<p className="text-xs">Kontributor Wilayah</p>
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -560,10 +560,9 @@ export default function SuggestionsTable() {
|
|||
<SelectItem key="10">10</SelectItem>
|
||||
</Select>
|
||||
</div>
|
||||
<Button color="primary" className="text-white" onPress={doExport}>
|
||||
Export
|
||||
</Button>
|
||||
<div className=" w-[220px] h-[40px] flex flex-row gap-2 justify-between items-center">
|
||||
|
||||
<div className="flex flex-col gap-1 w-full lg:w-[120px]">
|
||||
<p className="font-semibold text-sm">Start Date</p>
|
||||
<Popover
|
||||
placement="bottom"
|
||||
classNames={{ content: ["!bg-transparent", "p-0"] }}
|
||||
|
|
@ -586,7 +585,10 @@ export default function SuggestionsTable() {
|
|||
/>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-1 w-full lg:w-[120px]">
|
||||
<p className="font-semibold text-sm">End Date</p>
|
||||
<Popover
|
||||
placement="bottom"
|
||||
classNames={{ content: ["!bg-transparent", "p-0"] }}
|
||||
|
|
@ -610,6 +612,13 @@ export default function SuggestionsTable() {
|
|||
</PopoverContent>
|
||||
</Popover>
|
||||
</div>
|
||||
|
||||
{/* <div className=" w-[220px] h-[40px] flex flex-row gap-2 justify-between items-center">
|
||||
|
||||
</div> */}
|
||||
<Button color="primary" className="text-white" onPress={doExport}>
|
||||
Export
|
||||
</Button>
|
||||
</div>
|
||||
<Table
|
||||
aria-label="micro issue table"
|
||||
|
|
|
|||
Loading…
Reference in New Issue