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
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";
...
@@ -20,15 +20,15 @@ import "@/styles/core.scss";
import
"
@/styles/inject.scss
"
;
import
"
@/styles/inject.scss
"
;
import
{
ProConfigProvider
}
from
"
@ant-design/pro-provider
"
;
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
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/NeosRouter
"
;
import
{
theme
}
from
"
@/ui/theme
"
;
import
{
theme
}
from
"
@/ui/theme
"
;
import
{
NeosRouter
}
from
"
./ui/NeosRouter
"
;
const
root
=
ReactDOM
.
createRoot
(
const
root
=
ReactDOM
.
createRoot
(
document
.
getElementById
(
"
root
"
)
as
HTMLElement
document
.
getElementById
(
"
root
"
)
as
HTMLElement
);
);
...
...
src/ui/BuildDeck/Filter.tsx
View file @
5c3a29b6
...
@@ -3,10 +3,11 @@ import {
...
@@ -3,10 +3,11 @@ import {
Checkbox
,
Checkbox
,
Form
,
Form
,
Input
,
Input
,
InputNumber
,
Select
,
Select
,
type
SelectProps
,
type
SelectProps
,
InputNumber
,
}
from
"
antd
"
;
}
from
"
antd
"
;
import
styles
from
"
./Filter.module.scss
"
;
import
styles
from
"
./Filter.module.scss
"
;
const
options
:
SelectProps
[
"
options
"
]
=
[];
const
options
:
SelectProps
[
"
options
"
]
=
[];
...
@@ -102,7 +103,7 @@ export const Filter: React.FC = () => {
...
@@ -102,7 +103,7 @@ export const Filter: React.FC = () => {
</
div
>
</
div
>
<
div
className=
{
styles
.
btns
}
>
<
div
className=
{
styles
.
btns
}
>
<
Button
type=
"primary"
>
确定
</
Button
>
<
Button
type=
"primary"
>
确定
</
Button
>
<
Button
type=
"text"
>
取消
</
Button
>
<
Button
type=
"text"
>
取
消
</
Button
>
</
div
>
</
div
>
</>
</>
);
);
...
...
src/ui/BuildDeck/index.tsx
View file @
5c3a29b6
...
@@ -8,14 +8,14 @@ import {
...
@@ -8,14 +8,14 @@ import {
UndoOutlined
,
UndoOutlined
,
}
from
"
@ant-design/icons
"
;
}
from
"
@ant-design/icons
"
;
import
{
import
{
App
,
Badge
,
Badge
,
Button
,
Button
,
ConfigProvider
,
ConfigProvider
,
Input
,
Input
,
message
,
Space
,
Space
,
type
ThemeConfig
,
type
ThemeConfig
,
message
,
App
,
}
from
"
antd
"
;
}
from
"
antd
"
;
import
{
memo
,
useEffect
,
useRef
,
useState
}
from
"
react
"
;
import
{
memo
,
useEffect
,
useRef
,
useState
}
from
"
react
"
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
"
react-dnd
"
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
"
react-dnd
"
;
...
@@ -26,6 +26,7 @@ import { proxy, useSnapshot } from "valtio";
...
@@ -26,6 +26,7 @@ import { proxy, useSnapshot } from "valtio";
import
{
subscribeKey
}
from
"
valtio/utils
"
;
import
{
subscribeKey
}
from
"
valtio/utils
"
;
import
{
type
CardMeta
,
searchCards
}
from
"
@/api
"
;
import
{
type
CardMeta
,
searchCards
}
from
"
@/api
"
;
import
{
isExtraDeckCard
,
isToken
}
from
"
@/common
"
;
import
{
deckStore
,
type
IDeck
,
initStore
}
from
"
@/stores
"
;
import
{
deckStore
,
type
IDeck
,
initStore
}
from
"
@/stores
"
;
import
{
import
{
Background
,
Background
,
...
@@ -47,7 +48,6 @@ import {
...
@@ -47,7 +48,6 @@ import {
iDeckToEditingDeck
,
iDeckToEditingDeck
,
type
Type
,
type
Type
,
}
from
"
./utils
"
;
}
from
"
./utils
"
;
import
{
isToken
}
from
"
@/common
"
;
const
theme
:
ThemeConfig
=
{
const
theme
:
ThemeConfig
=
{
components
:
{
components
:
{
...
@@ -331,10 +331,19 @@ const DeckZone: React.FC<{
...
@@ -331,10 +331,19 @@ const DeckZone: React.FC<{
const
SearchResults
:
React
.
FC
<
{
const
SearchResults
:
React
.
FC
<
{
results
:
CardMeta
[];
results
:
CardMeta
[];
}
>
=
memo
(({
results
})
=>
{
}
>
=
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
(
return
(
<
div
className=
{
styles
[
"
search-cards
"
]
}
>
<
div
className=
{
styles
[
"
search-cards
"
]
}
>
{
results
.
map
((
item
)
=>
(
{
results
.
map
((
card
)
=>
(
<
Card
value=
{
item
}
key=
{
v4uuid
()
}
source=
"search"
/>
<
Card
value=
{
card
}
key=
{
v4uuid
()
}
source=
"search"
onClick=
{
()
=>
handleClick
(
card
)
}
/>
))
}
))
}
</
div
>
</
div
>
);
);
...
...
src/ui/Duel/Main.tsx
View file @
5c3a29b6
...
@@ -15,8 +15,7 @@ import {
...
@@ -15,8 +15,7 @@ import {
SortCardModal
,
SortCardModal
,
YesNoModal
,
YesNoModal
,
}
from
"
./Message
"
;
}
from
"
./Message
"
;
import
{
LifeBar
,
Mat
,
Menu
}
from
"
./PlayMat
"
;
import
{
LifeBar
,
Mat
,
Menu
,
Underlying
}
from
"
./PlayMat
"
;
import
{
Underlying
}
from
"
./PlayMat
"
;
export
const
Component
:
React
.
FC
=
()
=>
{
export
const
Component
:
React
.
FC
=
()
=>
{
return
(
return
(
...
...
src/ui/Duel/PlayMat/Underlying/index.tsx
View file @
5c3a29b6
import
{
useEffect
}
from
"
react
"
;
import
classNames
from
"
classnames
"
;
import
{
createRoot
}
from
"
react-dom/client
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
isMe
,
matStore
}
from
"
@/stores
"
;
import
{
withPortalToBody
}
from
"
@/ui/Shared
"
;
import
{
withPortalToBody
}
from
"
@/ui/Shared
"
;
import
styles
from
"
./index.module.scss
"
;
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
(()
=>
{
export
const
Underlying
:
React
.
FC
<
{}
>
=
withPortalToBody
(()
=>
{
const
{
currentPlayer
}
=
useSnapshot
(
matStore
);
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
=
{
export
const
theme
:
ThemeConfig
=
{
algorithm
:
antdTheme
.
darkAlgorithm
,
algorithm
:
antdTheme
.
darkAlgorithm
,
token
:
{
colorPrimary
:
"
#0085da
"
,
},
components
:
{
components
:
{
Message
:
{
Message
:
{
colorBgElevated
:
"
#3f4d60
"
,
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