fix: hide dynamic panels & focused mode options on mobile
This commit is contained in:
@@ -21,17 +21,20 @@ const FocusModeSwitch: FunctionComponent<Props> = ({ application, onToggle, onCl
|
||||
[onToggle, isEnabled, onClose],
|
||||
)
|
||||
|
||||
const isMobile = application.isNativeMobileWeb() || isMobileScreen()
|
||||
|
||||
if (isMobile) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
className="group flex w-full cursor-pointer items-center justify-between border-0 bg-transparent px-3 py-1.5 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none disabled:bg-default disabled:text-passive-2"
|
||||
onClick={toggle}
|
||||
disabled={application.isNativeMobileWeb() || isMobileScreen()}
|
||||
>
|
||||
<div className="flex items-center">Focused Writing</div>
|
||||
<Switch className="px-0" checked={isEnabled} />
|
||||
</button>
|
||||
</>
|
||||
<button
|
||||
className="group flex w-full cursor-pointer items-center justify-between border-0 bg-transparent px-3 py-1.5 text-left text-sm text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none disabled:bg-default disabled:text-passive-2"
|
||||
onClick={toggle}
|
||||
>
|
||||
<div className="flex items-center">Focused Writing</div>
|
||||
<Switch className="px-0" checked={isEnabled} />
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -46,13 +46,17 @@ const ThemesMenuButton: FunctionComponent<Props> = ({ application, item }) => {
|
||||
)
|
||||
|
||||
const isMobile = application.isNativeMobileWeb() || isMobileScreen()
|
||||
const shouldHideButton = item.identifier === FeatureIdentifier.DynamicTheme && isMobile
|
||||
|
||||
if (shouldHideButton) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
className={
|
||||
'group flex w-full cursor-pointer items-center justify-between border-0 bg-transparent px-3 py-1.5 text-left text-mobile-menu-item text-text hover:bg-contrast hover:text-foreground focus:bg-info-backdrop focus:shadow-none disabled:bg-default disabled:text-passive-2 md:text-sm'
|
||||
}
|
||||
disabled={item.identifier === FeatureIdentifier.DynamicTheme && isMobile}
|
||||
onClick={toggleTheme}
|
||||
>
|
||||
{item.component?.isLayerable() ? (
|
||||
|
||||
Reference in New Issue
Block a user