File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// pages/team.tsx
22import { motion } from 'framer-motion' ;
33import { InferGetStaticPropsType } from 'next' ;
4- import { useState } from 'react' ;
4+ import { useEffect , useState } from 'react' ;
55
66import Seo from '@/components/seo/seo' ;
77import ProfileModal from '@/components/team/ProfileModal' ;
@@ -26,6 +26,19 @@ export default function TeamPage({
2626 setSelected ( p ) ;
2727 setOpen ( true ) ;
2828 } ;
29+
30+ useEffect ( ( ) => {
31+ const hash = window . location . hash . slice ( 1 ) ;
32+ if ( ! hash ) return ;
33+ const allProfiles : CardProfile [ ] = [
34+ ...TeamMembers ,
35+ ...currentInterns ,
36+ ...pastInterns ,
37+ ...( SUPPORT_JSON as CardProfile [ ] ) ,
38+ ] ;
39+ const matched = allProfiles . find ( ( p ) => p . id === hash ) ;
40+ if ( matched ) openProfile ( matched ) ;
41+ } , [ TeamMembers , currentInterns , pastInterns ] ) ;
2942 const closeProfile = ( ) => setOpen ( false ) ;
3043 const clearSelected = ( ) => setSelected ( null ) ;
3144
You can’t perform that action at this time.
0 commit comments