From 187af8b7d24ecbf1b08a3b3618c61dae0b6db94c Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 24 Apr 2022 17:53:03 -0500 Subject: [PATCH] Improve dropdown menu styles --- app/soapbox/components/dropdown_menu.tsx | 8 ++++---- app/soapbox/components/ui/icon/svg-icon.tsx | 2 ++ app/soapbox/features/account/components/header.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/soapbox/components/dropdown_menu.tsx b/app/soapbox/components/dropdown_menu.tsx index e28ea0f9e..4bd747d0a 100644 --- a/app/soapbox/components/dropdown_menu.tsx +++ b/app/soapbox/components/dropdown_menu.tsx @@ -6,8 +6,8 @@ import { spring } from 'react-motion'; import Overlay from 'react-overlays/lib/Overlay'; import { withRouter, RouteComponentProps } from 'react-router-dom'; -import Icon from 'soapbox/components/icon'; import { IconButton } from 'soapbox/components/ui'; +import SvgIcon from 'soapbox/components/ui/icon/svg-icon'; import Motion from 'soapbox/features/ui/util/optional_motion'; import type { Status } from 'soapbox/types/entities'; @@ -177,7 +177,7 @@ class DropdownMenu extends React.PureComponent +
  • - {icon && } - {text} + {icon && } + {text}
  • ); diff --git a/app/soapbox/components/ui/icon/svg-icon.tsx b/app/soapbox/components/ui/icon/svg-icon.tsx index 84604150d..c84e40203 100644 --- a/app/soapbox/components/ui/icon/svg-icon.tsx +++ b/app/soapbox/components/ui/icon/svg-icon.tsx @@ -29,6 +29,8 @@ const SvgIcon: React.FC = ({ src, alt, size = 24, className }): JSX.El height={size} loader={loader} data-testid='svg-icon' + // The cache causes bugs, and the ServiceWorker already caches icons. + cacheRequests={false} > {/* If the fetch fails, fall back to displaying the loader */} {loader} diff --git a/app/soapbox/features/account/components/header.js b/app/soapbox/features/account/components/header.js index c1d807546..1db5b1dd3 100644 --- a/app/soapbox/features/account/components/header.js +++ b/app/soapbox/features/account/components/header.js @@ -630,7 +630,7 @@ class Header extends ImmutablePureComponent { return (
    - +
    {menuItem.text}