From 5d4bbce324ade8066a499209dcbb3b83e69444b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 28 Jun 2024 23:42:44 +0200 Subject: [PATCH] Remove logo from navbar, hide navbar on mobile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/components/thumb-navigation-link.tsx | 16 +------- src/components/thumb-navigation.tsx | 15 +++++++- src/components/ui/column/column.tsx | 2 +- .../chats/components/chat-page/chat-page.tsx | 2 +- src/features/compose/components/search.tsx | 2 +- .../components/site-preview.tsx | 14 +++---- src/features/ui/components/navbar.tsx | 38 +++++-------------- src/utils/features.ts | 2 +- 8 files changed, 35 insertions(+), 56 deletions(-) diff --git a/src/components/thumb-navigation-link.tsx b/src/components/thumb-navigation-link.tsx index d5db818ed..91acbd1fb 100644 --- a/src/components/thumb-navigation-link.tsx +++ b/src/components/thumb-navigation-link.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { NavLink, useLocation } from 'react-router-dom'; import IconWithCounter from 'soapbox/components/icon-with-counter'; -import { Icon, Text } from 'soapbox/components/ui'; +import { Icon } from 'soapbox/components/ui'; import { useSettings } from 'soapbox/hooks'; interface IThumbNavigationLink { @@ -34,7 +34,7 @@ const ThumbNavigationLink: React.FC = ({ count, countMax, const icon = (active && activeSrc) || src; return ( - + {!demetricator && count !== undefined ? ( = ({ count, countMax, })} /> )} - - - {text} - ); }; diff --git a/src/components/thumb-navigation.tsx b/src/components/thumb-navigation.tsx index 44fb625d3..a78963079 100644 --- a/src/components/thumb-navigation.tsx +++ b/src/components/thumb-navigation.tsx @@ -1,11 +1,15 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; +import { openSidebar } from 'soapbox/actions/sidebar'; import ThumbNavigationLink from 'soapbox/components/thumb-navigation-link'; import { useStatContext } from 'soapbox/contexts/stat-context'; -import { useAppSelector, useFeatures, useOwnAccount } from 'soapbox/hooks'; +import { useAppDispatch, useAppSelector, useFeatures, useOwnAccount } from 'soapbox/hooks'; + +import { Icon } from './ui'; const ThumbNavigation: React.FC = (): JSX.Element => { + const dispatch = useAppDispatch(); const { account } = useOwnAccount(); const features = useFeatures(); @@ -14,6 +18,8 @@ const ThumbNavigation: React.FC = (): JSX.Element => { const notificationCount = useAppSelector((state) => state.notifications.unread); const dashboardCount = useAppSelector((state) => state.admin.openReports.count() + state.admin.awaitingApproval.count()); + const onOpenSidebar = () => dispatch(openSidebar()); + /** Conditionally render the supported messages link */ const renderMessagesLink = (): React.ReactNode => { if (features.chats) { @@ -46,6 +52,13 @@ const ThumbNavigation: React.FC = (): JSX.Element => { return (
+ + = React.forwardRef((props, ref: React.ForwardedR backHref={backHref} className={clsx({ 'rounded-t-3xl': !isScrolled && !transparent, - 'sticky top-12 z-10 bg-white/90 dark:bg-primary-900/90 black:bg-black/80 backdrop-blur lg:top-16': !transparent, + 'sticky top-0 z-10 bg-white/90 dark:bg-primary-900/90 black:bg-black/80 backdrop-blur lg:top-16': !transparent, 'p-4 sm:p-0 sm:pb-4 black:p-4': transparent, '-mt-4 -mx-4 p-4': size !== 'lg' && !transparent, '-mt-4 -mx-4 p-4 sm:-mt-6 sm:-mx-6 sm:p-6': size === 'lg' && !transparent, diff --git a/src/features/chats/components/chat-page/chat-page.tsx b/src/features/chats/components/chat-page/chat-page.tsx index ab6bc2de2..54b71cf29 100644 --- a/src/features/chats/components/chat-page/chat-page.tsx +++ b/src/features/chats/components/chat-page/chat-page.tsx @@ -58,7 +58,7 @@ const ChatPage: React.FC = ({ chatId }) => { className='h-screen overflow-hidden bg-white text-gray-900 shadow-lg black:bg-transparent sm:rounded-t-xl dark:bg-primary-900 dark:text-gray-100 dark:shadow-none' >
{ return (
diff --git a/src/features/soapbox-config/components/site-preview.tsx b/src/features/soapbox-config/components/site-preview.tsx index e1ca0198d..346a88330 100644 --- a/src/features/soapbox-config/components/site-preview.tsx +++ b/src/features/soapbox-config/components/site-preview.tsx @@ -3,7 +3,6 @@ import React, { useMemo } from 'react'; import { FormattedMessage } from 'react-intl'; import { defaultSettings } from 'soapbox/actions/settings'; -import SiteLogo from 'soapbox/components/site-logo'; import BackgroundShapes from 'soapbox/features/ui/components/background-shapes'; import { useSystemTheme } from 'soapbox/hooks'; import { normalizeSoapboxConfig } from 'soapbox/normalizers'; @@ -43,13 +42,12 @@ const SitePreview: React.FC = ({ soapbox }) => {
-
- -
+
); diff --git a/src/features/ui/components/navbar.tsx b/src/features/ui/components/navbar.tsx index 7a208e39b..b7b7f9701 100644 --- a/src/features/ui/components/navbar.tsx +++ b/src/features/ui/components/navbar.tsx @@ -5,12 +5,9 @@ import { Link, Redirect } from 'react-router-dom'; import { logIn, verifyCredentials } from 'soapbox/actions/auth'; import { fetchInstance } from 'soapbox/actions/instance'; -import { openSidebar } from 'soapbox/actions/sidebar'; -import SiteLogo from 'soapbox/components/site-logo'; import { Avatar, Button, Form, HStack, IconButton, Input, Tooltip } from 'soapbox/components/ui'; import Search from 'soapbox/features/compose/components/search'; import { useAppDispatch, useFeatures, useOwnAccount, useRegistrationStatus } from 'soapbox/hooks'; -import { useIsMobile } from 'soapbox/hooks/useIsMobile'; import ProfileDropdown from './profile-dropdown'; @@ -31,15 +28,12 @@ const Navbar = () => { const { isOpen } = useRegistrationStatus(); const { account } = useOwnAccount(); const node = useRef(null); - const isMobile = useIsMobile(); const [isLoading, setLoading] = useState(false); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [mfaToken, setMfaToken] = useState(false); - const onOpenSidebar = () => dispatch(openSidebar()); - const handleSubmit: React.FormEventHandler = (event) => { event.preventDefault(); setLoading(true); @@ -69,47 +63,33 @@ const Navbar = () => { return (