From e1304972ad4cae901904663005dffb45e1287c93 Mon Sep 17 00:00:00 2001 From: Tim Pechersky Date: Tue, 3 Aug 2021 21:32:10 +0800 Subject: [PATCH 1/3] stop start button --- frontend/src/components/EntriesNavigation.js | 22 ++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/EntriesNavigation.js b/frontend/src/components/EntriesNavigation.js index 4f6658b1..76d2d7d8 100644 --- a/frontend/src/components/EntriesNavigation.js +++ b/frontend/src/components/EntriesNavigation.js @@ -31,6 +31,7 @@ import { TagLabel, TagCloseButton, Spacer, + useBoolean, } from "@chakra-ui/react"; import { useSubscriptions } from "../core/hooks"; import StreamEntry from "./StreamEntry"; @@ -38,6 +39,7 @@ import UIContext from "../core/providers/UIProvider/context"; import { FaFilter } from "react-icons/fa"; import useStream from "../core/hooks/useStream"; import { ImCancelCircle } from "react-icons/im"; +import { IoStopCircleOutline, IoPlayCircleOutline } from "react-icons/io5"; const pageSize = 25; const FILTER_TYPES = { @@ -61,6 +63,7 @@ const CONDITION = { const EntriesNavigation = () => { const ui = useContext(UIContext); + const [isStreamOn, setStreamState] = useBoolean(true); const { isOpen, onOpen, onClose } = useDisclosure(); const { subscriptionsCache } = useSubscriptions(); const [newFilterState, setNewFilterState] = useState([ @@ -80,7 +83,7 @@ const EntriesNavigation = () => { pageSize, refreshRate: 1500, searchQuery: ui.searchTerm, - enabled: true, + enabled: isStreamOn, isContent: false, }); @@ -358,8 +361,23 @@ const EntriesNavigation = () => { - + + + setStreamState.toggle()} + icon={ + isStreamOn ? ( + + ) : ( + + ) + } + colorScheme={isStreamOn ? "unsafe" : "suggested"} + variant="solid" + /> + {filterState.map((filter, idx) => { if (filter.type === FILTER_TYPES.DISABLED) return ""; return ( From e9aeac38b78730731a92ab37115cc34ad289242a Mon Sep 17 00:00:00 2001 From: Tim Pechersky Date: Tue, 3 Aug 2021 21:34:49 +0800 Subject: [PATCH 2/3] safari fix --- frontend/src/components/EntriesNavigation.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/EntriesNavigation.js b/frontend/src/components/EntriesNavigation.js index 76d2d7d8..90277207 100644 --- a/frontend/src/components/EntriesNavigation.js +++ b/frontend/src/components/EntriesNavigation.js @@ -369,13 +369,12 @@ const EntriesNavigation = () => { onClick={() => setStreamState.toggle()} icon={ isStreamOn ? ( - + ) : ( - + ) } colorScheme={isStreamOn ? "unsafe" : "suggested"} - variant="solid" /> {filterState.map((filter, idx) => { From 6b85bec6f33fed41012a3cf74bc407f59a0bca02 Mon Sep 17 00:00:00 2001 From: Tim Pechersky Date: Tue, 3 Aug 2021 21:39:11 +0800 Subject: [PATCH 3/3] remove console .log --- frontend/pages/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/pages/index.js b/frontend/pages/index.js index f7c87572..c567c6df 100644 --- a/frontend/pages/index.js +++ b/frontend/pages/index.js @@ -123,7 +123,6 @@ const Homepage = () => { }, [isInit, router]); useLayoutEffect(() => { - console.log("rerender check"); const imageLoader720 = new Image(); imageLoader720.src = `${AWS_PATH}/background720.png`; imageLoader720.onload = () => {