Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds events section #93

Merged
merged 5 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions e2e/events.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { test, expect } from '@playwright/test';

test.beforeEach(async ({ page }) => {
await page.goto('http://localhost:3000');
});

test.describe('Test if see more link is clickable', () => {
test('should navigate to the correct URL when See More is clicked', async ({
page,
}) => {
const [newPage] = await Promise.all([
page.waitForEvent('popup'),
page.locator('#events >> text="See More"').click(),
]);
await expect(newPage).toHaveURL(
'https://kommunity.com/reactjs-developer-community-kenya-reactdevske/events'
);
});
});
Binary file added public/images/community_sessions.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/no-image.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/physical_meetup.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weekly_standups.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ import React, { useState } from 'react';
import Image from 'next/image';
import { booleanFilter } from '../../util/booleanFilter';
import type { EventData } from '../../types';
import Link from 'next/link';

type DisplayRCProps = EventData;

export default function DisplayRC({
name,
src,
event,
title,
image_url: src,
description,
venue,
date,
target,
}: DisplayRCProps) {
const [loading, setLoading] = useState(true);
return (
<div className="bg-white flex flex-col rounded-lg px-6 py-4 gap-y-2 shadow-md">
<div className="aspect-w-1 aspect-h-1 w-full overflow-hidden rounded-lg">
<div className="flex flex-col px-6 py-4 bg-white rounded-lg shadow-md gap-y-2">
<div className="w-full overflow-hidden rounded-lg cursor-auto aspect-w-1 aspect-h-1">
<Image
alt=" "
alt={description}
src={!src ? 'https://bit.ly/placeholder-img' : src}
layout="fill"
objectFit="cover"
Expand All @@ -31,15 +30,12 @@ export default function DisplayRC({
onLoadingComplete={() => setLoading(false)}
/>
</div>
<h2 className="text-lg font-bold">{name}</h2>
{event ? (
<div className="flex flex-col gap-y-4 md:py-5 lg:py-10">
<p className="text-md font-medium">Venue: {venue}</p>
<p className="text-md font-medium">Date: {date}</p>
</div>
) : (
<p className="flex justify-center text-md ">{description}</p>
)}
<h2 className="text-lg md:text-xl font-bold cursor-pointer hover:text-[#09AFC6]">
<Link href={target}>
<a target="_blank">{title}</a>
</Link>
</h2>
<p className="flex justify-center text-md md:pb-1">{description}</p>
</div>
);
}
88 changes: 88 additions & 0 deletions src/components/Events/Events.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import Link from 'next/link';
import React from 'react';
import type { EventData } from '../../types/index';
import DisplayRC from './DisplayRC';

const events: EventData[] = [
{
id: 1,
title: 'Physical Meetups',
description: 'Physical meetups where we share, learn and network.',
image_url: '/images/physical_meetup.jpg',
target:
'https://kommunity.com/reactjs-developer-community-kenya-reactdevske/events',
},
{
id: 2,
title: 'Weekly Online Standups',
description:
'Weekly open calls in the community’s Telegram group discussing industry-related topics.',
image_url: '/images/weekly_standups.png',
target: 'https://bit.ly/joinreactdevske',
},
{
id: 3,
title: 'Community Power Sessions',
description:
'Community members meet and share technical concepts with other members of the community.',
image_url: '/images/community_sessions.png',
target: 'https://www.youtube.com/channel/UC9_eVcPBk4T-DcZLHpQfy4w/videos',
},
{
id: 4,
title: 'Joint Meetups',
description: 'Meetups hosted in collaboration with other tech communities.',
image_url: 'https://bit.ly/placeholder-img',
target:
'https://kommunity.com/reactjs-developer-community-kenya-reactdevske/events',
},
{
id: 5,
title: 'Monthly Online Standups',
description:
'Monthly open calls on Google Meet bringing together people from different communities.',
image_url: '/images/physical_meetup.jpg',
target:
'https://kommunity.com/reactjs-developer-community-kenya-reactdevske/events',
},
{
id: 6,
title: 'Community Challenges',
description:
'We organize open source challenges to keep the community engaged.',
image_url: '/images/physical_meetup.jpg',
target: 'https://github.com/reactdeveloperske/community-coding-challenges',
},
];

export default function Events() {
return (
<section
id="events"
className="relative flex flex-col items-center justify-center w-full py-16 bg-white md:py-20 gap-y-2 md:gap-y-5"
>
<p className="flex items-center justify-center font-light tracking-wide">
Events
</p>
<h2 className="pb-2 text-2xl font-bold md:pb-10">Community Events</h2>
<div className="grid grid-cols-1 gap-y-4 md:gap-y-10 gap-x-6 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 xl:gap-x-8 md:grid-cols-2 bg-[#09AFC6] px-4 md:px-10 lg:px-16 py-8 md:py-14 xl:py-16">
{events.map((event) => (
<DisplayRC
key={event.id}
id={event.id}
title={event.title}
image_url={event.image_url}
description={event.description}
target={event.target}
/>
))}

<div className="flex items-center justify-center pt-1 tracking-wide text-white md:pt-0 md:text-right md:absolute md:bottom-24 md:right-10 2xl:bottom-36 lg:right-16 hover:tracking-widest hover:transition-all hover:duration-500 hover:underline">
<Link href="https://kommunity.com/reactjs-developer-community-kenya-reactdevske/events">
<a target="_blank">See More</a>
</Link>
</div>
</div>
</section>
);
}
1 change: 0 additions & 1 deletion src/components/EventsDisplay/index.ts

This file was deleted.

124 changes: 0 additions & 124 deletions src/pages/events/index.page.tsx

This file was deleted.

10 changes: 6 additions & 4 deletions src/pages/index.page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Head from 'next/head';
import Image from 'next/image';
import logo from '../../public/reactdevske.svg';
import Events from '../components/Events/Events';

export default function Home() {
return (
Expand All @@ -20,21 +21,21 @@ export default function Home() {
</Head>

<main className="">
<h1 className="text-center pt-6 text-3xl text-white font-bold font-montserrat">
<h1 className="pt-6 text-3xl font-bold text-center text-white font-montserrat">
React Developer Community Kenya
</h1>
<p className="text-center text-xl text-white font-montserrat">
<p className="text-xl text-center text-white font-montserrat">
A Community of Reactjs developers in Kenya
</p>
<div className="flex flex-col justify-center content-center pt-5">
<div className="flex flex-col content-center justify-center pt-5">
<Image
src={logo}
className="App-logo"
alt="logo"
width={400}
height={400}
/>
<p className="flex justify-center text-white pt-10">
<p className="flex justify-center pt-10 text-white">
🚧Under construction...
</p>
<a
Expand All @@ -48,6 +49,7 @@ export default function Home() {
</button>
</a>
</div>
<Events />
</main>
</div>
);
Expand Down
9 changes: 4 additions & 5 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export type EventData = {
name: string;
src: string;
event: boolean;
id: number;
title: string;
image_url: string;
description: string;
venue: string;
date: string;
target: string;
};