Skip to content

Commit

Permalink
moderate UI in contest site (#1721)
Browse files Browse the repository at this point in the history
* merge RegisterPage and JoinPage to
RegisterAndJoinPage

* change localStorage to sessionStorage in
Menusettings

* delete some unused code

* delete unused code

* moderate some changes and fix the bug of
searching team by invitedcode

* fix error in delete judgement

* change client... to navigate(0)

* delete unused code

* fix bugs in managepage(insert team and manage memb
er)

* moderate routes of join site

* change route of team page

* change route in manage page

* moderate register and join page

* moderate graphql and some ui changes

* moderate UI in contest site

* change menu name

---------

Co-authored-by: zou-y-t <[email protected]>
Co-authored-by: FranGuam <[email protected]>
  • Loading branch information
3 people authored Apr 7, 2024
1 parent 4ff80ed commit e4313ae
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 168 deletions.
16 changes: 15 additions & 1 deletion src/app/ContestSite/MenuPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ const MenuPage: React.FC<ContestProps> = (props) => {
sessionStorage.setItem("openKeys", JSON.stringify(openKeys));
}, [openKeys]);

//获取是否为某个队伍的成员
const { data: ismemberData } = graphql.useIsTeamMemberSuspenseQuery({
variables: {
user_uuid: props.user?.uuid!,
contest_id: Contest_id,
},
});

const isMember = ismemberData?.contest_team_member[0];

const introRef = useRef(null);
const playRef = useRef(null);
const joinRef = useRef(null);
Expand Down Expand Up @@ -176,10 +186,14 @@ const MenuPage: React.FC<ContestProps> = (props) => {
},
{
key: "team",
label: (
label: isMember ? (
<Link to={url.link("team")} ref={joinRef}>
我的队伍
</Link>
) : (
<Link to={url.link("team")} ref={joinRef}>
现在报名
</Link>
),
icon: <TeamOutlined />,
},
Expand Down
Loading

0 comments on commit e4313ae

Please sign in to comment.