diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 1fd4d206..7447965c 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -7,25 +7,26 @@ import { ButtonGroup, ControlGroup, FormGroup, + IRef, Icon, InputGroup, Intent, Label, Switch, } from '@blueprintjs/core'; -import { Tooltip2 } from '@blueprintjs/popover2'; +import { Classes as Classes2, Popover2 } from '@blueprintjs/popover2'; import { useI18n } from '@shopify/react-i18n'; -import React, { useState } from 'react'; +import React, { useCallback, useState } from 'react'; import { useDispatch } from 'react-redux'; import { useTernaryDarkMode } from 'usehooks-ts'; import AboutDialog from '../about/AboutDialog'; import { appCheckForUpdate, appReload, appShowInstallPrompt } from '../app/actions'; import { + appName, pybricksBugReportsUrl, pybricksGitterUrl, pybricksProjectsUrl, pybricksSupportUrl, - tooltipDelay, } from '../app/constants'; import { pseudolocalize } from '../i18n'; import { useSelector } from '../reducers'; @@ -39,6 +40,43 @@ import { import { I18nId } from './i18n'; import './settings.scss'; +type HelpButtonProps = { + label: string; + content: string | JSX.Element; +}; + +const HelpButton: React.VoidFunctionComponent = ({ + label, + content, +}) => { + const handleOpening = useCallback((node: HTMLElement) => { + // role must match aria-haspopup + node.setAttribute('role', 'dialog'); + }, []); + + return ( + ( +