Allow clicking on narrow version of idle primary device warning

This commit is contained in:
trevor-signal
2025-03-25 21:01:22 -04:00
committed by GitHub
parent 0fa1d2fc2f
commit da681dd8c5
2 changed files with 17 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ export type PropsType = {
| { | {
onClick: () => void; onClick: () => void;
clickLabel: string; clickLabel: string;
hasAction: true; hasAction: boolean;
} }
) & ) &
( (

View File

@@ -8,8 +8,9 @@ import {
LeftPaneDialogIcon, LeftPaneDialogIcon,
LeftPaneDialogIconBackground, LeftPaneDialogIconBackground,
} from './LeftPaneDialog'; } from './LeftPaneDialog';
import type { WidthBreakpoint } from './_util'; import { WidthBreakpoint } from './_util';
import type { LocalizerType } from '../types/I18N'; import type { LocalizerType } from '../types/I18N';
import { openLinkInWebBrowser } from '../util/openLinkInWebBrowser';
export type Props = { export type Props = {
containerWidthBreakpoint: WidthBreakpoint; containerWidthBreakpoint: WidthBreakpoint;
@@ -33,6 +34,13 @@ export function WarningIdlePrimaryDeviceDialog({
<LeftPaneDialogIcon type="error" /> <LeftPaneDialogIcon type="error" />
</LeftPaneDialogIconBackground> </LeftPaneDialogIconBackground>
} }
{...(containerWidthBreakpoint === WidthBreakpoint.Narrow
? {
onClick: () => openLinkInWebBrowser(SUPPORT_PAGE),
clickLabel: i18n('icu:IdlePrimaryDevice__learnMore'),
hasAction: false,
}
: { hasAction: false })}
{...(handleClose == null {...(handleClose == null
? { hasXButton: false } ? { hasXButton: false }
: { : {
@@ -42,11 +50,13 @@ export function WarningIdlePrimaryDeviceDialog({
})} })}
> >
{i18n('icu:IdlePrimaryDevice__body')} {i18n('icu:IdlePrimaryDevice__body')}
{containerWidthBreakpoint !== WidthBreakpoint.Narrow ? (
<div> <div>
<a href={SUPPORT_PAGE} rel="noreferrer" target="_blank"> <a href={SUPPORT_PAGE} rel="noreferrer" target="_blank">
{i18n('icu:IdlePrimaryDevice__learnMore')} {i18n('icu:IdlePrimaryDevice__learnMore')}
</a> </a>
</div> </div>
) : null}
</LeftPaneDialog> </LeftPaneDialog>
); );
} }