Skip to content

Commit

Permalink
Refactor: Separate data files to improve organization (fixes #22)
Browse files Browse the repository at this point in the history
  • Loading branch information
Solankimimoh committed Oct 5, 2024
1 parent 4dee2e3 commit 874f73e
Show file tree
Hide file tree
Showing 22 changed files with 339 additions and 326 deletions.
Binary file added public/images/team/naya.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import EventHeader from '@/components/sections/EventHeader';
import Communities from '@/components/sections/Communities';
import Sponsors from '@/components/sections/Sponsors';
import EventPhotos from '@/components/sections/EventPhotos';
import { eventHeader, venue } from '@/data/data';
import { eventHeader } from '@/data/eventData';
import Venue from '@/components/sections/Venue';
import { venue } from '@/data/venueData';

export default function Home() {
return (
<div className="flex flex-col justify-around gap-20" >
<div className="flex flex-col justify-around gap-20">
<section id="event" className="scroll-mt-20">
<EventHeader eventData={eventHeader} />
</section>
Expand Down
2 changes: 1 addition & 1 deletion src/app/speakers/[slug]/page.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { speakers2024 } from '@/data/data';
import { speakers2024 } from '@/data/speakers2024Data';
import Image from 'next/image';
import { FaLinkedinIn, FaRegEnvelope } from 'react-icons/fa';
import { CiGlobe, CiLinkedin } from 'react-icons/ci';
Expand Down
3 changes: 2 additions & 1 deletion src/app/speakers/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import SpeakerCard from '@/components/elements/SpeakerCard';
import YearSelector from '@/components/elements/YearSelector';
import PillButton from '@/components/elements/PillButton';
import TitleWithSubtitle from '@/components/elements/TitleWithSubtitle';
import { speakers2023, speakers2024 } from '@/data/data';
import { speakers2023 } from '@/data/speakers2023Data';
import { useState } from 'react';
import { v4 as uuidv4 } from 'uuid';
import { speakers2024 } from '@/data/speakers2024Data';

const Speakers = () => {
const [selectedYear, setSelectedYear] = useState(2024);
Expand Down
5 changes: 3 additions & 2 deletions src/app/team/page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import TitleWithSubtitle from '@/components/elements/TitleWithSubtitle';
import { team } from '@/data/data';
import { team } from '@/data/teamData';
import TeamMemberCard from '@/components/elements/TeamMemberCard';
import { sortTeamByFirstName } from '@/lib/utils';
import { v4 as uuidv4 } from 'uuid';

export default function Home() {

Expand All @@ -17,7 +18,7 @@ export default function Home() {

<ul className=" py-6 grid grid-cols-2 sm:grid-cols-2 md:grid-cols-3 gap-6 max-w-7xl mx-auto">
{sortedTeam.map(member => (
<li key={member.name} className="flex items-start">
<li key={uuidv4()} className="flex items-start">
<TeamMemberCard member={member} />
</li>
))}
Expand Down
13 changes: 7 additions & 6 deletions src/components/elements/Navbar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Link from 'next/link';
import { usePathname, useRouter } from 'next/navigation';
import { navigation } from '@/data/data';
import { navigationData } from '@/data/navigationData';
import { v4 as uuidv4 } from 'uuid';

const Navbar = ({ isMobile }) => {
const router = useRouter();
Expand All @@ -9,9 +10,9 @@ const Navbar = ({ isMobile }) => {

return (
<nav className={isMobile ? 'flex flex-col space-y-2 ' : 'hidden md:flex space-x-2 items-center'}>
{navigation.map((link) => (
{navigationData.map((link) => (
<Link
key={link.href}
key={uuidv4()}
href={link.href}
className={`
text-gray-800
Expand All @@ -22,9 +23,9 @@ const Navbar = ({ isMobile }) => {
hover:bg-gray-200
${!isMobile && 'rounded-full'}
${pathname === link.href
? 'bg-gray-300 text-gray-800' // Active link styles
: ''
}
? 'bg-gray-300 text-gray-800' // Active link styles
: ''
}
`}
>
{link.label}
Expand Down
6 changes: 4 additions & 2 deletions src/components/elements/YearSelector.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, { useState } from 'react';
import YearChip from '@/components/elements/YearChip';
import { v4 as uuidv4 } from 'uuid';

const YearSelector = ({ years, selectedYear, handleYearChange }) => {
return (
<div className="mb-4 flex gap-2">
{years.map(year => (<YearChip key={year} year={year} selectedYear={selectedYear} handleYearChange={handleYearChange} />))}
{years.map(year => (
<YearChip key={uuidv4()} year={year} selectedYear={selectedYear} handleYearChange={handleYearChange} />))}
</div>
);
};

export default YearSelector;
export default YearSelector;
2 changes: 1 addition & 1 deletion src/components/sections/Communities.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import CommunityCard from '@/components/elements/CommunityCard';
import TitleWithSubtitle from '@/components/elements/TitleWithSubtitle';
import { communities } from '@/data/data';
import { communities } from '@/data/communitiesData';

const Communities = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/sections/EventPhotos.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';
import TitleWithSubtitle from '@/components/elements/TitleWithSubtitle';
import { eventPhotos } from '@/data/data';
import { eventPhotos } from '@/data/eventPhotosData';
import Image from 'next/image';
import { v4 as uuidv4 } from 'uuid';
import PillButton from '@/components/elements/PillButton';
Expand Down
14 changes: 5 additions & 9 deletions src/components/sections/Sponsors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ import PillButton from '@/components/elements/PillButton';
import SponsorCard from '@/components/elements/SponsorCard';
import SponsorLevelTitle from '@/components/elements/SponsorLevelTitle';
import TitleWithSubtitle from '@/components/elements/TitleWithSubtitle';
import { sponsors } from '@/data/data';
import { sponsors, sponsorLevels } from '@/data/sponsorsData';
import { v4 as uuidv4 } from 'uuid';

const Sponsors = () => {
const sponsorLevels = [
{ title: 'Gold', level: 'gold' },
{ title: 'Silver', level: 'silver' },
{ title: 'Bronze', level: 'bronze' },
];

return (
<div className="flex flex-col gap-6 text-center items-center justify-center my-10">
<TitleWithSubtitle
Expand All @@ -21,13 +16,14 @@ const Sponsors = () => {
subTitleClassName="max-w-xl" />

{sponsorLevels.map(({ title, level }) => (
<SponsorLevel key={level} title={title} level={level} sponsors={sponsors} />
<SponsorLevel key={uuidv4()} title={title} level={level} sponsors={sponsors} />
))}


<PillButton
href="https://docs.google.com/presentation/d/1ezmE9o9o-EXhEa_ofPospL9hFGxAYm8xtnV_0m3AqSo/edit?usp=sharing"
label="Sponsorship Proposal" />

</div>

);
Expand All @@ -45,7 +41,7 @@ const SponsorLevel = ({ title, level, sponsors }) => (
);

function checkSponsorshipLevel(level) {
return function (partner) {
return function(partner) {
return level === partner.level;
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/sections/Venue.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'swiper/css/pagination';
import Image from 'next/image';
import { Autoplay, Navigation, Pagination } from 'swiper/modules';
import TitleWithSubtitle from '@/components/elements/TitleWithSubtitle';
import { v4 as uuidv4 } from 'uuid';

const Venue = ({ venueData }) => {
return (
Expand Down Expand Up @@ -56,7 +57,7 @@ const Venue = ({ venueData }) => {
className="h-full"
>
{venueData.images.map((image, index) => (
<SwiperSlide key={index} className="w-full h-[400px] lg:h-full">
<SwiperSlide key={uuidv4()} className="w-full h-[400px] lg:h-full">
<Image
src={image}
alt={`Venue Image ${index + 1}`}
Expand Down
20 changes: 20 additions & 0 deletions src/data/communitiesData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const communities = [{
logo: '/images/communities/gdg_montreal.svg', company: 'GDG Montreal', website: 'https://gdgmontreal.com/',
}, {
logo: '/images/communities/fluttermtl.svg', company: 'Flutter Montreal', website: 'https://fluttermtl.dev/',
}, {
logo: '/images/communities/wtm_mtl.svg', company: 'WTM Montreal', website: 'https://wtmmontreal.com/',
}, {
logo: '/images/communities/gdg_cloud.svg',
company: 'GDG Cloud Montreal',
website: 'https://gdg.community.dev/gdg-cloud-montreal/',
}, {
logo: '/images/communities/gdsc_concordia.svg',
company: 'GSDC Concordia',
website: 'https://gdsc.community.dev/concordia-university-montreal-canada/',
}, {
logo: '/images/communities/gdsc_mcgill.svg',
company: 'GSDC McGill',
website: 'https://gdsc.community.dev/mcgill-university-montreal-canada/',
}];

Loading

0 comments on commit 874f73e

Please sign in to comment.