Skip to content

Commit

Permalink
🛠️loading🪲fix
Browse files Browse the repository at this point in the history
Signed-off-by: Akhlak Hossain Jim <73884856+Akhlak-Hossain-Jim@users.noreply.github.com>
  • Loading branch information
Akhlak-Hossain-Jim authored and kombos committed Mar 1, 2024
1 parent 75f403b commit 0f9cd69
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ui_components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import { icons } from "@/utils/images";
import { useChain } from "@cosmos-kit/react";
import Image from "next/image";
import Link from "next/link";
import { useRouter, useSearchParams } from "next/navigation";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
import React, { useEffect, useState } from "react";
import NameListModal from "./NameListModal";
import Loading from "./Loading";

export default function Header() {
const router = useRouter();
const pathName = usePathname();
const query = useSearchParams();
const { address, connect, disconnect } = useChain(chain);

Expand Down Expand Up @@ -104,8 +105,10 @@ export default function Header() {
<>
<header className="fixed flex items-center justify-between gap-4 bg-white w-full left-0 md:px-12 py-5 z-[50] font-inter px-2">
<Link
href={`/?referral=${queryValue}&home=true`}
onClick={() => setLoadingState(true)}
href={`/?referral=${queryValue}${
pathName !== "/" ? "&home=true" : ""
}`}
onClick={() => pathName !== "/" && setLoadingState(true)}
>
<div className="col-span-1 flex items-center gap-2">
<Image
Expand Down Expand Up @@ -139,7 +142,7 @@ export default function Header() {
<div
className="relative"
onClick={() => {
setLoadingState(true);
pathName !== "/claim" && setLoadingState(true);
router.push(
`/claim?referral=${queryValue || namesList?.[0]?.name}`
);
Expand Down Expand Up @@ -201,7 +204,8 @@ export default function Header() {
type="button"
className="inline-block rounded-full buttonBg px-6 pb-2 pt-2.5 text-sm font-medium leading-normal text-white font-inter w-32 mb-2"
onClick={() => {
setLoadingState(true);
pathName !== `/profile/${namesList[0].name}` &&
setLoadingState(true);
router.push(
`/profile/${namesList[0].name}?referral=${
queryValue || namesList?.[0]?.name
Expand Down

0 comments on commit 0f9cd69

Please sign in to comment.