11import React from 'react' ;
22import Layout from '@theme/Layout' ;
3- import { useHistory , useLocation } from '@docusaurus/router' ;
3+ import { useHistory , useLocation } from '@docusaurus/router' ;
4+ import { useEffect } from 'react' ;
45import { Route } from 'react-router-dom' ;
56import { About } from '@site/src/components/about'
67import LargePortraitCard from '@site/src/components/about/LargePortraitCard' ;
@@ -11,9 +12,23 @@ export default function LargePortraitCardPage() {
1112 const location = useLocation ( ) ;
1213 const history = useHistory ( ) ;
1314
15+ useEffect ( ( ) => {
16+ if ( location . state ?. fromAbout ) {
17+ window . scrollTo ( { top : location . state . scrollY ?? 0 , behavior : 'auto' } ) ;
18+ }
19+ } , [ ] ) ;
20+
1421 function handleClose ( ) {
22+ const scrollY = location . state ?. scrollY ;
23+
1524 if ( location . state ?. fromAbout ) {
1625 history . push ( '/about' ) ;
26+
27+ setTimeout ( ( ) => {
28+ if ( scrollY !== undefined ) {
29+ window . scrollTo ( { top : scrollY , behavior : 'auto' } ) ;
30+ }
31+ } , 0 ) ;
1732 } else {
1833 history . goBack ( ) ;
1934 }
@@ -25,8 +40,11 @@ export default function LargePortraitCardPage() {
2540 path = "/about/:completeName"
2641 render = { ( { history, match } ) => {
2742 const { completeName } = match . params ;
43+ console . log ( 'name:' , completeName )
2844 const teamMembers = getTeamByPersonName ( completeName ) ;
29- const person = teamMembers . find ( person => person . completeName . replace ( / \s + / g, '' ) === completeName ) ;
45+ console . log ( 'members:' , teamMembers )
46+ const person = teamMembers . find ( ( person ) => person . completeName . replace ( / \s + / g, '' ) . normalize ( "NFD" ) . replace ( / [ \u0300 - \u036f ] / g, '' ) === completeName ) ;
47+ console . log ( 'Person:' , person )
3048 if ( ! person ) return null ;
3149
3250 return (
0 commit comments