@@ -79,13 +79,12 @@ export const LeaderKey = () => {
7979 function submit ( ) {
8080 if ( isLoading ) return ;
8181
82- if ( tempLeaderKey === leaderKey || ( ! isLeaderKeyEnable && ! leaderKey ) ) {
82+ const key = isLeaderKeyEnable ? tempLeaderKey : '' ;
83+ if ( key === leaderKey ) {
8384 closeModal ( ) ;
8485 return ;
8586 }
8687
87- const key = isLeaderKeyEnable ? tempLeaderKey : '' ;
88-
8988 setIsLoading ( true ) ;
9089
9190 api
@@ -111,7 +110,7 @@ export const LeaderKey = () => {
111110 < span > { t ( 'keyboard.leaderKey.title' ) } </ span >
112111 </ div >
113112
114- < Modal width = { 500 } keyboard = { false } footer = { null } open = { isModalOpen } onCancel = { closeModal } >
113+ < Modal width = { 510 } keyboard = { false } footer = { null } open = { isModalOpen } onCancel = { closeModal } >
115114 < div className = "my-3 flex flex-col space-y-3" >
116115 { /* title */ }
117116 < div className = "flex flex-col space-y-1" >
@@ -163,7 +162,8 @@ export const LeaderKey = () => {
163162
164163 { /* Keyboard recorder */ }
165164 { isLeaderKeyEnable && (
166- < div className = "mt-5 flex flex-col space-y-5 rounded-lg bg-neutral-800 px-5 py-10" >
165+ < div className = "flex flex-col space-y-5 rounded-lg bg-neutral-800 px-5 py-5" >
166+ < span className = "text-sm text-neutral-400" > { t ( 'keyboard.leaderKey.tip' ) } </ span >
167167 < Input
168168 value = { tempLeaderKey }
169169 className = "flex-1"
@@ -178,8 +178,10 @@ export const LeaderKey = () => {
178178 < div
179179 key = { key . value }
180180 className = { clsx (
181- 'flex w-28 cursor-pointer items-center justify-center space-x-1 rounded py-1 shadow-lg shadow-neutral-800 outline hover:shadow-xl' ,
182- key . value === tempLeaderKey ? 'outline-blue-500' : 'outline-neutral-700'
181+ 'flex w-28 cursor-pointer items-center justify-center space-x-1 rounded py-1 shadow-lg shadow-neutral-800 outline' ,
182+ key . value === tempLeaderKey
183+ ? 'text-neutral-300 outline-blue-500'
184+ : 'text-neutral-500 outline-neutral-700 hover:shadow-xl hover:outline-neutral-600'
183185 ) }
184186 onClick = { ( ) => setTempLeaderKey ( ( k ) => ( k === key . value ? '' : key . value ) ) }
185187 >
@@ -193,9 +195,8 @@ export const LeaderKey = () => {
193195
194196 < div className = "flex w-full justify-center pt-5" >
195197 < Button
196- className = "w-28 "
198+ className = "w-24 "
197199 type = "primary"
198- size = "large"
199200 loading = { isLoading }
200201 onClick = { submit }
201202 >
0 commit comments