Skip to content

Commit

Permalink
2024年度の更新届を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
csenet committed Apr 9, 2024
1 parent 7301f43 commit 7768f1d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const Header: FC<{}> = () => {
{jwtData && jwt && (
<NavDropdown title={jwtData.uid} align="end">
<NavDropdown.Item href="/user">ユーザー設定</NavDropdown.Item>
<NavDropdown.Item href="/update">更新届提出</NavDropdown.Item>
{jwtData.groups.includes("manager") && (
<NavDropdown.Item href="/admin">
ユーザー管理
Expand Down
31 changes: 31 additions & 0 deletions client/src/pages/update.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { FC, useEffect, useState } from "react";
import { Container } from "react-bootstrap";
import jwt_decode from "jwt-decode";

const UpdatePage: FC<{}> = () => {
const [jwt, setJwt] = useState<string | null>(null);
const [jwtData, setJwtData] = useState<any>("");

useEffect(() => {
if (!jwt) return;
const decoded: any = jwt_decode(jwt);
setJwtData(decoded);
}, [jwt]);

useEffect(() => {
const token = localStorage.getItem("token");
if (!token) return;
setJwt(token);
}, []);

return (
<>
<Container>
<h1>更新届提出</h1>
<p>2024年度の更新届は以下のリンクから提出してください</p>
<a href={"https://docs.google.com/forms/d/e/1FAIpQLSftFmyVdufKYXa0VoDBmjlN5-dlMy5__yLKVMe5fgCHJ4ErWg/viewform?usp=pp_url&entry.800787902="+ jwtData.uid }>2024年度入部/更新届</a>
</Container>
</>
);
};
export default UpdatePage;

0 comments on commit 7768f1d

Please sign in to comment.