Skip to content

Commit ac80074

Browse files
author
Ema
committed
merge: resolve conflicts and integrate rocket transition into main
2 parents 5c7c6fa + 07d5e8a commit ac80074

9 files changed

Lines changed: 436 additions & 16 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828

2929
- run: npm ci
3030
- run: npm run build
31+
env:
32+
VITE_GEMINI_API_KEY: ${{ secrets.VITE_GEMINI_API_KEY }}
3133

3234
- uses: actions/configure-pages@v5
3335

package-lock.json

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"framer-motion": "^12.38.0",
1314
"lucide-react": "^1.8.0",
1415
"react": "^19.2.4",
1516
"react-dom": "^19.2.4",

src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Preferences from './pages/Preferences';
44
import Home from './pages/home/Home';
55
import Explore from './pages/Explore';
66
import Chat from './pages/Chat';
7+
import { RocketTransition } from './components/RocketTransition';
78

89
function App() {
910
const location = useLocation();
@@ -29,6 +30,8 @@ function App() {
2930
<Route path="/chat/:id" element={<Chat />} />
3031
</Routes>
3132
</main>
33+
34+
<RocketTransition />
3235
</div>
3336
);
3437
}

src/components/MatchOverlay.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import { useEffect } from 'react';
22
import type { AlienProfile } from '../data/mockAliens';
3-
import { useNavigate } from 'react-router';
43
import { Heart } from 'lucide-react';
4+
import { useRocketNav } from '../context/TransitionContext';
55

66
interface MatchOverlayProps {
77
alien: AlienProfile;
88
userName: string;
99
}
1010

1111
export default function MatchOverlay({ alien, userName }: MatchOverlayProps) {
12-
const navigate = useNavigate();
12+
const triggerRocketNav = useRocketNav();
1313

1414
useEffect(() => {
15-
// Automatically redirect to chat after 3 seconds
15+
// Trigger rocket navigation after 2 seconds (giving time to see the match)
1616
const timer = setTimeout(() => {
17-
navigate(`/chat/${alien.id}`);
18-
}, 3000);
17+
triggerRocketNav(`/chat/${alien.id}`);
18+
}, 2000);
1919
return () => clearTimeout(timer);
20-
}, [navigate, alien.id]);
20+
}, [triggerRocketNav, alien.id]);
2121

2222
return (
2323
<div style={{

src/components/OrbitSystem.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { mockAliens } from '../data/mockAliens';
33
import type { AlienProfile } from '../data/mockAliens';
44
import { useAppContext } from '../context/AppContext';
55
import ProfileModal from './ProfileModal';
6-
import MatchOverlay from './MatchOverlay';
76
import { getCompatibility } from '../utils/compatibility';
7+
import { useRocketNav } from '../context/TransitionContext';
88

99
export default function OrbitSystem() {
1010
const { preferences, addMatch, matches } = useAppContext();
11+
const triggerRocketNav = useRocketNav();
1112
const [selectedAlien, setSelectedAlien] = useState<AlienProfile | null>(null);
12-
const [matchedAlien, setMatchedAlien] = useState<AlienProfile | null>(null);
1313
const [dismissedIds, setDismissedIds] = useState<Set<string>>(new Set());
1414

1515
// Keep exactly 5 slots for the 5 orbit tracks
@@ -60,7 +60,7 @@ export default function OrbitSystem() {
6060
const handleMatch = (alien: AlienProfile) => {
6161
addMatch(alien);
6262
setSelectedAlien(null);
63-
setMatchedAlien(alien);
63+
triggerRocketNav(`/chat/${alien.id}`, { alienImg: alien.profilePic });
6464
};
6565

6666
const handleDismiss = (alien: AlienProfile) => {
@@ -213,12 +213,6 @@ export default function OrbitSystem() {
213213
/>
214214
)}
215215

216-
{matchedAlien && (
217-
<MatchOverlay
218-
alien={matchedAlien}
219-
userName={preferences.name || 'User'}
220-
/>
221-
)}
222216
</>
223217
);
224218
}

0 commit comments

Comments
 (0)