Files
supabase/apps/www/components/Sections/GithubExamples.tsx
Danny White 3960e6ac41 chore(deps): bump lucide-react to v1 (#51770)
## Problem

Lucide React v1 improves screen reader behaviour (icons are hidden from
assistive tech by default). It also removes brand icons such as GitHub.
We were still on Lucide 0.x across the monorepo.

## Solution

- Move every workspace onto one shared Lucide React v1 version via the
pnpm catalog.
- But Lucide React v1 [deprecated brand
icons](https://github.com/lucide-icons/lucide/blob/main/BRAND_LOGOS_STATEMENT.md)
- Meaning we need to handle any _old_ brand icons we used from Lucide
0.x.
- Luckily, that was just `GitHubIcon`. So...
- Add a `GithubIcon` in `packages/ui` that matches Lucide’s previous
GitHub icon, and use it wherever we imported GitHub from Lucide.
  - No other Lucide brand icons were in use.
- Studio “Continue with GitHub” sign-in still uses the existing SVG
asset (`github-icon.svg`), not this component.
- Keep the `Icon` suffix import style [recently
introduced](https://github.com/supabase/supabase/pull/51659)
- Monorepo apps now use `catalog` Lucide React v1.

## Review instructions

1. Open [Studio
preview](https://studio-staging-git-dnywh-bump-lucide-react-v1-supabase.vercel.app/dashboard/org)
on a project that is connected to GitHub:
   - Project home → Activity stats “GitHub” row
   - Org project list → GitHub badge on a connected project card/row
- Branches → GitHub link on a branch row, or “Sync with a GitHub branch”
   - Project Settings → Integrations → GitHub integration panel
2. Open
[/kb/guides/sample-guide](https://supabase.com/kb/guides/sample-guide) →
confirm “Go to the GitHub discussion” shows the icon.
3. Open
[/docs/reference/javascript](https://supabase.com/docs/reference/javascript)
→ confirm the header GitHub control still shows the icon. Or
[/docs/guides/troubleshooting/rls-simplified-BJTcS8](https://supabase.com/docs/guides/troubleshooting/rls-simplified-BJTcS8)
→ “View discussion on GitHub”.
2026-10-15 23:00:55 +00:00

107 lines
3.4 KiB
TypeScript

import Examples from '~/data/Examples'
import { ArrowLeft, ArrowRight, BookOpen } from 'lucide-react'
import Link from 'next/link'
import { useRef } from 'react'
// import Swiper core and required modules
import SwiperCore from 'swiper'
import { Navigation, Pagination } from 'swiper/modules'
import { Swiper, SwiperSlide } from 'swiper/react'
import { Button, GithubIcon } from 'ui'
import ExampleCard from '../ExampleCard'
// install Swiper modules
SwiperCore.use([Navigation, Pagination])
function GithubExamples() {
const prevRef = useRef(null)
const nextRef = useRef(null)
return (
<>
<div className="grid grid-cols-12">
<div className="col-span-12 text-center">
<h2 className="h3">Community driven examples, libraries and guides</h2>
<p className="p ">
Supported by a network of early advocates, contributors, and champions.
</p>
<div className="flex items-center justify-center gap-2 py-4">
<Button asChild size="small" icon={<BookOpen size={12} />}>
<a href="/docs/guides/resources/examples">View guides</a>
</Button>
<Button asChild size="small" icon={<GithubIcon size={12} />}>
<Link
href="https://github.com/supabase/supabase/tree/master/examples"
as="https://github.com/supabase/supabase/tree/master/examples"
>
Official GitHub library
</Link>
</Button>
</div>
</div>
</div>
<div className="mt-4">
<div className={'lg:-mr-32 lg:-ml-32'}>
<Swiper
style={{ overflow: 'visible' }}
loop={true}
initialSlide={3}
spaceBetween={0}
slidesPerView={4}
autoplay={{
delay: 2400,
}}
speed={300}
navigation={{
prevEl: prevRef.current,
nextEl: nextRef.current,
// prevEl: prevRef.current ? prevRef.current : undefined,
// nextEl: nextRef.current ? nextRef.current : undefined,
}}
onInit={(swiper: any) => {
swiper.params.navigation.prevEl = prevRef.current
swiper.params.navigation.nextEl = nextRef.current
swiper.navigation.update()
}}
breakpoints={{
320: {
slidesPerView: 1,
},
720: {
slidesPerView: 2,
},
920: {
slidesPerView: 3,
},
1024: {
slidesPerView: 4,
},
}}
>
{Object.values(Examples).map((example: any, i: number) => {
return (
<SwiperSlide key={i}>
<div className="my-8 mr-3 ml-3">
<ExampleCard i={i} {...example} />
</div>
</SwiperSlide>
)
})}
<div className="container mx-auto mt-3 hidden flex-row justify-between md:flex">
<div ref={prevRef} className="p ml-4 cursor-pointer">
<ArrowLeft />
</div>
<div ref={nextRef} className="p mr-4 cursor-pointer">
<ArrowRight />
</div>
</div>
</Swiper>
</div>
</div>
</>
)
}
export default GithubExamples