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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
love_飞影
Neos
Commits
5c3a29b6
Commit
5c3a29b6
authored
Aug 10, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize: build card
parent
a00d11f1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
18 deletions
+29
-18
src/main.tsx
src/main.tsx
+3
-3
src/ui/BuildDeck/Filter.tsx
src/ui/BuildDeck/Filter.tsx
+3
-2
src/ui/BuildDeck/index.tsx
src/ui/BuildDeck/index.tsx
+14
-5
src/ui/Duel/Main.tsx
src/ui/Duel/Main.tsx
+1
-2
src/ui/Duel/PlayMat/Underlying/index.tsx
src/ui/Duel/PlayMat/Underlying/index.tsx
+4
-5
src/ui/theme.ts
src/ui/theme.ts
+4
-1
No files found.
src/main.tsx
View file @
5c3a29b6
...
...
@@ -20,15 +20,15 @@ import "@/styles/core.scss";
import
"
@/styles/inject.scss
"
;
import
{
ProConfigProvider
}
from
"
@ant-design/pro-provider
"
;
import
{
ConfigProvider
,
App
}
from
"
antd
"
;
import
{
App
,
ConfigProvider
}
from
"
antd
"
;
import
zhCN
from
"
antd/locale/zh_CN
"
;
import
React
from
"
react
"
;
import
ReactDOM
from
"
react-dom/client
"
;
import
{
NeosRouter
}
from
"
./ui/NeosRouter
"
;
import
{
theme
}
from
"
@/ui/theme
"
;
import
{
NeosRouter
}
from
"
./ui/NeosRouter
"
;
const
root
=
ReactDOM
.
createRoot
(
document
.
getElementById
(
"
root
"
)
as
HTMLElement
);
...
...
src/ui/BuildDeck/Filter.tsx
View file @
5c3a29b6
...
...
@@ -3,10 +3,11 @@ import {
Checkbox
,
Form
,
Input
,
InputNumber
,
Select
,
type
SelectProps
,
InputNumber
,
}
from
"
antd
"
;
import
styles
from
"
./Filter.module.scss
"
;
const
options
:
SelectProps
[
"
options
"
]
=
[];
...
...
@@ -102,7 +103,7 @@ export const Filter: React.FC = () => {
</
div
>
<
div
className=
{
styles
.
btns
}
>
<
Button
type=
"primary"
>
确定
</
Button
>
<
Button
type=
"text"
>
取消
</
Button
>
<
Button
type=
"text"
>
取
消
</
Button
>
</
div
>
</>
);
...
...
src/ui/BuildDeck/index.tsx
View file @
5c3a29b6
...
...
@@ -8,14 +8,14 @@ import {
UndoOutlined
,
}
from
"
@ant-design/icons
"
;
import
{
App
,
Badge
,
Button
,
ConfigProvider
,
Input
,
message
,
Space
,
type
ThemeConfig
,
message
,
App
,
}
from
"
antd
"
;
import
{
memo
,
useEffect
,
useRef
,
useState
}
from
"
react
"
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
"
react-dnd
"
;
...
...
@@ -26,6 +26,7 @@ import { proxy, useSnapshot } from "valtio";
import
{
subscribeKey
}
from
"
valtio/utils
"
;
import
{
type
CardMeta
,
searchCards
}
from
"
@/api
"
;
import
{
isExtraDeckCard
,
isToken
}
from
"
@/common
"
;
import
{
deckStore
,
type
IDeck
,
initStore
}
from
"
@/stores
"
;
import
{
Background
,
...
...
@@ -47,7 +48,6 @@ import {
iDeckToEditingDeck
,
type
Type
,
}
from
"
./utils
"
;
import
{
isToken
}
from
"
@/common
"
;
const
theme
:
ThemeConfig
=
{
components
:
{
...
...
@@ -331,10 +331,19 @@ const DeckZone: React.FC<{
const
SearchResults
:
React
.
FC
<
{
results
:
CardMeta
[];
}
>
=
memo
(({
results
})
=>
{
const
handleClick
=
(
card
:
CardMeta
)
=>
{
const
type
=
isExtraDeckCard
(
card
.
data
.
type
??
0
)
?
"
extra
"
:
"
main
"
;
canAdd
(
card
,
type
,
editDeckStore
).
result
&&
editDeckStore
.
add
(
type
,
card
);
};
return
(
<
div
className=
{
styles
[
"
search-cards
"
]
}
>
{
results
.
map
((
item
)
=>
(
<
Card
value=
{
item
}
key=
{
v4uuid
()
}
source=
"search"
/>
{
results
.
map
((
card
)
=>
(
<
Card
value=
{
card
}
key=
{
v4uuid
()
}
source=
"search"
onClick=
{
()
=>
handleClick
(
card
)
}
/>
))
}
</
div
>
);
...
...
src/ui/Duel/Main.tsx
View file @
5c3a29b6
...
...
@@ -15,8 +15,7 @@ import {
SortCardModal
,
YesNoModal
,
}
from
"
./Message
"
;
import
{
LifeBar
,
Mat
,
Menu
}
from
"
./PlayMat
"
;
import
{
Underlying
}
from
"
./PlayMat
"
;
import
{
LifeBar
,
Mat
,
Menu
,
Underlying
}
from
"
./PlayMat
"
;
export
const
Component
:
React
.
FC
=
()
=>
{
return
(
...
...
src/ui/Duel/PlayMat/Underlying/index.tsx
View file @
5c3a29b6
import
{
useEffect
}
from
"
react
"
;
import
{
createRoot
}
from
"
react-dom/client
"
;
import
classNames
from
"
classnames
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
isMe
,
matStore
}
from
"
@/stores
"
;
import
{
withPortalToBody
}
from
"
@/ui/Shared
"
;
import
styles
from
"
./index.module.scss
"
;
import
classNames
from
"
classnames
"
;
import
{
matStore
,
isMe
}
from
"
@/stores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
export
const
Underlying
:
React
.
FC
<
{}
>
=
withPortalToBody
(()
=>
{
const
{
currentPlayer
}
=
useSnapshot
(
matStore
);
...
...
src/ui/theme.ts
View file @
5c3a29b6
import
{
t
ype
ThemeConfig
,
theme
as
antdTheme
}
from
"
antd
"
;
import
{
t
heme
as
antdTheme
,
type
ThemeConfig
}
from
"
antd
"
;
export
const
theme
:
ThemeConfig
=
{
algorithm
:
antdTheme
.
darkAlgorithm
,
token
:
{
colorPrimary
:
"
#0085da
"
,
},
components
:
{
Message
:
{
colorBgElevated
:
"
#3f4d60
"
,
...
...
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