mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-15 11:04:49 +00:00
src: use prop unpacking pattern
This makes the code a bit shorter by not having to use `props.` all of the time. Also make everything VoidFunctionComponent while we are touching this.
This commit is contained in:
@@ -24,7 +24,10 @@ import './about.scss';
|
||||
|
||||
type AboutDialogProps = { isOpen: boolean; onClose: () => void };
|
||||
|
||||
const AboutDialog: React.FunctionComponent<AboutDialogProps> = (props) => {
|
||||
const AboutDialog: React.VoidFunctionComponent<AboutDialogProps> = ({
|
||||
isOpen,
|
||||
onClose,
|
||||
}) => {
|
||||
const [isLicenseDialogOpen, setIsLicenseDialogOpen] = useState(false);
|
||||
|
||||
const [i18n] = useI18n({ id: 'about', translations: { en }, fallback: en });
|
||||
@@ -32,8 +35,8 @@ const AboutDialog: React.FunctionComponent<AboutDialogProps> = (props) => {
|
||||
return (
|
||||
<Dialog
|
||||
title={`Pybricks v${firmwareVersion} (${appName} v${appVersion})`}
|
||||
isOpen={props.isOpen}
|
||||
onClose={props.onClose}
|
||||
isOpen={isOpen}
|
||||
onClose={onClose}
|
||||
>
|
||||
<div className={Classes.DIALOG_BODY}>
|
||||
<div className="pb-about-icon">
|
||||
|
||||
Reference in New Issue
Block a user