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
739cf62b
Commit
739cf62b
authored
Aug 04, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'optimize/select_option' into 'main'
Optimize/select option See merge request
!406
parents
ec810a55
daddaa2a
Pipeline
#28883
passed with stages
in 9 minutes and 5 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
31 deletions
+76
-31
src/ui/Duel/Message/NeosModal/index.module.scss
src/ui/Duel/Message/NeosModal/index.module.scss
+2
-2
src/ui/Duel/Message/OptionModal/index.module.scss
src/ui/Duel/Message/OptionModal/index.module.scss
+41
-0
src/ui/Duel/Message/OptionModal/index.tsx
src/ui/Duel/Message/OptionModal/index.tsx
+33
-29
No files found.
src/ui/Duel/Message/NeosModal/index.module.scss
View file @
739cf62b
...
...
@@ -7,7 +7,7 @@
top
:
-
webkit-fill-available
;
margin
:
auto
;
height
:
fit-content
;
transition
:
0
.
3
s
;
transition
:
0
.
2
s
;
}
.mini
{
...
...
@@ -15,7 +15,7 @@
bottom
:
0
!
important
;
transform
:
translateY
(
calc
(
50%
-
66px
));
.ant-modal-body
{
animation
:
fadeout
0
.
3
s
forwards
;
animation
:
fadeout
0
.
1
s
forwards
;
}
}
...
...
src/ui/Duel/Message/OptionModal/index.module.scss
0 → 100644
View file @
739cf62b
.container
{
:global
(
.ant-pro-checkcard-description
)
{
font-family
:
var
(
--
theme-font
);
font-size
:
0
.9rem
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
:global
(
.ant-pro-checkcard
)
{
background-color
:
#141414
2b
;
}
:global
(
.ant-pro-checkcard-checked
)
{
&
:
:
before
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
content
:
""
;
z-index
:
1
;
background-color
:
#0023bf
32
;
box-shadow
:
0
0
0
1px
#0087e6
inset
;
}
&
:
:
after
{
display
:
none
;
}
}
.check-card-group
{
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
1fr
);
gap
:
0
.625rem
;
}
.check-card
{
max-width
:
12
.5rem
;
margin-inline-end
:
0
;
margin-block-end
:
0
;
}
}
src/ui/Duel/Message/OptionModal/index.tsx
View file @
739cf62b
...
...
@@ -16,6 +16,7 @@ import { Container } from "@/container";
import
{
getUIContainer
}
from
"
@/container/compat
"
;
import
{
NeosModal
}
from
"
../NeosModal
"
;
import
styles
from
"
./index.module.scss
"
;
type
Options
=
{
info
:
string
;
response
:
number
}[];
...
...
@@ -53,6 +54,13 @@ export const OptionModal = () => {
setSelecteds
(
Array
.
from
({
length
:
maxPage
}).
map
((
_
)
=>
[]));
},
[
options
]);
const
onQuickSelect
=
(
response
:
number
)
=>
{
if
(
store
.
min
===
1
)
{
sendSelectOptionResponse
(
container
.
conn
,
response
);
rs
();
}
};
return
(
<
NeosModal
title=
{
title
}
...
...
@@ -67,35 +75,31 @@ export const OptionModal = () => {
{
grouped
.
map
(
(
options
,
i
)
=>
i
===
page
&&
(
<
div
className=
{
styles
.
container
}
key=
{
i
}
>
<
CheckCard
.
Group
key=
{
i
}
bordered
multiple
value=
{
selecteds
[
i
]
}
style=
{
{
display
:
"
grid
"
,
gridTemplateColumns
:
"
repeat(2, 1fr)
"
,
gap
:
"
0.625rem
"
,
}
}
className=
{
styles
[
"
check-card-group
"
]
}
onChange=
{
(
values
:
any
)
=>
{
const
v
=
selecteds
.
map
((
x
,
i
)
=>
(
i
===
page
?
values
:
x
));
setSelecteds
(
v
);
}
}
>
{
options
.
map
((
option
,
idx
)
=>
(
<
CheckCard
<
div
key=
{
idx
}
style=
{
{
width
:
"
12.5rem
"
,
fontSize
:
"
1rem
"
,
marginInlineEnd
:
0
,
marginBlockEnd
:
0
,
}
}
title=
{
option
.
info
}
onDoubleClick=
{
()
=>
onQuickSelect
(
option
.
response
)
}
>
<
CheckCard
className=
{
styles
[
"
check-card
"
]
}
description=
{
option
.
info
}
value=
{
option
.
response
}
/>
</
div
>
))
}
</
CheckCard
.
Group
>
</
div
>
),
)
}
</
NeosModal
>
...
...
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