Skip to content

Commit

Permalink
Fixed ticketing UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Artilleryxd committed Sep 30, 2024
2 parents 93f12ad + 6a002b0 commit 3cb3740
Show file tree
Hide file tree
Showing 21 changed files with 3,789 additions and 353 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules
.next
*.local
.env.local
.env
30 changes: 15 additions & 15 deletions components/BlogCard.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from "react"
import { Card } from "./common/Card"
import { blogdata } from "@/assets/data/dummydata"
// import React from "react"
// import { Card } from "./common/Card"
// import { blogdata } from "@/assets/data/dummydata"

const BlogCard = () => {
return (
<>
<div className='container blog-card grid-2 py'>
{blogdata.map((item) => (
<Card data={item} key={item.id} path='blogs' />
))}
</div>
</>
)
}
// const BlogCard = () => {
// return (
// <>
// <div className='container blog-card grid-2 py'>
// {blogdata.map((item) => (
// <Card data={item} key={item.id} path='blogs' />
// ))}
// </div>
// </>
// )
// }

export default BlogCard
// export default BlogCard
2 changes: 0 additions & 2 deletions components/HeroPage/BrandCarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,11 @@ const BrandCarousel = () => {
</div>
<div className="Sponsor-container">
<div className="SponsorCard">
<a>
<img
className="SponsorImg"
src="https://res.cloudinary.com/dueoon8xe/image/upload/v1727377745/Silver_Sponsor_s3ia9o.svg"
alt="Event 1 Image"
/>
</a>
</div>
<div className="outerHrHolder">
<div className="innerHr1"></div>
Expand Down
17 changes: 6 additions & 11 deletions components/HeroPage/HeroMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import AOS from "aos";
import Link from "next/link";

function HeroMain() {
const eventId = 'mckrPpdQi0JqD4HF2uvh'; //pelase add eventid here
useEffect(() => {
AOS.init({
duration: 2500, // Animation duration in milliseconds
Expand All @@ -28,17 +29,11 @@ function HeroMain() {
#CapTech2024 <br />
25th - 28th November 2024
</h2>
<button
className="secondary-button"
onClick={() =>
window.open(
"https://www.eventbrite.com.au/e/captech2024-discover-connect-execute-tickets-772015889307",
"_blank"
)
}
>
Book Your Tickets
</button>
<Link href={`/ticket-purchase?eventId=${eventId}`}>
<button className="secondary-button">
Buy Tickets
</button>
</Link>
<div style={{ display: "flex" }}>
<button
className="button-primary"
Expand Down
28 changes: 28 additions & 0 deletions lib/firebase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// lib/firebase.js
import { initializeApp, getApps, getApp } from "firebase/app";
import { getAuth } from 'firebase/auth';
import { getFirestore } from 'firebase/firestore';

// Your Firebase configuration
const firebaseConfig = {
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
};

// Check if Firebase app is already initialized
let app;
if (getApps().length === 0) {
app = initializeApp(firebaseConfig);
} else {
app = getApp(); // Use the already initialized app
}

// Initialize Firestore and Auth
const db = getFirestore(app);
const auth = getAuth(app);

export { db, auth };
25 changes: 25 additions & 0 deletions lib/withAuth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// lib/withAuth.js
import { useEffect } from 'react';
import { useRouter } from 'next/router';
import { auth } from '../lib/firebase'; // Import Firebase auth

const withAuth = (WrappedComponent) => {
return (props) => {
const router = useRouter();

useEffect(() => {
const unsubscribe = auth.onAuthStateChanged((user) => {
if (!user) {
// If no user, redirect to login page
router.push('/login');
}
});

return () => unsubscribe(); // Cleanup subscription on unmount
}, []);

return <WrappedComponent {...props} />;
};
};

export default withAuth;
Loading

0 comments on commit 3cb3740

Please sign in to comment.