Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e7dea93

Browse files
authored
feat: componetize h1 h2 (#307)
* Created Headings components for h1 and h2 * Replaced h1 and h2 with newly created H1 and H2 components * Removed isAuth props and just used h2 in login and register pages * Added defaultStyles for H1 component except for margin properties * Utilized forwardRef to add option to add more attributes to H1 and H2. Removed id props from H2 component. * Added display name for lint formatting
1 parent e21ff99 commit e7dea93

9 files changed

Lines changed: 93 additions & 65 deletions

File tree

src/components/About.jsx

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
import { Container } from '@/components/Container'
22
import Image from 'next/image'
3-
import GithubStar from '@/images/about/2021star.png'
4-
import Support from '@/images/about/support.png'
5-
import Eddiebot from '@/images/about/eddiebot.png'
3+
import GithubStar from '@/images/about/2021star.png'
4+
import Support from '@/images/about/support.png'
5+
import Eddiebot from '@/images/about/eddiebot.png'
6+
import { H1, H2 } from '@/components/Headings'
67

78
export function Content() {
89
return (
910
<section id="about" className="relative overflow-hidden bg-slate-50 py-32">
1011
<Container className="relative">
1112
<div>
12-
<h1 className="mt-3 text-4xl font-semibold text-gray-900">About</h1>
13-
<p className="my-4 text-lg tracking-tight">Read more about where EddieHub started and the core values of the community.</p>
14-
<h2 className="font-display text-3xl tracking-tight sm:text-4xl">
15-
Our Background
16-
</h2>
13+
<H1 className="mt-3">About</H1>
14+
<p className="my-4 text-lg tracking-tight">
15+
Read more about where EddieHub started and the core values of the
16+
community.
17+
</p>
18+
<H2>Our Background</H2>
1719
<Image
18-
className="mx-auto"
19-
src={GithubStar}
20-
alt="github star 2021 badge"
21-
width="auto"
22-
height="250"
23-
/>
20+
className="mx-auto"
21+
src={GithubStar}
22+
alt="github star 2021 badge"
23+
width="auto"
24+
height="250"
25+
/>
2426
<p className="mt-4 text-lg tracking-tight">
2527
EddieHub was founded by Eddie Jaoude, GitHub Star, GitHub Star of
2628
the Year 2020 and winner of the GitHub Community Growth Award 2021.
@@ -43,9 +45,7 @@ export function Content() {
4345
First, Code Second” quickly became what the community members live
4446
by.
4547
</p>
46-
<h2 className="font-display mt-5 text-3xl tracking-tight sm:text-4xl">
47-
Our Aims
48-
</h2>
48+
<H2 className="mt-5">Our Aims</H2>
4949
<p className="mt-4 text-lg tracking-tight">
5050
EddieHub’s overall aim is to support members in: accelerating their
5151
learnings so that they can have the career they want.
@@ -72,12 +72,12 @@ export function Content() {
7272
</p>
7373
</li>
7474
<Image
75-
className="mx-auto"
76-
src={Support}
77-
alt="github support"
78-
width="auto"
79-
height="500"
80-
/>
75+
className="mx-auto"
76+
src={Support}
77+
alt="github support"
78+
width="auto"
79+
height="500"
80+
/>
8181
<li>
8282
Building upon your communication skills
8383
<p className="mt-4 text-lg tracking-tight">
@@ -118,9 +118,7 @@ export function Content() {
118118
</p>
119119
</li>
120120
</ol>
121-
<h2 className="font-display mt-5 text-3xl tracking-tight sm:text-4xl">
122-
Our Core Values
123-
</h2>
121+
<H2 className="mt-5">Our Core Values</H2>
124122
<p>Behind these aims are EddieHub’s core values:</p>
125123
<ol className="mt-4 list-decimal text-lg tracking-tight">
126124
<li>

src/components/Faqs.jsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Image from 'next/image'
22

33
import { Container } from '@/components/Container'
4+
import { H2 } from '@/components/Headings'
45

56
const faqs = [
67
[
@@ -11,7 +12,8 @@ const faqs = [
1112
},
1213
{
1314
question: 'How do I join the EddieHub GitHub Organisation?',
14-
answer: 'If you would like to join the EddieHub GitHub organisation, then please fill out this form so that you can get an automatic invite to the organisation. If you want the organisation to appear on your profile then make sure that you make it public (as by default it is marked as private).',
15+
answer:
16+
'If you would like to join the EddieHub GitHub organisation, then please fill out this form so that you can get an automatic invite to the organisation. If you want the organisation to appear on your profile then make sure that you make it public (as by default it is marked as private).',
1517
},
1618
{
1719
question: 'Who is EddieHub for?',
@@ -23,11 +25,10 @@ const faqs = [
2325
{
2426
question: 'I am new to coding and / or Open Source, can I still join?',
2527
answer:
26-
'Yes! Starting out can sometimes feel lonely and overwhelming particularly with the amount of information out there. In EddieHub Discord you will find supportive channels such as #help and #first-timers. Also Eddie\'s YouTube channel is a good resource when starting out.',
28+
"Yes! Starting out can sometimes feel lonely and overwhelming particularly with the amount of information out there. In EddieHub Discord you will find supportive channels such as #help and #first-timers. Also Eddie's YouTube channel is a good resource when starting out.",
2729
},
2830
{
29-
question:
30-
'Can I find a mentor in EddieHub?',
31+
question: 'Can I find a mentor in EddieHub?',
3132
answer:
3233
'At EddieHub we believe that everyone is a mentor and can help others in the community. This community approach is beneficial for the mentee as they are exposed to various perspectives, and for the mentor they develop many of their communication and collaboration skills. Even if you are one month into your journey, there is someone who is one day in and who can benefit from your experience and insight.',
3334
},
@@ -45,13 +46,13 @@ const faqs = [
4546
'At EddieHub we are passionate about moving away from gender favouring, polarising, race related, religion inconsiderate or other unequal phrasing. Therefore if you use terms such as “Hi Guys”, then EddieBot responds with a notification highlighting that this is not inclusive language and will suggest alternatives.',
4647
},
4748
{
48-
question: 'I just joined, why can\'t I post links on Discord?',
49-
answer: 'You have recently joined the community and you have tried to share a link, but found that NightBot has deleted this message. We appreciate that the community is a place to share your work, which we encourage only for our regular community members (aka “Team Eddie”). To become a regular and get the role "Team Eddie", we highly suggest to get involved in the community conversation and add value by helping other community members.',
49+
question: "I just joined, why can't I post links on Discord?",
50+
answer:
51+
'You have recently joined the community and you have tried to share a link, but found that NightBot has deleted this message. We appreciate that the community is a place to share your work, which we encourage only for our regular community members (aka “Team Eddie”). To become a regular and get the role "Team Eddie", we highly suggest to get involved in the community conversation and add value by helping other community members.',
5052
},
5153
{
5254
question: 'I love Hubber! Can I use the EddieHub mascot and logo?',
53-
answer:
54-
'Check what you can and cannot do on our Branding page.',
55+
answer: 'Check what you can and cannot do on our Branding page.',
5556
},
5657
],
5758
]
@@ -65,12 +66,9 @@ export function Faqs() {
6566
>
6667
<Container className="relative">
6768
<div className="mx-auto max-w-2xl lg:mx-0">
68-
<h2
69-
id="faq-title"
70-
className="font-display text-3xl tracking-tight text-slate-900 sm:text-4xl"
71-
>
69+
<H2 id="faq-title" className="text-slate-900">
7270
Frequently asked questions
73-
</h2>
71+
</H2>
7472
<p className="mt-4 text-lg tracking-tight text-slate-700">
7573
If you can’t find what you’re looking for, email our support team
7674
and if you’re lucky someone will get back to you.

src/components/Headings.jsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react'
2+
import clsx from 'clsx'
3+
4+
export const H1 = React.forwardRef(({ children, className, ...rest }, ref) => {
5+
const defaultClass =
6+
'max-w-4xl font-display text-5xl font-medium tracking-tight text-slate-900 sm:text-7xl'
7+
return (
8+
<h1 ref={ref} className={clsx(defaultClass, className)} {...rest}>
9+
{children}
10+
</h1>
11+
)
12+
})
13+
H1.displayName = 'H1'
14+
15+
export const H2 = React.forwardRef(({ children, className, ...rest }, ref) => {
16+
const defaultClass = 'font-display text-3xl tracking-tight sm:text-4xl'
17+
return (
18+
<h2 ref={ref} className={clsx(defaultClass, className)} {...rest}>
19+
{children}
20+
</h2>
21+
)
22+
})
23+
H2.displayName = 'H2'

src/components/Hero.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { Button } from '@/components/Button'
22
import { Container } from '@/components/Container'
3+
import { H1 } from '@/components/Headings'
34

45
export function Hero() {
56
return (
67
<Container className="pb-16 pt-20 text-center lg:pt-32">
7-
<h1 className="mx-auto max-w-4xl font-display text-5xl font-medium tracking-tight text-slate-900 sm:text-7xl">
8+
<H1 className="mx-auto">
89
Open Source{' '}
910
<span className="relative whitespace-nowrap text-primary-600">
1011
<svg
@@ -18,7 +19,7 @@ export function Hero() {
1819
<span className="relative">community</span>
1920
</span>{' '}
2021
aimed at encouraging and promoting communication.
21-
</h1>
22+
</H1>
2223
<p className="mx-auto mt-6 max-w-2xl text-lg tracking-tight text-slate-700">
2324
Best practices and technical expertise in an inclusive and welcoming
2425
environment

src/components/Moderators.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Container } from '@/components/Container'
22
import Image from 'next/image'
3+
import { H2 } from '@/components/Headings'
34

45
const people = [
56
{
@@ -78,13 +79,13 @@ export function Moderators() {
7879
>
7980
<Container>
8081
<div className="md:text-center">
81-
<h2 className="font-display text-3xl tracking-tight text-white sm:text-4xl">
82+
<H2 className="text-white">
8283
<span className="relative whitespace-nowrap">
8384
<SwirlyDoodle className="absolute left-0 top-1/2 h-[1em] w-full fill-primary-400" />
8485
<span className="relative">EddieHub</span>
8586
</span>{' '}
8687
Moderators.
87-
</h2>
88+
</H2>
8889
<p className="mt-4 text-lg text-slate-400">
8990
Our awesome Moderators providing support through all timezones
9091
</p>

src/components/Newsletter.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Container } from '@/components/Container'
22
import Image from 'next/image'
3+
import { H2 } from '@/components/Headings'
34

45
import CommunityAward from '@/images/awards/github-award-community-growth-eddie-jaoude.jpeg'
56
import TeacherAward from '@/images/awards/github-award-top-teacher-eddie-jaoude.jpeg'
@@ -12,9 +13,7 @@ export function Newsletter() {
1213
>
1314
<Container className="relative space-y-16">
1415
<div className="mx-auto max-w-lg text-center">
15-
<h2 className="font-display text-3xl tracking-tight text-white sm:text-4xl">
16-
Subscribe to the EddieHub Newsletter
17-
</h2>
16+
<H2 className="text-white">Subscribe to the EddieHub Newsletter</H2>
1817
<div className="my-4">
1918
<iframe
2019
src="https://eddiehub.substack.com/embed"

src/components/PrimaryFeatures.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Tab } from '@headlessui/react'
66
import clsx from 'clsx'
77

88
import { Container } from '@/components/Container'
9+
import { H2 } from '@/components/Headings'
910
import GitHubBioDrop from '@/images/screenshots/github-biodrop.png'
1011
import GitHubOrg from '@/images/screenshots/github-eddiehub-org.png'
1112
import GitHubGoodFirstIssueFinder from '@/images/screenshots/github-good-first-issue-finder.png'
@@ -62,9 +63,9 @@ export function PrimaryFeatures() {
6263
>
6364
<Container className="relative">
6465
<div className="max-w-2xl md:mx-auto md:text-center xl:max-w-none">
65-
<h2 className="font-display text-3xl tracking-tight text-white sm:text-4xl md:text-5xl">
66+
<H2 className="text-white md:text-5xl">
6667
Here are some of our active GitHub repositories
67-
</h2>
68+
</H2>
6869
<p className="mt-6 text-lg tracking-tight text-primary-100">
6970
Everyone is welcome to come and contribute to our open source
7071
projects.

src/components/SecondaryFeatures.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Tab } from '@headlessui/react'
66
import clsx from 'clsx'
77

88
import { Container } from '@/components/Container'
9+
import { H2 } from '@/components/Headings'
910
import DiscordLogo from '@/images/logos/discord.svg'
1011
import GitHubLogo from '@/images/logos/github.svg'
1112

@@ -148,9 +149,7 @@ export function SecondaryFeatures() {
148149
>
149150
<Container>
150151
<div className="mx-auto max-w-2xl md:text-center">
151-
<h2 className="font-display text-3xl tracking-tight text-slate-900 sm:text-4xl">
152-
Why be part of EddieHub?
153-
</h2>
152+
<H2 className="text-slate-900">Why be part of EddieHub?</H2>
154153
<p className="mt-4 text-lg tracking-tight text-slate-700">
155154
Accelerate your career, skills and grow your network, while having
156155
fun!

src/components/Testimonials.jsx

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Image from 'next/image'
22
import Link from 'next/link'
33

44
import { Container } from '@/components/Container'
5+
import { H2 } from '@/components/Headings'
56

67
const testimonials = [
78
[
@@ -10,22 +11,23 @@ const testimonials = [
1011
'Started contributing and building my GitHub profile and already got a job interview request based on my GitHub activity. So I really appreciate what you do here!',
1112
author: {
1213
name: 'emanuel_dev',
13-
username: 'EmanuelGF'
14+
username: 'EmanuelGF',
1415
},
1516
},
1617
{
17-
content: 'EddieHub is like a family to me! We get really warm welcomes here! We get all our issues solved by each others\' #help :) We get our 🟩 treats here! EddieHub is awesome. By Awesome I mean Awesome! It is a 10/5 rating!',
18+
content:
19+
"EddieHub is like a family to me! We get really warm welcomes here! We get all our issues solved by each others' #help :) We get our 🟩 treats here! EddieHub is awesome. By Awesome I mean Awesome! It is a 10/5 rating!",
1820
author: {
1921
name: 'Krish Gupta',
20-
username: 'xkrishguptaa'
21-
}
22+
username: 'xkrishguptaa',
23+
},
2224
},
2325
{
2426
content:
2527
"EddieHub is like a family to me! We get really warm welcomes here! We get all our issues solved by each others' #help :) We get our 🟩 treats here! EddieHub is awesome. By Awesome I mean Awesome! It is a 10/5 rating!",
2628
author: {
2729
name: 'Vincent Villafuerte',
28-
username: 'vinzvinci'
30+
username: 'vinzvinci',
2931
},
3032
},
3133
],
@@ -35,15 +37,15 @@ const testimonials = [
3537
"It's everything anyone could ever ask for in a community. Wholesome, Encouraging, Open Source and everything nice! Best thing happened in 2020. I'll be always thankful to this community and keep contributing here. It's beyond rating of 5 stars. 3000/5 ⭐",
3638
author: {
3739
name: 'Karuna Tata',
38-
username: 'starlightknown'
40+
username: 'starlightknown',
3941
},
4042
},
4143
{
4244
content:
4345
'EddieHub is the best growing 🚀 Open-Source community. Here, you can help each other by raising issues, solving doubts on the help channel, show your work (projects), make good connections and so many things.I would recommend all beginners to join the most respectful, collaborative and loving Open-Source community.Thanks @eddiejaoude, we support you!',
4446
author: {
4547
name: 'akhileshthite',
46-
username: 'akhileshthite'
48+
username: 'akhileshthite',
4749
},
4850
},
4951
],
@@ -53,15 +55,15 @@ const testimonials = [
5355
'Eddiehub has helped me to understand the importance of Open Source and how easy it is to collaborate with developers from around the world to work on different projects and learn from each other in an amazing community.',
5456
author: {
5557
name: 'Evavic44',
56-
username: 'Evavic44'
58+
username: 'Evavic44',
5759
},
5860
},
5961
{
6062
content:
6163
"This is just an awesome community. This is the first community I have seen which puts collaboration first than the code. Collaborative people make a collaborative community and EddieHub is a perfect example of it 😄. I can't rate this community on the scale because priceless things can't be quantified ❤️",
6264
author: {
6365
name: 'Kaiwalya Koparkar',
64-
username: 'kaiwalyakoparkar'
66+
username: 'kaiwalyakoparkar',
6567
},
6668
},
6769
],
@@ -84,9 +86,7 @@ export function Testimonials() {
8486
>
8587
<Container>
8688
<div className="mx-auto max-w-2xl md:text-center">
87-
<h2 className="font-display text-3xl tracking-tight text-slate-900 sm:text-4xl">
88-
Testimonials
89-
</h2>
89+
<H2 className="text-slate-900">Testimonials</H2>
9090
<p className="mt-4 text-lg tracking-tight text-slate-700">
9191
What it means to be part of this community in the members&lsquo; own
9292
words
@@ -114,13 +114,21 @@ export function Testimonials() {
114114
{testimonial.author.name}
115115
</div>
116116
<div className="mt-1 text-sm text-slate-500">
117-
<Link href={`https://github.com/${testimonial.author.username}`}>@{testimonial.author.username}</Link>
117+
<Link
118+
href={`https://github.com/${testimonial.author.username}`}
119+
>
120+
@{testimonial.author.username}
121+
</Link>
118122
</div>
119123
</div>
120124
<div className="overflow-hidden rounded-full bg-slate-50">
121125
<Image
122126
className="h-14 w-14 object-cover"
123-
src={'https://github.com/' + testimonial.author.username + '.png'}
127+
src={
128+
'https://github.com/' +
129+
testimonial.author.username +
130+
'.png'
131+
}
124132
alt=""
125133
width={56}
126134
height={56}

0 commit comments

Comments
 (0)