From 8e7266acac2363892182ba9cb910767b6bda34e4 Mon Sep 17 00:00:00 2001 From: TeodorusNathaniel Date: Tue, 15 Aug 2023 20:48:28 +0700 Subject: [PATCH 1/2] Remove bell icon in iframe --- src/components/navbar/Navbar/Navbar.tsx | 21 +++++++++++++++------ src/modules/chat/ChatPage/ChatPage.tsx | 4 ++-- src/modules/chat/HubPage/HubPageNavbar.tsx | 10 +++++----- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/components/navbar/Navbar/Navbar.tsx b/src/components/navbar/Navbar/Navbar.tsx index 2583c0bbe..02e0d81b0 100644 --- a/src/components/navbar/Navbar/Navbar.tsx +++ b/src/components/navbar/Navbar/Navbar.tsx @@ -2,6 +2,7 @@ import BackButton from '@/components/BackButton' import Button from '@/components/Button' import Container from '@/components/Container' import Logo from '@/components/Logo' +import useIsInIframe from '@/hooks/useIsInIframe' import usePrevious from '@/hooks/usePrevious' import { useConfigContext } from '@/providers/ConfigProvider' import { getBlockedResourcesQuery } from '@/services/api/moderation/query' @@ -14,7 +15,14 @@ import { LocalStorage } from '@/utils/storage' import dynamic from 'next/dynamic' import Link from 'next/link' import { useRouter } from 'next/router' -import { ComponentProps, useEffect, useMemo, useRef, useState } from 'react' +import { + ComponentProps, + ReactNode, + useEffect, + useMemo, + useRef, + useState, +} from 'react' import { HiOutlineBell, HiOutlineChevronLeft } from 'react-icons/hi2' const ProfileAvatar = dynamic(() => import('./ProfileAvatar'), { @@ -31,10 +39,10 @@ export type NavbarProps = ComponentProps<'div'> & { forceUseDefaultBackLink?: boolean } customContent?: (elements: { - logoLink: JSX.Element - authComponent: JSX.Element - notificationBell: JSX.Element - backButton: JSX.Element + logoLink: ReactNode + authComponent: ReactNode + notificationBell: ReactNode + backButton: ReactNode }) => JSX.Element } @@ -113,7 +121,8 @@ export default function Navbar({ ) - const notificationBell = + const isInIframe = useIsInIframe() + const notificationBell = !isInIframe && return ( <> diff --git a/src/modules/chat/ChatPage/ChatPage.tsx b/src/modules/chat/ChatPage/ChatPage.tsx index 08193f80e..54e440d77 100644 --- a/src/modules/chat/ChatPage/ChatPage.tsx +++ b/src/modules/chat/ChatPage/ChatPage.tsx @@ -34,7 +34,7 @@ import { replaceUrl } from '@/utils/window' import dynamic from 'next/dynamic' import { ImageProps } from 'next/image' import Router, { useRouter } from 'next/router' -import { useEffect, useRef, useState } from 'react' +import { ReactNode, useEffect, useRef, useState } from 'react' import urlJoin from 'url-join' const NetworkStatus = dynamic(() => import('@/components/NetworkStatus'), { @@ -224,7 +224,7 @@ function NavbarChatInfo({ }: { image: ImageProps['src'] messageCount: number - backButton: JSX.Element + backButton: ReactNode chatMetadata?: ChatMetadata chatId: string }) { diff --git a/src/modules/chat/HubPage/HubPageNavbar.tsx b/src/modules/chat/HubPage/HubPageNavbar.tsx index 95cf70081..47ec05e82 100644 --- a/src/modules/chat/HubPage/HubPageNavbar.tsx +++ b/src/modules/chat/HubPage/HubPageNavbar.tsx @@ -7,13 +7,13 @@ import NavbarWithSearch, { import useIsInIframe from '@/hooks/useIsInIframe' import { getSpaceQuery } from '@/services/subsocial/spaces' import { getHubIds } from '@/utils/env/client' -import { useState } from 'react' +import { ReactNode, useState } from 'react' export type HubPageNavbarProps = { - logo: JSX.Element - auth: JSX.Element - backButton: JSX.Element - notificationBell: JSX.Element + logo: ReactNode + auth: ReactNode + backButton: ReactNode + notificationBell: ReactNode searchProps: NavbarWithSearchProps['searchProps'] hubId: string chatsCount: number From 7eb65eb383e03ab6d330980f49907482c6785a24 Mon Sep 17 00:00:00 2001 From: oap75 Date: Tue, 15 Aug 2023 17:27:07 +0300 Subject: [PATCH 2/2] feat: CI --- .github/workflows/feature-based.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/feature-based.yaml b/.github/workflows/feature-based.yaml index 78bab7fa8..9b5e2faf2 100644 --- a/.github/workflows/feature-based.yaml +++ b/.github/workflows/feature-based.yaml @@ -69,6 +69,7 @@ jobs: GH_NEXT_PUBLIC_GA_ID=G-FT28TL1W3M GH_IPFS_PIN_URL=https://test-pin.crustcloud.io/psa GH_COVALENT_API_KEY=cqt_rQtDdp9G9DFvqcGjVPDD4FFCyhFQ + target: runner tags: | ${{ env.image }} cache-from: type=local,src=/tmp/.buildx-cache