Skip to content

Commit f6a2eb7

Browse files
committed
Merge branch 'frontend-convert-inlinemessage-to-functional'
2 parents ba9a721 + ee7ed11 commit f6a2eb7

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* Copyright 2018 Shift Devices AG
3+
* Copyright 2024 Shift Crypto AG
34
*
45
* Licensed under the Apache License, Version 2.0 (the "License");
56
* you may not use this file except in compliance with the License.
@@ -14,25 +15,30 @@
1415
* limitations under the License.
1516
*/
1617

17-
import { Component } from 'react';
1818
import style from './InlineMessage.module.css';
1919

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();
2336
};
2437

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+
};

frontends/web/src/routes/settings/components/advanced-settings/enable-tor-proxy-setting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { useTranslation } from 'react-i18next';
1919
import { SettingsItem } from '../settingsItem/settingsItem';
2020
import { ChevronRightDark } from '../../../../components/icon';
2121
import { TorProxyDialog } from './tor-proxy-dialog';
22-
import InlineMessage from '../../../../components/inlineMessage/InlineMessage';
22+
import { InlineMessage } from '../../../../components/inlineMessage/inlineMessage';
2323
import { TProxyConfig } from '../../advanced-settings';
2424
import styles from './enable-tor-proxy-setting.module.css';
2525

0 commit comments

Comments
 (0)