diff --git a/src/about/AboutDialog.tsx b/src/about/AboutDialog.tsx index 29427054..0d9eeceb 100644 --- a/src/about/AboutDialog.tsx +++ b/src/about/AboutDialog.tsx @@ -5,9 +5,8 @@ import { AnchorButton, Button, Classes, Dialog } from '@blueprintjs/core'; import { firmwareVersion } from '@pybricks/firmware'; -import { WithI18nProps, withI18n } from '@shopify/react-i18n'; -import React from 'react'; -import { connect } from 'react-redux'; +import { useI18n } from '@shopify/react-i18n'; +import React, { useState } from 'react'; import { appName, appVersion, @@ -23,61 +22,52 @@ import en from './i18n.en.json'; import './about.scss'; -type OwnProps = { isOpen: boolean; onClose: () => void }; +type AboutDialogProps = { isOpen: boolean; onClose: () => void }; -type AboutDialogProps = OwnProps & WithI18nProps; +const AboutDialog: React.FunctionComponent = (props) => { + const [isLicenseDialogOpen, setIsLicenseDialogOpen] = useState(false); -class AboutDialog extends React.Component { - public state = { - licenseDialogIsOpen: false, - }; + const [i18n] = useI18n({ id: 'about', translations: { en }, fallback: en }); - render(): JSX.Element { - const { isOpen, onClose, i18n } = this.props; - return ( - onClose()} - > -
-
- -
-

- {i18n.translate(AboutStringId.Description)} -

-

{pybricksCopyright}

+ return ( + props.onClose()} + > +
+
+
-
-

- {legoDisclaimer} -

-
- - - {i18n.translate(AboutStringId.ChangelogButtonLabel)} - - - - {i18n.translate(AboutStringId.WebsiteButtonLabel)} - - -
+

+ {i18n.translate(AboutStringId.Description)} +

+

{pybricksCopyright}

+
+
+

+ {legoDisclaimer} +

+
+ + + {i18n.translate(AboutStringId.ChangelogButtonLabel)} + + + + {i18n.translate(AboutStringId.WebsiteButtonLabel)} + +
- this.setState({ licenseDialogIsOpen: false })} - /> -
- ); - } -} +
+ setIsLicenseDialogOpen(false)} + /> +
+ ); +}; -export default connect()( - withI18n({ id: 'about', fallback: en, translations: { en } })(AboutDialog), -); +export default AboutDialog;