Skip to content

Commit

Permalink
feat: changed back btn on events
Browse files Browse the repository at this point in the history
  • Loading branch information
Animeshdj committed Oct 16, 2024
1 parent e9f29d4 commit 2c82f8e
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions app/events/[categoryname]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import grunge from "@/assets/Landing/Grunge.png";
import axios from "axios";
import eventcard from "../../../assets/Events/Carousel/eventcard.png";
import Preloader from "@/components/Preloader/Preloader";
import { useRouter } from "next/navigation";

const categories = [
"music",
Expand All @@ -19,10 +20,19 @@ const categories = [
];

export default function Page({ params }: { params: { categoryname: string } }) {
const router = useRouter();
const [eventsList, setEventsList] = useState<any>([]);
const [eventID, setEventID] = useState(0);
const [loading, setLoading] = useState(true);

const handleBack = () => {
if (window.history.length > 1) {
router.back();
} else {
router.push("/");
}
};

useEffect(() => {
document.body.style.overflow = "hidden";
}, []);
Expand Down Expand Up @@ -80,21 +90,19 @@ export default function Page({ params }: { params: { categoryname: string } }) {
zIndex: 1,
}}
/>
<div className={styles.backBtn}>
<Link href="/events">
<svg
width="76"
height="60"
viewBox="0 0 76 60"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M33.7706 2.2295C32.7704 1.22965 31.4141 0.667969 29.9999 0.667969C28.5857 0.667969 27.2294 1.22965 26.2293 2.2295L2.22925 26.2295C1.22941 27.2296 0.667725 28.586 0.667725 30.0002C0.667725 31.4144 1.22941 32.7707 2.22925 33.7708L26.2293 57.7708C27.2351 58.7423 28.5823 59.2799 29.9807 59.2678C31.3791 59.2556 32.7168 58.6947 33.7056 57.7059C34.6945 56.717 35.2554 55.3794 35.2675 53.981C35.2797 52.5826 34.7421 51.2354 33.7706 50.2295L19.3333 35.3335H69.9999C71.4144 35.3335 72.771 34.7716 73.7712 33.7714C74.7713 32.7712 75.3333 31.4147 75.3333 30.0002C75.3333 28.5857 74.7713 27.2291 73.7712 26.2289C72.771 25.2287 71.4144 24.6668 69.9999 24.6668H19.3333L33.7706 9.77083C34.7704 8.77068 35.3321 7.41437 35.3321 6.00016C35.3321 4.58595 34.7704 3.22964 33.7706 2.2295Z"
fill="white"
/>
</svg>
</Link>
<div className={styles.backBtn} onClick={handleBack}>
<svg
width="76"
height="60"
viewBox="0 0 76 60"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M33.7706 2.2295C32.7704 1.22965 31.4141 0.667969 29.9999 0.667969C28.5857 0.667969 27.2294 1.22965 26.2293 2.2295L2.22925 26.2295C1.22941 27.2296 0.667725 28.586 0.667725 30.0002C0.667725 31.4144 1.22941 32.7707 2.22925 33.7708L26.2293 57.7708C27.2351 58.7423 28.5823 59.2799 29.9807 59.2678C31.3791 59.2556 32.7168 58.6947 33.7056 57.7059C34.6945 56.717 35.2554 55.3794 35.2675 53.981C35.2797 52.5826 34.7421 51.2354 33.7706 50.2295L19.3333 35.3335H69.9999C71.4144 35.3335 72.771 34.7716 73.7712 33.7714C74.7713 32.7712 75.3333 31.4147 75.3333 30.0002C75.3333 28.5857 74.7713 27.2291 73.7712 26.2289C72.771 25.2287 71.4144 24.6668 69.9999 24.6668H19.3333L33.7706 9.77083C34.7704 8.77068 35.3321 7.41437 35.3321 6.00016C35.3321 4.58595 34.7704 3.22964 33.7706 2.2295Z"
fill="white"
/>
</svg>
</div>

<div className={styles.textBackground}>
Expand Down

0 comments on commit 2c82f8e

Please sign in to comment.