Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
9f71e0c3
Commit
9f71e0c3
authored
Aug 03, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: small
parent
440f5d39
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
6 deletions
+31
-6
src/main.tsx
src/main.tsx
+1
-1
src/ui/Layout/index.module.scss
src/ui/Layout/index.module.scss
+14
-2
src/ui/Layout/index.tsx
src/ui/Layout/index.tsx
+13
-2
src/ui/NeosRouter.tsx
src/ui/NeosRouter.tsx
+1
-1
src/ui/NewProfile/index.tsx
src/ui/NewProfile/index.tsx
+2
-0
No files found.
src/main.tsx
View file @
9f71e0c3
...
@@ -20,7 +20,7 @@ import zhCN from "antd/locale/zh_CN";
...
@@ -20,7 +20,7 @@ import zhCN from "antd/locale/zh_CN";
import
React
from
"
react
"
;
import
React
from
"
react
"
;
import
ReactDOM
from
"
react-dom/client
"
;
import
ReactDOM
from
"
react-dom/client
"
;
import
{
NeosRouter
}
from
"
./ui/Neos
"
;
import
{
NeosRouter
}
from
"
./ui/Neos
Router
"
;
const
root
=
ReactDOM
.
createRoot
(
const
root
=
ReactDOM
.
createRoot
(
document
.
getElementById
(
"
root
"
)
as
HTMLElement
document
.
getElementById
(
"
root
"
)
as
HTMLElement
...
...
src/ui/Layout/index.module.scss
View file @
9f71e0c3
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
height
:
var
(
--
height
);
height
:
var
(
--
height
);
display
:
flex
;
display
:
flex
;
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
align-
content
:
center
;
align-
items
:
center
;
padding
:
0
2rem
;
padding
:
0
2rem
;
gap
:
1
.5rem
;
gap
:
1
.5rem
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
...
@@ -19,6 +19,18 @@
...
@@ -19,6 +19,18 @@
text-decoration
:
none
;
text-decoration
:
none
;
font-size
:
0
.825rem
;
font-size
:
0
.825rem
;
line-height
:
var
(
--
height
);
line-height
:
var
(
--
height
);
// height: fit-content;
transition
:
0
.3s
;
&
:hover
{
opacity
:
0
.8
;
}
&
:global
(
.active
)
{
box-shadow
:
0px
-2px
0
0
white
inset
;
}
}
}
}
}
.profile
{
display
:
flex
;
align-items
:
center
;
gap
:
12px
;
}
src/ui/Layout/index.tsx
View file @
9f71e0c3
...
@@ -4,10 +4,12 @@ import { NavLink, Outlet, type LoaderFunction } from "react-router-dom";
...
@@ -4,10 +4,12 @@ import { NavLink, Outlet, type LoaderFunction } from "react-router-dom";
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
accountStore
,
type
User
}
from
"
@/stores
"
;
import
{
accountStore
,
type
User
}
from
"
@/stores
"
;
const
NeosConfig
=
useConfig
();
import
styles
from
"
./index.module.scss
"
;
import
styles
from
"
./index.module.scss
"
;
import
{
getCookie
,
CookieKeys
}
from
"
@/ui/Shared
"
;
import
{
getCookie
,
CookieKeys
}
from
"
@/ui/Shared
"
;
import
{
Avatar
}
from
"
antd
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
const
NeosConfig
=
useConfig
();
export
const
loader
:
LoaderFunction
=
()
=>
{
export
const
loader
:
LoaderFunction
=
()
=>
{
const
user
=
getCookie
<
User
>
(
CookieKeys
.
USER
);
const
user
=
getCookie
<
User
>
(
CookieKeys
.
USER
);
if
(
user
)
accountStore
.
login
(
user
);
if
(
user
)
accountStore
.
login
(
user
);
...
@@ -15,6 +17,7 @@ export const loader: LoaderFunction = () => {
...
@@ -15,6 +17,7 @@ export const loader: LoaderFunction = () => {
};
};
export
const
Component
=
()
=>
{
export
const
Component
=
()
=>
{
// TODO 根据是否登录,显示内容
return
(
return
(
<>
<>
<
nav
className=
{
styles
.
navbar
}
>
<
nav
className=
{
styles
.
navbar
}
>
...
@@ -28,9 +31,17 @@ export const Component = () => {
...
@@ -28,9 +31,17 @@ export const Component = () => {
<
NavLink
to=
"/match"
>
匹配
</
NavLink
>
<
NavLink
to=
"/match"
>
匹配
</
NavLink
>
<
NavLink
to=
"/build"
>
组卡
</
NavLink
>
<
NavLink
to=
"/build"
>
组卡
</
NavLink
>
<
span
style=
{
{
flexGrow
:
1
}
}
/>
<
span
style=
{
{
flexGrow
:
1
}
}
/>
<
NavLink
to=
"/profile"
>
个人中心
</
NavLink
>
<
span
className=
{
styles
.
profile
}
>
<
NeosAvatar
/>
<
NavLink
to=
"/profile"
>
个人中心
</
NavLink
>
</
span
>
</
nav
>
</
nav
>
<
Outlet
/>
<
Outlet
/>
</>
</>
);
);
};
};
const
NeosAvatar
=
()
=>
{
const
{
user
}
=
useSnapshot
(
accountStore
);
return
<
Avatar
size=
"small"
src=
{
user
?.
avatar_url
}
/>;
};
src/ui/Neos.tsx
→
src/ui/Neos
Router
.tsx
View file @
9f71e0c3
...
@@ -36,7 +36,7 @@ const _router = createBrowserRouter([
...
@@ -36,7 +36,7 @@ const _router = createBrowserRouter([
},
},
{
{
path
:
"
/profile
"
,
path
:
"
/profile
"
,
lazy
:
()
=>
import
(
"
./Profile
"
),
lazy
:
()
=>
import
(
"
./
New
Profile
"
),
},
},
{
{
path
:
"
/waitroom/:ip/:player/:passWd
"
,
path
:
"
/waitroom/:ip/:player/:passWd
"
,
...
...
src/ui/NewProfile/index.tsx
0 → 100644
View file @
9f71e0c3
export
const
Component
=
()
=>
<>
profile
</>;
Component
.
displayName
=
"
Build
"
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment