Skip to content

Commit 66bd600

Browse files
Merge pull request #137 from aditya-tiwari-zs/FEAT/ADD-COMPANY-LOGO
Feat/add company logo
2 parents 30b9f46 + dca0212 commit 66bd600

13 files changed

+3798
-3800
lines changed

src/components/CompanyTrustedList.jsx

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { formatGitHubStars } from '../../utils'
2+
import company1 from '@/images/logo1.svg'
3+
import company2 from '@/images/logo2.svg'
4+
import company3 from '@/images/logo3.svg'
5+
import company4 from '@/images/logo4.svg'
6+
import company5 from '@/images/logo5.svg'
7+
import company6 from '@/images/logo6.svg'
8+
import company7 from '@/images/logo7.svg'
9+
import company8 from '@/images/logo8.svg'
10+
import Image from 'next/image'
11+
import { useEffect, useState } from 'react'
12+
13+
const imageLink = [
14+
{
15+
image: company2,
16+
},
17+
{
18+
image: company3,
19+
},
20+
{
21+
image: company6,
22+
},
23+
{
24+
image: company7,
25+
},
26+
{
27+
image: company8,
28+
},
29+
{
30+
image: company1,
31+
},
32+
{
33+
image: company4,
34+
},
35+
{
36+
image: company5,
37+
},
38+
]
39+
40+
export default function CompanyList() {
41+
const [githubStars, setGithubStars] = useState('3500+')
42+
43+
useEffect(() => {
44+
setGithubStars(formatGitHubStars('githubStars'))
45+
}, [])
46+
return (
47+
<div className="bg-gray-900 py-16 sm:py-10">
48+
<div className="mx-auto max-w-7xl px-6 lg:px-8">
49+
<h2 className="text-center text-lg/8 font-semibold text-white">
50+
Trusted by {githubStars} Developers at Companies Like:
51+
</h2>
52+
<div className="mt-10 flex flex-wrap justify-center gap-x-0 gap-y-10 sm:max-w-none lg:mx-0">
53+
{imageLink.map((item, index) => (
54+
<div
55+
key={index}
56+
className="flex max-h-12 w-1/4 justify-center sm:w-1/6 lg:w-1/5"
57+
>
58+
<Image
59+
alt="Transistor"
60+
src={item.image}
61+
width={158}
62+
height={48}
63+
className="max-h-12 object-contain"
64+
/>
65+
</div>
66+
))}
67+
</div>
68+
</div>
69+
</div>
70+
)
71+
}

src/components/HomePage.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use client'
2+
import CompanyList from './CompanyTrustedList'
23
import DBlistComponent from './DBlistComponent'
34
import { Hero } from './Hero'
45
import { Testimonials } from './Testimonials'
@@ -7,6 +8,7 @@ export function HomePage() {
78
return (
89
<div className="m-auto w-auto max-w-screen-2xl">
910
<Hero />
11+
<CompanyList />
1012
<div className="not-prose my-12 grid grid-cols-1 gap-6 px-4 md:grid-cols-3 lg:px-8 xl:px-12">
1113
<QuickLink
1214
title="Battle-Tested at Enterprise Scale"

src/components/Layout.jsx

+13-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function Header() {
2424
let [isScrolled, setIsScrolled] = useState(false)
2525
let pathname = usePathname()
2626
const isCertificate = pathname.includes('certificate')
27-
const isEvents = pathname.includes('events');
27+
const isEvents = pathname.includes('events')
2828
const [githubStars, setGithubStars] = useState(null)
2929

3030
useEffect(() => {
@@ -37,7 +37,11 @@ function Header() {
3737
throw new Error('Network response was not ok')
3838
}
3939
const data = await response.json()
40-
if (data?.watchers) setGithubStars(data?.watchers)
40+
41+
if (data?.watchers) {
42+
setGithubStars(data.watchers)
43+
localStorage.setItem('githubStars', data.watchers)
44+
}
4145
} catch (error) {
4246
console.error('Error fetching the repo data:', error)
4347
}
@@ -82,7 +86,13 @@ function Header() {
8286
<Search />
8387
</div>
8488
)}
85-
{isEvents && <div className='relative flex flex-grow basis-0 items-center justify-center sm:block hidden'><h1 className="justify-center items-center text-xl sm:text-3xl md:text-4xl font-bold text-center text-white">Events</h1></div>}
89+
{isEvents && (
90+
<div className="relative flex hidden flex-grow basis-0 items-center justify-center sm:block">
91+
<h1 className="items-center justify-center text-center text-xl font-bold text-white sm:text-3xl md:text-4xl">
92+
Events
93+
</h1>
94+
</div>
95+
)}
8696
<div className="relative flex flex-grow basis-0 items-center justify-end gap-2 sm:gap-3 md:flex-grow">
8797
<Link
8898
href="https://github.com/gofr-dev/gofr"

src/images/logo1.svg

+16
Loading

src/images/logo2.svg

+10
Loading

src/images/logo3.svg

+10
Loading

src/images/logo4.svg

+18
Loading

0 commit comments

Comments
 (0)