@@ -33,18 +33,18 @@ interface InstanceEntryProps {
33
33
context : ClientFlagContext
34
34
disabled : boolean
35
35
onCreate ?: ( ) => void
36
- onProlong ?: ( ) => void
36
+ onExtend ?: ( ) => void
37
37
onDestroy ?: ( ) => void
38
38
}
39
39
40
40
dayjs . extend ( duration )
41
41
42
42
interface CountdownProps {
43
43
time : string
44
- prolongNotice : ( ) => void
44
+ extendNotice : ( ) => void
45
45
}
46
46
47
- const Countdown : FC < CountdownProps > = ( { time, prolongNotice } ) => {
47
+ const Countdown : FC < CountdownProps > = ( { time, extendNotice } ) => {
48
48
const [ now , setNow ] = useState ( dayjs ( ) )
49
49
const end = dayjs ( time )
50
50
const countdown = dayjs . duration ( end . diff ( now ) )
@@ -60,7 +60,7 @@ const Countdown: FC<CountdownProps> = ({ time, prolongNotice }) => {
60
60
if ( countdown . asSeconds ( ) <= 0 ) return
61
61
62
62
if ( countdown . asMinutes ( ) < 10 && ! haveNoticed ) {
63
- prolongNotice ( )
63
+ extendNotice ( )
64
64
setHaveNoticed ( true )
65
65
} else if ( countdown . asMinutes ( ) > 10 ) {
66
66
setHaveNoticed ( false )
@@ -83,39 +83,39 @@ export const InstanceEntry: FC<InstanceEntryProps> = (props) => {
83
83
const isPlatformProxy = instanceEntry . length === 36 && ! instanceEntry . includes ( ':' )
84
84
const copyEntry = isPlatformProxy ? getProxyUrl ( instanceEntry , test ) : instanceEntry
85
85
86
- const [ canProlong , setCanProlong ] = useState ( false )
86
+ const [ canExtend , setCanExtend ] = useState ( false )
87
87
88
88
const { t } = useTranslation ( )
89
89
90
- const prolongNotice = ( ) => {
91
- if ( canProlong ) return
90
+ const extendNotice = ( ) => {
91
+ if ( canExtend ) return
92
92
93
93
showNotification ( {
94
94
color : 'orange' ,
95
- title : t ( 'challenge.notification.instance.prolong .note.title' ) ,
96
- message : t ( 'challenge.notification.instance.prolong .note.message' ) ,
95
+ title : t ( 'challenge.notification.instance.extend .note.title' ) ,
96
+ message : t ( 'challenge.notification.instance.extend .note.message' ) ,
97
97
icon : < Icon path = { mdiExclamation } size = { 1 } /> ,
98
98
} )
99
99
100
- setCanProlong ( true )
100
+ setCanExtend ( true )
101
101
}
102
102
103
103
useEffect ( ( ) => {
104
104
setWithContainer ( ! ! context . instanceEntry )
105
105
const countdown = dayjs . duration ( dayjs ( context . closeTime ?? 0 ) . diff ( dayjs ( ) ) )
106
- setCanProlong ( countdown . asMinutes ( ) < 10 )
106
+ setCanExtend ( countdown . asMinutes ( ) < 10 )
107
107
} , [ context ] )
108
108
109
- const onProlong = ( ) => {
110
- if ( ! canProlong || ! props . onProlong ) return
109
+ const onExtend = ( ) => {
110
+ if ( ! canExtend || ! props . onExtend ) return
111
111
112
- props . onProlong ( )
113
- setCanProlong ( false )
112
+ props . onExtend ( )
113
+ setCanExtend ( false )
114
114
115
115
showNotification ( {
116
116
color : 'teal' ,
117
- title : t ( 'challenge.notification.instance.prolong .success.title' ) ,
118
- message : t ( 'challenge.notification.instance.prolong .success.message' ) ,
117
+ title : t ( 'challenge.notification.instance.extend .success.title' ) ,
118
+ message : t ( 'challenge.notification.instance.extend .success.message' ) ,
119
119
icon : < Icon path = { mdiCheck } size = { 1 } /> ,
120
120
} )
121
121
}
@@ -225,16 +225,16 @@ export const InstanceEntry: FC<InstanceEntryProps> = (props) => {
225
225
< Stack align = "left" spacing = { 0 } >
226
226
< Text size = "sm" fw = { 600 } >
227
227
{ t ( 'challenge.content.instance.actions.count_down' ) }
228
- < Countdown time = { context . closeTime ?? '0' } prolongNotice = { prolongNotice } />
228
+ < Countdown time = { context . closeTime ?? '0' } extendNotice = { extendNotice } />
229
229
</ Text >
230
230
< Text size = "xs" color = "dimmed" fw = { 600 } >
231
231
{ t ( 'challenge.content.instance.actions.note' ) }
232
232
</ Text >
233
233
</ Stack >
234
234
235
235
< Group position = "right" noWrap spacing = "xs" >
236
- < Button color = "orange" onClick = { onProlong } disabled = { ! canProlong } >
237
- { t ( 'challenge.button.instance.prolong ' ) }
236
+ < Button color = "orange" onClick = { onExtend } disabled = { ! canExtend } >
237
+ { t ( 'challenge.button.instance.extend ' ) }
238
238
</ Button >
239
239
< Button color = "red" onClick = { onDestroy } disabled = { disabled } >
240
240
{ t ( 'challenge.button.instance.destroy' ) }
0 commit comments