diff --git a/src/pages/graduate/index.less b/src/pages/graduate/index.less index 3c3a674..13ed477 100644 --- a/src/pages/graduate/index.less +++ b/src/pages/graduate/index.less @@ -11,7 +11,6 @@ font-family: Arial, Helvetica, sans-serif; cursor: pointer; } - } .graduate { width: 80%; @@ -20,6 +19,7 @@ .graduateMessage { width: 100%; + min-height: 700px; display: grid; grid-template-columns: repeat(auto-fill, 100%); justify-content: center; diff --git a/src/pages/graduate/index.tsx b/src/pages/graduate/index.tsx index 8539a9c..0543924 100644 --- a/src/pages/graduate/index.tsx +++ b/src/pages/graduate/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { getGraduateMemberInfo } from '@/api/member' -import Year from '../year/index' +import Year from '../year' import './index.less' // 成员 diff --git a/src/pages/group/index.tsx b/src/pages/group/index.tsx index b6e4419..0be1607 100644 --- a/src/pages/group/index.tsx +++ b/src/pages/group/index.tsx @@ -15,7 +15,7 @@ type GroupProps = { const Group: React.FC = (props) => { const { teamName } = props const [list, setList] = React.useState([]) - const [parent] = useAutoAnimate(/* optional config */) as any + const [parent] = useAutoAnimate() as any React.useEffect(() => { getMemberInfo({ size: 100, team: teamName }).then((res) => { if (res) { diff --git a/src/pages/member-style/index.less b/src/pages/member-style/index.less index 89d4c73..c2bf5d2 100644 --- a/src/pages/member-style/index.less +++ b/src/pages/member-style/index.less @@ -31,6 +31,7 @@ } } .group-member { + min-height: 700px; display: flex; flex-wrap: wrap; justify-content: center; diff --git a/src/pages/member-style/index.tsx b/src/pages/member-style/index.tsx index 57fc547..e4a0203 100644 --- a/src/pages/member-style/index.tsx +++ b/src/pages/member-style/index.tsx @@ -1,13 +1,13 @@ import * as React from 'react' import { TeamNameEnum } from '@/common/inteface' -import Group from '../group/index' +import Group from '../group' import { useAutoAnimate } from '@formkit/auto-animate/react' import './index.less' const Member: React.FC = () => { const [state, setState] = React.useState(0) const [group, setGroup] = React.useState(TeamNameEnum.Android) - const [parent] = useAutoAnimate(/* optional config */) as any + const [parent] = useAutoAnimate() as any const groupList: { id: TeamNameEnum; index: number }[] = [ { id: TeamNameEnum.Android, index: 0 }, { id: TeamNameEnum.iOS, index: 1 }, diff --git a/src/pages/member/index.tsx b/src/pages/member/index.tsx index 3e82006..59e5601 100644 --- a/src/pages/member/index.tsx +++ b/src/pages/member/index.tsx @@ -6,8 +6,14 @@ import './index.less' const Member: React.FC = () => { const { path, url } = useRouteMatch() - const [state, setState] = React.useState(0) - + const [state, setState] = React.useState(() => { + const pathname = window.location.pathname + if (pathname === '/member/graduate' || pathname === '/member') { + return 0 + } else { + return 1 + } + }) return (
diff --git a/src/pages/year/index.tsx b/src/pages/year/index.tsx index e24dac0..3b842df 100644 --- a/src/pages/year/index.tsx +++ b/src/pages/year/index.tsx @@ -10,7 +10,7 @@ import randomArr from '@/common/utils/random-array' const Year: React.FC<{ clicked: number }> = (props) => { const { clicked } = props const [list, setList] = React.useState([]) - const [parent] = useAutoAnimate(/* optional config */) as any + const [parent] = useAutoAnimate() as any React.useEffect(() => { getGraduateMemberInfo({ size: 100, year: `${clicked}` }).then((res) => { if (res) {