From e2c6b9ef8f0d6e36146735891c585d0f5c7720a8 Mon Sep 17 00:00:00 2001 From: kyoonart <1564328778@qq.com> Date: Wed, 15 Jun 2022 15:23:59 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20graduate=20min-?= =?UTF-8?q?height=20and=20bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/graduate/index.less | 2 +- src/pages/graduate/index.tsx | 2 +- src/pages/group/index.tsx | 2 +- src/pages/member-style/index.less | 1 + src/pages/member-style/index.tsx | 4 ++-- src/pages/member/index.tsx | 10 ++++++++-- src/pages/year/index.tsx | 2 +- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/pages/graduate/index.less b/src/pages/graduate/index.less index 3c3a674..94b1f63 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: 500px; 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..1a464f9 100644 --- a/src/pages/member-style/index.less +++ b/src/pages/member-style/index.less @@ -31,6 +31,7 @@ } } .group-member { + min-height: 500px; 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..a406d63 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') { + 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) { From 28e37a38dfa4484a4d2e39c860d191c36190732f Mon Sep 17 00:00:00 2001 From: kyoonart <1564328778@qq.com> Date: Wed, 15 Jun 2022 15:23:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20graduate=20min-?= =?UTF-8?q?height=20and=20bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/graduate/index.less | 2 +- src/pages/graduate/index.tsx | 2 +- src/pages/group/index.tsx | 2 +- src/pages/member-style/index.less | 1 + src/pages/member-style/index.tsx | 4 ++-- src/pages/member/index.tsx | 10 ++++++++-- src/pages/year/index.tsx | 2 +- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/pages/graduate/index.less b/src/pages/graduate/index.less index 3c3a674..94b1f63 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: 500px; 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..1a464f9 100644 --- a/src/pages/member-style/index.less +++ b/src/pages/member-style/index.less @@ -31,6 +31,7 @@ } } .group-member { + min-height: 500px; 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..a406d63 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') { + 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) { From 125eeab1cc08f7007eb03bbea8ac5dd8ceb8f5c9 Mon Sep 17 00:00:00 2001 From: kyoonart <1564328778@qq.com> Date: Wed, 15 Jun 2022 15:43:00 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20min-height?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/graduate/index.less | 2 +- src/pages/member-style/index.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/graduate/index.less b/src/pages/graduate/index.less index 94b1f63..13ed477 100644 --- a/src/pages/graduate/index.less +++ b/src/pages/graduate/index.less @@ -19,7 +19,7 @@ .graduateMessage { width: 100%; - min-height: 500px; + min-height: 700px; display: grid; grid-template-columns: repeat(auto-fill, 100%); justify-content: center; diff --git a/src/pages/member-style/index.less b/src/pages/member-style/index.less index 1a464f9..c2bf5d2 100644 --- a/src/pages/member-style/index.less +++ b/src/pages/member-style/index.less @@ -31,7 +31,7 @@ } } .group-member { - min-height: 500px; + min-height: 700px; display: flex; flex-wrap: wrap; justify-content: center; From bfe4607ffb1327fc42801142d5b05523a7a80179 Mon Sep 17 00:00:00 2001 From: kyoonart <1564328778@qq.com> Date: Wed, 15 Jun 2022 15:51:04 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=F0=9F=90=9B=20state=20bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/member/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/member/index.tsx b/src/pages/member/index.tsx index a406d63..59e5601 100644 --- a/src/pages/member/index.tsx +++ b/src/pages/member/index.tsx @@ -8,7 +8,7 @@ const Member: React.FC = () => { const { path, url } = useRouteMatch() const [state, setState] = React.useState(() => { const pathname = window.location.pathname - if (pathname === '/member/graduate') { + if (pathname === '/member/graduate' || pathname === '/member') { return 0 } else { return 1