Skip to content

Commit 7b3d7cb

Browse files
committed
feat: optional
1 parent e28a5af commit 7b3d7cb

File tree

14 files changed

+121
-29
lines changed

14 files changed

+121
-29
lines changed
32.6 KB
Loading
5.45 KB
Binary file not shown.

src/app/(auth)/layout.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import '@mantine/core/styles.css';
44
import "@/style/main.css"
55

66
import React from "react";
7-
import {FaArrowLeft} from "react-icons/fa";
87
import {useRouter} from "next/navigation";
8+
import {IoMdClose} from "react-icons/io";
99

1010

1111
export default function RootLayout(props: { children: React.ReactNode }) {
1212
const nav = useRouter().replace;
1313
return (
1414
<div className="auth">
1515
<div className="back" onClick={() => nav("/")}>
16-
<FaArrowLeft/>
16+
<IoMdClose/>
1717
<span>返回主页</span>
1818
</div>
1919
<div className="auth-body">

src/app/(default)/r/[owner]/[repo]/fork/layout.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
'use client'
22

3-
import {FaArrowLeft} from "react-icons/fa";
3+
44
import React from "react";
5+
import {IoMdClose} from "react-icons/io";
56

67
export default function ForkRepoLayout(props: { children: React.ReactNode }) {
78
return (
89
<div>
910
<div className="back" onClick={() => window.history.back()}>
10-
<FaArrowLeft/>
11+
<IoMdClose/>
1112
<span>返回</span>
1213
</div>
1314
{props.children}

src/app/(default)/r/create/layout.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use client'
22

3-
import {FaArrowLeft} from "react-icons/fa";
43
import React from "react";
4+
import { IoMdClose } from "react-icons/io";
55

66
export default function CreateRepoLayout(props: { children: React.ReactNode }) {
77
return (
88
<div>
99
<div className="back" onClick={() => window.history.back()}>
10-
<FaArrowLeft/>
10+
<IoMdClose/>
1111
<span>返回</span>
1212
</div>
1313
{props.children}

src/app/(default)/u/setting/profile/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export default function SettingProfile() {
148148
color: "green",
149149
});
150150
setTimeout(()=>{
151-
// window.location.reload()
151+
window.location.reload()
152152
}, 1000)
153153
}
154154
xhr.onerror = function () {

src/component/dashbored/dashbored.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ export const Dashbored = ({user}: DashboredProps) => {
3333
<MenuItem style={{
3434
color: 'black',
3535
backgroundColor: "white",
36+
fontSize: "14px",
37+
fontWeight: "400",
38+
padding: "2px 0",
3639
}} className="item" key={index} onClick={() => {
3740
nav("/r/" + user.user.name + "/" + item.name)
3841
}}>

src/component/layout/header.status.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const HeaderStatus = () => {
7070
</div>
7171
</UnstyledButton>
7272
</MenuTarget>
73-
<MenuDropdown>
73+
<MenuDropdown className="header-status-menus">
7474
{
7575
Item.map((item, index) => {
7676
return (

src/component/layout/usermenu.tsx

+58-16
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,74 @@ export const Usermenu = (props: UsermenuProps) => {
3131
email={props.user.email}
3232
/>
3333
</MenuTarget>
34-
<MenuDropdown>
34+
<MenuDropdown className="user-menu-drop">
3535
<MenuItem leftSection={<AiOutlineProfile size={14}/>} onClick={() => {
3636
routes.replace("/u/" + props.user.username + "?tab=actively")
37-
}}> Profile</MenuItem>
38-
<MenuItem leftSection={<AiOutlineTeam size={14}/>}>Team</MenuItem>
39-
<MenuItem leftSection={<HiMiniUserGroup size={14}/>}>Group</MenuItem>
37+
}}>
38+
<span>Profile</span>
39+
</MenuItem>
40+
<MenuItem leftSection={<AiOutlineTeam size={14}/>}>
41+
<span>Team</span>
42+
</MenuItem>
43+
<MenuItem leftSection={<HiMiniUserGroup size={14}/>}>
44+
<span>Group</span>
45+
</MenuItem>
4046
<MenuDivider/>
41-
<MenuItem leftSection={<RiGitRepositoryLine size={14}/>}>Repository</MenuItem>
42-
<MenuItem leftSection={<VscGithubProject size={14}/>}>Project</MenuItem>
43-
<MenuItem leftSection={<MdProductionQuantityLimits size={14}/>}>Product</MenuItem>
47+
<MenuItem leftSection={<RiGitRepositoryLine size={14}/>} onClick={() => {
48+
routes.replace("/u/" + props.user.username + "?tab=repository")
49+
}}>
50+
<span>Repository</span>
51+
</MenuItem>
52+
<MenuItem leftSection={<VscGithubProject size={14}/>} onClick={() => {
53+
routes.replace("/u/" + props.user.username + "?tab=project")
54+
}}>
55+
<span>Project</span>
56+
</MenuItem>
57+
<MenuItem leftSection={<MdProductionQuantityLimits size={14}/>} onClick={() => {
58+
routes.replace("/u/" + props.user.username + "?tab=product")
59+
}}>
60+
<span>Product</span>
61+
</MenuItem>
4462
<MenuDivider/>
45-
<MenuItem leftSection={<MdStar size={14}/>}>Star</MenuItem>
46-
<MenuItem leftSection={<GiShadowFollower size={14}/>}>Follow</MenuItem>
47-
<MenuItem leftSection={<FaThemeco size={14}/>}>Pro</MenuItem>
48-
<MenuItem leftSection={<FaMoneyCheck size={14}/>}>Finance</MenuItem>
49-
<MenuItem leftSection={<RiBillLine size={14}/>}>Bill</MenuItem>
63+
<MenuItem leftSection={<MdStar size={14}/>} onClick={() => {
64+
routes.replace("/u/" + props.user.username + "?tab=star")
65+
}}>
66+
<span>Star</span>
67+
</MenuItem>
68+
<MenuItem leftSection={<GiShadowFollower size={14}/>} onClick={() => {
69+
routes.replace("/u/" + props.user.username + "?tab=follow")
70+
}}>
71+
<span>Follow</span>
72+
</MenuItem>
73+
<MenuItem leftSection={<FaThemeco size={14}/>}>
74+
<span>Pro</span>
75+
</MenuItem>
76+
<MenuItem leftSection={<FaMoneyCheck size={14}/>}>
77+
<span>Finance</span>
78+
</MenuItem>
79+
<MenuItem leftSection={<RiBillLine size={14}/>}>
80+
<span>Bill</span>
81+
</MenuItem>
5082
<MenuDivider/>
51-
<MenuItem leftSection={<CiSettings size={14}/>}>Setting</MenuItem>
83+
<MenuItem leftSection={<CiSettings size={14}/>} onClick={() => {
84+
routes.replace("/u/setting/profile")
85+
}}>
86+
<span>Setting</span>
87+
</MenuItem>
5288
<MenuItem leftSection={<CiLogout size={14}/>} onClick={()=>{
5389
user.logout();
5490
window.location.reload();
5591
}}>Logout</MenuItem>
5692
<MenuDivider/>
57-
<MenuItem leftSection={<SlDocs size={14}/>}>GitDataAI Docs</MenuItem>
58-
<MenuItem leftSection={<TfiHelpAlt size={14}/>}>GitDataAI Help</MenuItem>
59-
<MenuItem leftSection={<MdOutlineContactSupport size={14}/>}>GitDataAI Contact</MenuItem>
93+
<MenuItem leftSection={<SlDocs size={14}/>}>
94+
<span>GitDataAI Docs</span>
95+
</MenuItem>
96+
<MenuItem leftSection={<TfiHelpAlt size={14}/>}>
97+
<span>GitDataAI Help</span>
98+
</MenuItem>
99+
<MenuItem leftSection={<MdOutlineContactSupport size={14}/>}>
100+
<span>GitDataAI Contact</span>
101+
</MenuItem>
60102
</MenuDropdown>
61103
</Menu>
62104
</div>

src/component/repo/repoheader.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const Repoheader = ({repo, owner, info}: RepoheaderProps) => {
3636
<div className="repo-header-info-title-top">
3737
<Avatar src={repo.avatar || ""} radius="xl"/>
3838
<h1>{repo.name}</h1>
39-
<b>{repo.visibility ? "Public" : "Private"}</b>
39+
<b>{!repo.visibility ? "Public" : "Private"}</b>
4040
</div>
4141
{
4242
(info.fork && info.fork?.owner && info.fork.model) && (

src/component/user/userbody.tsx

+18-3
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,28 @@ export const UserBody = ({body}: UserBodyProps) => {
2121
</div>
2222
<div style={{
2323
display: "flex",
24-
gap: "2rem"
24+
justifyContent: "center",
25+
alignItems: "center",
26+
flexDirection: "row",
2527
}}>
26-
<div className="user-body-tabs">
28+
<div className="user-body-tabs" style={{
29+
display: "flex",
30+
justifyContent: "center",
31+
alignItems: "center",
32+
flexDirection: "row",
33+
gap: 5,
34+
}}>
2735
<a>Following</a>
2836
<span>{body.following.length}</span>
2937
</div>
30-
<div className="user-body-tabs">
38+
<div className="user-body-tabs"
39+
style={{
40+
display: "flex",
41+
alignItems: "center",
42+
flexDirection: "row",
43+
gap: 5,
44+
}}
45+
>
3146
<a>Followers</a>
3247
<span>{body.followers.length}</span>
3348
</div>

src/style/auth.css

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
.back {
5858
position: fixed;
5959
top: 5rem;
60+
right: 0;
6061
width: 10rem;
6162
padding: 0.5rem 1rem;
6263
border-radius: 5px;

src/style/layout.css

+26-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
display: flex;
44
align-items: center;
55
justify-content: space-between;
6-
76
.header-left {
87
height: 60px;
98
display: flex;
@@ -43,6 +42,12 @@
4342
justify-content: center;
4443
gap: 0.5rem;
4544
height: 60px;
45+
span {
46+
font-size: 14px;
47+
font-weight: 400;
48+
color: #495057;
49+
cursor: pointer;
50+
}
4651
}
4752
.header-status-arrow {
4853
transition: all 0.4s ease-in-out;
@@ -79,6 +84,26 @@
7984
}
8085
}
8186

87+
.header-status-menus {
88+
span {
89+
font-size: 14px;
90+
font-weight: 400;
91+
color: #495057;
92+
cursor: pointer;
93+
}
94+
}
95+
.user-menu-drop {
96+
span {
97+
font-size: 14px;
98+
font-weight: 400;
99+
}
100+
.mantine-Menu-item {
101+
margin: 0;
102+
padding: 0.2rem 1rem;
103+
color: #495057;
104+
}
105+
}
106+
82107
.welcome {
83108
padding: 0 16px;
84109

src/style/user.css

+5
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@
5858
width: 100%;
5959
a {
6060
width: 5rem;
61+
font-size: 14px;
6162
font-weight: 600;
6263
}
64+
span {
65+
font-size: 14px;
66+
font-weight: 400;
67+
}
6368
}
6469
.user-body-indicator {
6570
background-color: var(--mantine-color-white);

0 commit comments

Comments
 (0)