File tree Expand file tree Collapse file tree 2 files changed +25
-19
lines changed
routes/settings/components/advanced-settings Expand file tree Collapse file tree 2 files changed +25
-19
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* Copyright 2018 Shift Devices AG
3
+ * Copyright 2024 Shift Crypto AG
3
4
*
4
5
* Licensed under the Apache License, Version 2.0 (the "License");
5
6
* you may not use this file except in compliance with the License.
14
15
* limitations under the License.
15
16
*/
16
17
17
- import { Component } from 'react' ;
18
18
import style from './InlineMessage.module.css' ;
19
19
20
- export default class InlineMessage extends Component {
21
- deactivate = ( ) => {
22
- this . props . onEnd ( ) ;
20
+ type TProps = {
21
+ type : string ;
22
+ message : string ;
23
+ align : string ;
24
+ onEnd : ( ) => void ;
25
+ }
26
+
27
+ export const InlineMessage = ( {
28
+ type,
29
+ message,
30
+ align,
31
+ onEnd
32
+ } : TProps ) => {
33
+
34
+ const handleDeactivate = ( ) => {
35
+ onEnd ( ) ;
23
36
} ;
24
37
25
- render ( ) {
26
- const {
27
- type,
28
- message,
29
- align,
30
- } = this . props ;
31
- return (
32
- < div className = { [ style . inlineMessage , style [ type ] , align ? style [ align ] : '' ] . join ( ' ' ) } >
33
- { message }
34
- < div className = { style . close } onClick = { this . deactivate } > ✕</ div >
35
- </ div >
36
- ) ;
37
- }
38
- }
38
+ return (
39
+ < div className = { [ style . inlineMessage , style [ type ] , align ? style [ align ] : '' ] . join ( ' ' ) } >
40
+ { message }
41
+ < div className = { style . close } onClick = { handleDeactivate } > ✕</ div >
42
+ </ div >
43
+ ) ;
44
+ } ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import { useTranslation } from 'react-i18next';
19
19
import { SettingsItem } from '../settingsItem/settingsItem' ;
20
20
import { ChevronRightDark } from '../../../../components/icon' ;
21
21
import { TorProxyDialog } from './tor-proxy-dialog' ;
22
- import InlineMessage from '../../../../components/inlineMessage/InlineMessage ' ;
22
+ import { InlineMessage } from '../../../../components/inlineMessage/inlineMessage ' ;
23
23
import { TProxyConfig } from '../../advanced-settings' ;
24
24
import styles from './enable-tor-proxy-setting.module.css' ;
25
25
You can’t perform that action at this time.
0 commit comments