mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## Problem Closes #31221. The applications and shared UI packages still import the former `framer-motion` package instead of Motion's React entry point. ## Solution Replace runtime imports, type imports, and three test mocks with `motion/react` across the consuming workspaces. Replace the seven direct dependency declarations with `motion: ^11.18.2`. Preserve the existing animation engine version and all other dependency resolutions, including the asynchronous `domMax` feature loader. Historical blog examples remain as published; `framer-motion` remains a transitive implementation dependency of Motion. ## Review instructions 1. Run `pnpm install --frozen-lockfile` and check the seven dependency replacements in the lockfile. 2. Open the WWW Auth page and Docs homepage at desktop and mobile widths, with normal and reduced motion preferences. 3. Open the mobile navigation, expand Product on WWW, and close the menu using Escape and the close button. 4. Check the existing animation components, shared form validation, and Studio tests for unchanged behavior. Validation: - Studio: 731 test files, 8,334 passing tests and one expected failure, with `--maxWorkers=4`. - Shared UI, UI patterns, WWW, and UI library: 615 passing tests. - `pnpm run typecheck --concurrency=1`: all 16 repository tasks pass. - All six application source lint scripts and lint ratchets pass; generated Docs example copies are excluded from local lint. - Repository Prettier source check, lockfile formatting, and case hazard check pass. - WWW: 10 existing end-to-end checks across nine pages. - Docs: 5 existing guide link and accessibility checks across Database and Auth. - WWW and Docs mobile navigation pass at desktop/mobile sizes with normal/reduced motion; SQL-to-REST translation tabs exercise the asynchronous feature loader without browser errors. - Frozen-lockfile installation passes; all existing package and snapshot resolutions are unchanged. - Learn and UI library command palettes open, filter results, and close with Escape without browser errors. - Independent code review finds no actionable defects. - `npm run build -- --filter=www --filter=docs --filter=studio --filter=learn --filter=library --concurrency=1 --continue=always`: all five affected applications build successfully (9 tasks including prerequisites); asset uploads disabled for local validation. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) (no docs topics changed) --------- Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
122 lines
3.5 KiB
TypeScript
122 lines
3.5 KiB
TypeScript
import SectionContainer from 'components/Layouts/SectionContainer'
|
|
import { DEFAULT_EASE } from 'lib/animations'
|
|
import { motion, useInView } from 'motion/react'
|
|
import Image from 'next/image'
|
|
import Link from 'next/link'
|
|
import React, { FC } from 'react'
|
|
import { Button, cn } from 'ui'
|
|
|
|
const MotionImage = motion(Image)
|
|
|
|
const LW15Hackathon: FC = () => {
|
|
return (
|
|
<SectionContainer
|
|
className="max-w-none! lg:container! lw-nav-anchor flex flex-col lg:grid lg:grid-cols-5 gap-4 lg:gap-2"
|
|
id="build-stage"
|
|
>
|
|
<LW15HackathonImage className="hidden lg:flex" />
|
|
<div className="w-full h-full flex flex-col justify-between gap-4 lg:col-span-3">
|
|
<div className="flex flex-col h-full gap-4">
|
|
<div className="flex flex-col text-6xl">
|
|
<div className="flex justify-between">
|
|
<span className="text-foreground-lighter">Hackathon</span>
|
|
</div>
|
|
<div>Starts this Friday.</div>
|
|
</div>
|
|
</div>
|
|
<LW15HackathonImage className="lg:hidden" />
|
|
<div className="flex flex-col justify-between items-start gap-4">
|
|
<div className="text-2xl max-w-[350px] text-foreground-lighter">
|
|
<p>
|
|
Build something amazing <br /> in 10 days using Supabase.
|
|
</p>
|
|
<p>Compete solo or in a team, submit a quick demo and win.</p>
|
|
</div>
|
|
<Button variant="secondary" size="medium" asChild>
|
|
<Link href="/blog/lw15-hackathon">Join Hackathon</Link>
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</SectionContainer>
|
|
)
|
|
}
|
|
|
|
const LW15HackathonImage = ({ className }: { className?: string }) => {
|
|
const ref = React.useRef(null)
|
|
const isInView = useInView(ref, { margin: '-25%', once: true })
|
|
|
|
const variants = {
|
|
initial: {},
|
|
reveal: {
|
|
transition: {
|
|
type: 'spring',
|
|
damping: 10,
|
|
mass: 0.75,
|
|
stiffness: 100,
|
|
staggerChildren: 0.15,
|
|
},
|
|
},
|
|
}
|
|
|
|
const imageVariants = {
|
|
initial: {
|
|
y: '100%',
|
|
},
|
|
reveal: {
|
|
y: 0,
|
|
transition: {
|
|
ease: DEFAULT_EASE,
|
|
duration: 0.5,
|
|
},
|
|
},
|
|
}
|
|
|
|
return (
|
|
<motion.div
|
|
ref={ref}
|
|
variants={variants}
|
|
animate={isInView ? 'reveal' : 'initial'}
|
|
className={cn(
|
|
'flex flex-col gap-4 h-full justify-between col-span-2 min-h-[500px]',
|
|
className
|
|
)}
|
|
>
|
|
<div className="relative grow overflow-hidden">
|
|
<MotionImage
|
|
variants={imageVariants}
|
|
src="/images/launchweek/15/lw15-galaxy-hackathon.png"
|
|
alt="Hackathon"
|
|
width={1000}
|
|
height={1000}
|
|
quality={100}
|
|
className="absolute w-full inset-0 h-full object-cover object-top"
|
|
/>
|
|
</div>
|
|
<div className="relative grow-2 overflow-hidden">
|
|
<MotionImage
|
|
variants={imageVariants}
|
|
src="/images/launchweek/15/lw15-galaxy-hackathon.png"
|
|
alt="Hackathon"
|
|
width={1000}
|
|
height={1000}
|
|
quality={100}
|
|
className="absolute w-full inset-0 h-full object-cover object-top"
|
|
/>
|
|
</div>
|
|
<div className="relative grow-3 overflow-hidden">
|
|
<MotionImage
|
|
variants={imageVariants}
|
|
src="/images/launchweek/15/lw15-galaxy-hackathon.png"
|
|
alt="Hackathon"
|
|
width={1000}
|
|
height={1000}
|
|
quality={100}
|
|
className="absolute w-full inset-0 h-full object-cover object-top"
|
|
/>
|
|
</div>
|
|
</motion.div>
|
|
)
|
|
}
|
|
|
|
export default LW15Hackathon
|