Skip to content

Commit f67eff5

Browse files
committed
feat(repo): part work
1 parent 0369f2d commit f67eff5

24 files changed

+2485
-879
lines changed

vite-project/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<link rel="icon" type="image/svg+xml" href="/gitdata.ai.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>GitData | Cloud</title>
8+
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
89
</head>
910
<body>
1011
<div id="root"></div>

vite-project/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "tsc -b && vite build",
8+
"build": "tsc -b && vite build --mode production",
99
"lint": "eslint .",
1010
"preview": "vite preview"
1111
},
@@ -22,6 +22,7 @@
2222
"@heroui/user": "^2.2.7",
2323
"@pheralb/toast": "^0.2.3",
2424
"axios": "^1.7.9",
25+
"boxicons": "^2.1.4",
2526
"dayjs": "^1.11.13",
2627
"framer-motion": "^12.4.3",
2728
"react": "^19.0.0",
@@ -47,6 +48,7 @@
4748
"globals": "^15.14.0",
4849
"luxon": "^3.5.0",
4950
"postcss": "^8.5.2",
51+
"rollup-plugin-visualizer": "^5.14.0",
5052
"tailwindcss": "3.4.17",
5153
"typescript": "~5.7.2",
5254
"typescript-eslint": "^8.22.0",

vite-project/pnpm-lock.yaml

+1,950-828
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vite-project/src/App.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@ import {Route, Routes} from "react-router-dom";
22
import RootLayout from "@/app/Layout.tsx";
33
import LayoutUser from "@/app/user/layout.tsx";
44
import RepoLayout from "@/app/repo/layout.tsx";
5+
import ExploreLayout from "@/app/explore/layout.tsx";
6+
import MarketLayout from "@/app/market/layout.tsx";
7+
import CommunityLayout from "@/app/community/layout.tsx";
58

69
function App() {
710
return (
811
<Routes>
912
<Route path={"/"} element={<RootLayout/>}>
13+
<Route path={"explore"} element={<ExploreLayout/>}/>
14+
<Route path={"market"} element={<MarketLayout/>}/>
15+
<Route path={"community"} element={<CommunityLayout/>}/>
1016
<Route path={":username"} element={<LayoutUser/>}>
1117
</Route>
1218
<Route path={":owner/:repo"} element={<RepoLayout/>}>
1319
</Route>
14-
1520
</Route>
1621
</Routes>
1722
)

vite-project/src/app/Layout.Header.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,9 @@ export const Header = () => {
6969
):(
7070
<>
7171
<div className="header-menu">
72-
<span >首页</span>
73-
<span >仓库</span>
74-
<span >组织</span>
75-
<span >社区</span>
76-
<span >竞赛</span>
72+
<span onClick={()=>{nav("/explore")}}>explore</span>
73+
<span onClick={()=>{nav("/market")}}>marketplace</span>
74+
<span onClick={()=>{nav("/community")}}>community</span>
7775
</div>
7876
<div className={"header-right"}>
7977
<Input
@@ -159,7 +157,9 @@ export const Header = () => {
159157

160158
</DropdownSection>
161159
<DropdownSection showDivider >
162-
<DropdownItem key="setting">Setting</DropdownItem>
160+
<DropdownItem key="setting" onPress={()=>{
161+
nav(user.dash?.user.username+"?tab=setting")
162+
}} >Setting</DropdownItem>
163163
<DropdownItem key="help">Help & Feedback</DropdownItem>
164164
<DropdownItem key="sync" onPress={()=>{
165165
if (user.dash?.user.username) {

vite-project/src/app/Layout.Model.Repository.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,10 @@ const LayoutModelRepository = (props: LayoutModelRepositoryProps) => {
114114
{
115115
Access.map((item) => {
116116
return (
117-
<SelectItem style={{
118-
display: "flex"
119-
}} key={item.owner_uid} value={item.owner_uid} itemID={item.owner_uid}>
117+
<SelectItem style={{ display: "flex" }} key={item.owner_uid} itemID={item.owner_uid}>
120118
{item.name}
121119
</SelectItem>
120+
122121
);
123122
})
124123
}

vite-project/src/app/auth/Login.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ const Login = (props: LoginProps) => {
118118
className="login-captcha-half"
119119
onClick={GetCaptcha}
120120
src={Captcha.image}
121+
height={35}
121122
alt="captcha"
122123
/>
123124
</div>

vite-project/src/app/auth/layout.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@
152152

153153
.login-captcha-half {
154154
width: 40%;
155-
height: 35px;
156155
margin-bottom: 1rem;
157156
border: 1px solid #ccc;
158157
box-sizing: border-box;
159158
cursor: pointer;
159+
object-fit: cover;
160160
}
161161

162162
.login-label {
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
import "./module.css"
3+
4+
5+
const CommunityLayout = () => {
6+
return(
7+
<>
8+
Community
9+
</>
10+
)
11+
}
12+
13+
export default CommunityLayout

vite-project/src/app/community/module.css

Whitespace-only changes.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
import "./module.css"
3+
4+
5+
const ExploreLayout = () => {
6+
return(
7+
<>
8+
Explore
9+
</>
10+
)
11+
}
12+
13+
export default ExploreLayout

vite-project/src/app/explore/module.css

Whitespace-only changes.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
import "./module.css"
3+
4+
5+
const MarketLayout = () => {
6+
return(
7+
<>
8+
Market
9+
</>
10+
)
11+
}
12+
13+
export default MarketLayout

vite-project/src/app/market/module.css

Whitespace-only changes.

vite-project/src/app/repo/Repo.Fork.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const RepoFork = (props: RepoForkProps) => {
9393
return (
9494
<SelectItem style={{
9595
display: "flex"
96-
}} key={item.owner_uid} value={item.owner_uid} itemID={item.owner_uid}>
96+
}} key={item.owner_uid} itemID={item.owner_uid}>
9797
{item.name}
9898
</SelectItem>
9999
);

vite-project/src/app/repo/Repo.Header.tsx

+105-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,40 @@
11
import {Tab, Tabs} from "@heroui/tabs";
22
import {useSearchParams} from "react-router-dom";
3-
import {useEffect, useState} from "react";
3+
import {useEffect, useRef, useState} from "react";
44
import {Repository} from "@/types.ts";
55
import {Badge} from "@heroui/react";
6+
import {
7+
BugIcon,
8+
ChatIcon, FileIcon,
9+
IconWrapper,
10+
LayoutIcon,
11+
PlayCircleIcon,
12+
PullRequestIcon,
13+
SettingIcon, WikiIcon
14+
} from "@/app/repo/Repo.Icons.tsx";
615

716
export const RepoHeader = (props: { setTab: (arg0: string) => void, info: Repository, owner: string, repo: string }) => {
817
const [Query , setQuery] = useSearchParams();
918
const [ Tabes, setTab ] = useState("file");
19+
const State = useRef(false);
1020
useEffect(()=>{
21+
if (State.current) return;
1122
if (!Query.get("tab")){
1223
Query.set("tab","file")
1324
setQuery(Query)
1425
setTab("file")
1526
props.setTab("file")
27+
State.current = true
1628
} else {
1729
setTab(Query.get("tab") as string)
1830
props.setTab(Query.get("tab") as string)
31+
State.current = true
1932
}
20-
},[Query, props, setQuery])
33+
},[props])
34+
useEffect(()=>{
35+
setTab(Query.get("tab") as string)
36+
props.setTab(Query.get("tab") as string)
37+
},[Query, State, props, setQuery])
2138
return (
2239
<div className="repo-header">
2340
<div className="repo-header-tab">
@@ -27,28 +44,101 @@ export const RepoHeader = (props: { setTab: (arg0: string) => void, info: Reposi
2744
setQuery(Query)
2845
props.setTab(x.toString())
2946
}} selectedKey={Tabes}>
30-
<Tab key="file" title="File"/>
31-
<Tab key="wiki" title="wiki"/>
47+
<Tab key="file" title={
48+
<div style={{
49+
display: "flex"
50+
}}>
51+
<IconWrapper className="bg-cyan-100 text-success">
52+
<FileIcon className="text-lg " />
53+
</IconWrapper>
54+
<span style={{
55+
padding: "3px"
56+
}}>Files</span>
57+
</div>
58+
}/>
59+
<Tab key="wiki" title={
60+
<div style={{
61+
display: "flex"
62+
}}>
63+
<IconWrapper className="bg-white text-foreground">
64+
<WikiIcon className="text-lg " />
65+
</IconWrapper>
66+
<span style={{
67+
padding: "3px"
68+
}}>Wiki</span>
69+
</div>
70+
}/>
3271
<Tab key="issues" title={
3372
<Badge color="primary" placement={"top-right"} content={props.info.nums_issue} size="sm">
34-
<span style={{
35-
padding: "3px"
36-
}}>issues</span>
73+
74+
<IconWrapper className="bg-success/10 text-success">
75+
<BugIcon className="text-lg " />
76+
</IconWrapper>
77+
<span style={{
78+
padding: "3px"
79+
}}>Issues</span>
3780
</Badge>
3881
}/>
3982

4083
<Tab key="pr" title={
4184
<Badge color="primary" placement={"top-right"} content={props.info.nums_pullrequest} size="sm">
42-
<span style={{
43-
padding: "3px"
44-
}}>pull request</span>
85+
86+
<IconWrapper className="bg-primary/10 text-primary">
87+
<PullRequestIcon className="text-lg " />
88+
</IconWrapper>
89+
<span style={{
90+
padding: "3px"
91+
}}>Pull Request</span>
4592
</Badge>
4693
}/>
47-
<Tab key="discission" title="discission"/>
48-
<Tab key="action" title="action"/>
49-
<Tab key="project" title="project"/>
50-
<Tab key="insights" title="insights"/>
51-
<Tab key="setting" title="setting"/>
94+
<Tab key="discission" title={
95+
<div style={{
96+
display: "flex"
97+
}}>
98+
<IconWrapper className="bg-secondary/10 text-secondary">
99+
<ChatIcon className="text-lg " />
100+
</IconWrapper>
101+
<span style={{
102+
padding: "3px"
103+
}}>Discission</span>
104+
</div>
105+
}/>
106+
<Tab key="action" title={
107+
<div style={{
108+
display: "flex"
109+
}}>
110+
<IconWrapper className="bg-warning/10 text-warning">
111+
<PlayCircleIcon className="text-lg " />
112+
</IconWrapper>
113+
<span style={{
114+
padding: "3px"
115+
}}>Actions</span>
116+
</div>
117+
}/>
118+
<Tab key="project" title={
119+
<div style={{
120+
display: "flex"
121+
}}>
122+
<IconWrapper className="bg-default/50 text-foreground">
123+
<LayoutIcon className="text-lg " />
124+
</IconWrapper>
125+
<span style={{
126+
padding: "3px"
127+
}}>Project</span>
128+
</div>
129+
}/>
130+
<Tab key="setting" title={
131+
<div style={{
132+
display: "flex"
133+
}}>
134+
<IconWrapper className="bg-amber-400 text-foreground">
135+
<SettingIcon className="text-lg text-amber-800"/>
136+
</IconWrapper>
137+
<span style={{
138+
padding: "3px"
139+
}}>Setting</span>
140+
</div>
141+
}/>
52142
</Tabs>
53143

54144
</div>

0 commit comments

Comments
 (0)