@@ -4,27 +4,34 @@ import {
4
4
TbCalendar as IconCalendar ,
5
5
TbCheck as IconCheck ,
6
6
TbCopy as IconCopy ,
7
- TbGitBranch as IconGitBranch ,
8
- TbHash as IconHash ,
9
- TbRipple
7
+ TbGitBranch ,
8
+ TbHash
10
9
} from 'react-icons/tb'
11
10
import {
12
- Alert ,
13
11
Badge ,
14
12
Box ,
15
13
Button ,
14
+ Card ,
16
15
Code ,
16
+ Divider ,
17
+ Flex ,
17
18
Group ,
18
19
Modal ,
20
+ Paper ,
19
21
Stack ,
20
22
Text ,
23
+ ThemeIcon ,
21
24
Title ,
22
- Tooltip
25
+ Tooltip ,
26
+ useMantineTheme
23
27
} from '@mantine/core'
24
28
import { useClipboard } from '@mantine/hooks'
29
+ import dayjs from 'dayjs'
25
30
26
31
import { IBuildInfo } from '@shared/utils/get-build-info/interfaces/build-info.interface'
27
32
33
+ import { Logo } from '../logo'
34
+
28
35
interface BuildInfoModalProps {
29
36
buildInfo : IBuildInfo
30
37
isNewVersionAvailable : boolean
@@ -40,6 +47,7 @@ export function BuildInfoModal({
40
47
} : BuildInfoModalProps ) {
41
48
const buildDate = new Date ( buildInfo . buildTime ) . toLocaleString ( )
42
49
const clipboard = useClipboard ( { timeout : 1000 } )
50
+ const theme = useMantineTheme ( )
43
51
44
52
const copyBuildInfo = ( ) => {
45
53
clipboard . copy ( JSON . stringify ( buildInfo , null , 2 ) )
@@ -51,19 +59,22 @@ export function BuildInfoModal({
51
59
onClose = { onClose }
52
60
opened = { opened }
53
61
padding = "xl"
54
- size = "md "
62
+ radius = "lg "
55
63
title = {
56
64
< Group justify = "space-between" w = "100%" >
57
- < Title order = { 3 } > Build Info</ Title >
65
+ < Title c = { theme . primaryColor } fw = { 700 } order = { 3 } >
66
+ Build Info
67
+ </ Title >
58
68
< Tooltip label = { clipboard . copied ? 'Copied!' : 'Copy build info' } >
59
69
< Button
60
70
color = { clipboard . copied ? 'green' : 'gray' }
61
71
leftSection = {
62
72
clipboard . copied ? < IconCheck size = { 16 } /> : < IconCopy size = { 16 } />
63
73
}
64
74
onClick = { copyBuildInfo }
75
+ radius = "xl"
65
76
size = "compact-sm"
66
- variant = "subtle "
77
+ variant = "light "
67
78
>
68
79
Copy
69
80
</ Button >
@@ -72,89 +83,159 @@ export function BuildInfoModal({
72
83
}
73
84
withCloseButton
74
85
>
75
- < Stack gap = "md " >
86
+ < Stack gap = "xl " >
76
87
{ isNewVersionAvailable && (
77
- < Alert
78
- color = "teal"
79
- icon = { < TbRipple size = { 22 } /> }
80
- title = "Update available"
81
- variant = "outline"
88
+ < Paper
89
+ bg = "rgba(0, 180, 160, 0.05)"
90
+ p = "lg"
91
+ radius = "lg"
92
+ style = { { border : `1px solid ${ theme . colors . teal [ 3 ] } ` } }
93
+ withBorder
82
94
>
83
- < Text size = "sm" > A new version of Remnawave is available.</ Text >
84
- < Button
85
- color = "cyan"
86
- component = "a"
87
- href = { 'https://github.com/remnawave/panel/releases/latest' }
88
- mt = "xs"
89
- size = "xs"
90
- target = "_blank"
91
- variant = "outline"
92
- >
93
- Check out
94
- </ Button >
95
- </ Alert >
95
+ < Group align = "flex-start" gap = "md" >
96
+ < ThemeIcon color = "cyan" radius = "xl" size = { 48 } variant = "outline" >
97
+ < Logo size = { 24 } />
98
+ </ ThemeIcon >
99
+ < Stack gap = "xs" style = { { flex : 1 } } >
100
+ < Text c = "teal.5" fw = { 700 } size = "md" >
101
+ Update available
102
+ </ Text >
103
+ < Text c = "dimmed" size = "md" >
104
+ A new version is available.
105
+ </ Text >
106
+ < Button
107
+ color = "teal"
108
+ component = "a"
109
+ fullWidth = { false }
110
+ href = { 'https://github.com/remnawave/panel/releases/latest' }
111
+ leftSection = { < IconBrandGithub size = { 16 } /> }
112
+ mt = "sm"
113
+ radius = "md"
114
+ size = "sm"
115
+ style = { { alignSelf : 'flex-start' } }
116
+ target = "_blank"
117
+ variant = "light"
118
+ >
119
+ Check out
120
+ </ Button >
121
+ </ Stack >
122
+ </ Group >
123
+ </ Paper >
96
124
) }
97
125
98
- < Group align = "flex-start" >
99
- < IconCalendar size = { 20 } />
100
- < Box >
101
- < Text fw = { 500 } > Build Time</ Text >
102
- < Text c = "dimmed" size = "sm" >
103
- { buildDate }
104
- </ Text >
105
- </ Box >
106
- </ Group >
126
+ < Card padding = "lg" radius = "lg" shadow = "sm" withBorder >
127
+ < Stack gap = "lg" >
128
+ < Group align = "center" gap = "lg" >
129
+ < ThemeIcon
130
+ color = { theme . primaryColor }
131
+ radius = "xl"
132
+ size = { 48 }
133
+ style = { {
134
+ border : `1px solid ${ theme . colors [ theme . primaryColor ] [ 5 ] } `
135
+ } }
136
+ variant = "light"
137
+ >
138
+ < IconCalendar size = { 24 } />
139
+ </ ThemeIcon >
140
+ < Box style = { { flex : 1 } } >
141
+ < Text fw = { 700 } size = "md" >
142
+ Build Time
143
+ </ Text >
144
+ < Text c = "dimmed" mt = { 4 } size = "sm" >
145
+ { dayjs ( buildDate ) . format ( 'DD/MM/YYYY HH:mm:ss' ) }
146
+ </ Text >
147
+ </ Box >
148
+ </ Group >
107
149
108
- < Group align = "flex-start" >
109
- < IconGitBranch size = { 20 } />
110
- < Box >
111
- < Text fw = { 500 } > Branch</ Text >
112
- < Badge color = "blue" variant = "light" >
113
- { buildInfo . branch }
114
- </ Badge >
115
- { buildInfo . tag && (
116
- < Badge color = "green" ml = "xs" variant = "light" >
117
- { buildInfo . tag }
118
- </ Badge >
119
- ) }
120
- </ Box >
121
- </ Group >
150
+ < Divider variant = "dashed" />
122
151
123
- < Group align = "flex-start" >
124
- < IconHash size = { 20 } />
125
- < Box >
126
- < Text fw = { 500 } > Commit</ Text >
127
- < Code > { buildInfo . commit } </ Code >
128
- </ Box >
129
- </ Group >
152
+ < Group align = "center" gap = "lg" >
153
+ < ThemeIcon
154
+ color = { theme . primaryColor }
155
+ radius = "xl"
156
+ size = { 48 }
157
+ style = { {
158
+ border : `1px solid ${ theme . colors [ theme . primaryColor ] [ 5 ] } `
159
+ } }
160
+ variant = "light"
161
+ >
162
+ < TbGitBranch size = { 24 } />
163
+ </ ThemeIcon >
164
+ < Box style = { { flex : 1 } } >
165
+ < Text fw = { 700 } size = "md" >
166
+ Branch
167
+ </ Text >
168
+ < Flex gap = "xs" mt = { 6 } >
169
+ < Badge
170
+ color = "blue"
171
+ px = "md"
172
+ radius = "xl"
173
+ size = "lg"
174
+ variant = "light"
175
+ >
176
+ { buildInfo . branch }
177
+ </ Badge >
178
+ { buildInfo . tag && (
179
+ < Badge
180
+ color = "green"
181
+ px = "md"
182
+ radius = "xl"
183
+ size = "lg"
184
+ variant = "light"
185
+ >
186
+ { buildInfo . tag }
187
+ </ Badge >
188
+ ) }
189
+ </ Flex >
190
+ </ Box >
191
+ </ Group >
192
+
193
+ < Divider variant = "dashed" />
130
194
131
- < Group
132
- gap = "md"
133
- grow
134
- justify = "center"
135
- mt = "lg"
136
- preventGrowOverflow = { false }
137
- wrap = "wrap"
138
- >
195
+ < Group align = "center" gap = "lg" >
196
+ < ThemeIcon
197
+ color = { theme . primaryColor }
198
+ radius = "xl"
199
+ size = { 48 }
200
+ style = { {
201
+ border : `1px solid ${ theme . colors [ theme . primaryColor ] [ 5 ] } `
202
+ } }
203
+ variant = "light"
204
+ >
205
+ < TbHash size = { 24 } />
206
+ </ ThemeIcon >
207
+ < Box style = { { flex : 1 } } >
208
+ < Text fw = { 700 } size = "md" >
209
+ Commit
210
+ </ Text >
211
+ < Code fz = { 'sm' } > { buildInfo . commit } </ Code >
212
+ </ Box >
213
+ </ Group >
214
+ </ Stack >
215
+ </ Card >
216
+
217
+ < Group gap = "md" grow preventGrowOverflow = { false } wrap = "wrap" >
139
218
< Button
140
219
component = "a"
141
220
href = { buildInfo . commitUrl }
142
- leftSection = { < IconBrandGithub size = { 16 } /> }
143
- size = "sm"
221
+ leftSection = { < IconBrandGithub size = { 18 } /> }
222
+ radius = "md"
223
+ size = "md"
144
224
target = "_blank"
145
225
variant = "outline"
146
226
>
147
227
View on GitHub
148
228
</ Button >
149
229
150
230
< Button
151
- c = "cyan"
231
+ color = "cyan"
152
232
component = "a"
153
233
href = { 'https://t.me/remnawave' }
154
- leftSection = { < IconBrandTelegram size = { 16 } /> }
155
- size = "sm"
234
+ leftSection = { < IconBrandTelegram size = { 18 } /> }
235
+ radius = "md"
236
+ size = "md"
156
237
target = "_blank"
157
- variant = "outline "
238
+ variant = "light "
158
239
>
159
240
Ask Community
160
241
</ Button >
0 commit comments