File tree Expand file tree Collapse file tree 4 files changed +306
-265
lines changed
Expand file tree Collapse file tree 4 files changed +306
-265
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const MessageBox = () => {
2525 style = { {
2626 position : "absolute" ,
2727 top : height / 2 - 90 - 25 , // titlebar height is 25
28- left : width / 2 - 160 ,
28+ left : width / 2 - Number ( args . boxWidth ) / 2 ,
2929 width : args . boxWidth ,
3030 borderRadius : 4 ,
3131 backgroundColor : theme . listHeaderBackgroundColor ,
@@ -81,6 +81,7 @@ const MessageBox = () => {
8181 style = { {
8282 paddingHorizontal : 10 ,
8383 height : 30 ,
84+ width : args . buttonWidth ,
8485 marginTop : 5 ,
8586 backgroundColor : theme . primary ,
8687 borderRadius : 8 ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export interface MessageBoxArgs {
88 onPress : ( ) => void ;
99 } [ ] ;
1010 boxWidth ?: number ;
11+ buttonWidth ?: number ;
1112}
1213
1314interface MessageModalState {
@@ -18,6 +19,7 @@ interface MessageModalState {
1819}
1920
2021const MESSAGE_BOX_WIDTH = 320 ;
22+ const MESSAGE_BOX_BUTTON_WIDTH = 120 ;
2123
2224const useMessageBox = create < MessageModalState > ( ) ( ( set ) => ( {
2325 visible : false ,
@@ -32,6 +34,9 @@ const useMessageBox = create<MessageModalState>()((set) => ({
3234 args : {
3335 ...args ,
3436 boxWidth : args . boxWidth ? args . boxWidth : MESSAGE_BOX_WIDTH ,
37+ buttonWidth : args . buttonWidth
38+ ? args . buttonWidth
39+ : MESSAGE_BOX_BUTTON_WIDTH ,
3540 } ,
3641 } ) ) ,
3742 hideMessageBox : ( ) =>
Original file line number Diff line number Diff line change @@ -113,7 +113,8 @@ export const fetchUpdateInfo = async () => {
113113Your launcher build version: #${ version }
114114Current launcher vuild version: #${ updateInfo . version }
115115Click "Download" to open release page` ,
116- boxWidth : 500 ,
116+ boxWidth : 550 ,
117+ buttonWidth : 160 ,
117118 buttons : [
118119 {
119120 title : "Download" ,
You can’t perform that action at this time.
0 commit comments