From e1b7dcaf9520bd5feb704f2cd17b35f8a8772674 Mon Sep 17 00:00:00 2001 From: Yann Bizeul Date: Mon, 14 Aug 2023 16:20:43 +0200 Subject: [PATCH] Cleanup unused elements --- ui/src/YBFeed/YBFeedItem.tsx | 21 +-------------------- ui/src/YBFeed/YBFeedItemText.tsx | 3 +-- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/ui/src/YBFeed/YBFeedItem.tsx b/ui/src/YBFeed/YBFeedItem.tsx index 878400e..3ddf8fe 100644 --- a/ui/src/YBFeed/YBFeedItem.tsx +++ b/ui/src/YBFeed/YBFeedItem.tsx @@ -1,4 +1,4 @@ -import { useState,useEffect } from 'react' +import { useState } from 'react' import { Space, Modal } from 'antd' import { @@ -65,10 +65,6 @@ export function YBFeedItem(props: FeedItemProps) { const { item } = props const { type } = props.item - const [isMobile, setIsMobile] = useState(false) - - console.log("Render YBFeedItem") - let component if (type === 0){ component = FeedItemText({item: item, showCopyButton:true}) @@ -76,21 +72,6 @@ export function YBFeedItem(props: FeedItemProps) { component = FeedItemImage({item: item, showCopyButton:true}) } - - useEffect(() => { - const handleResize = () => { - setIsMobile(window.innerWidth <= 576); // Adjust the breakpoint as needed - }; - - handleResize(); // Initial call to set the initial state - - window.addEventListener('resize', handleResize); - - return () => { - window.removeEventListener('resize', handleResize); - }; - }, []); - return(
diff --git a/ui/src/YBFeed/YBFeedItemText.tsx b/ui/src/YBFeed/YBFeedItemText.tsx index 4aba127..9b7b7e5 100644 --- a/ui/src/YBFeed/YBFeedItemText.tsx +++ b/ui/src/YBFeed/YBFeedItemText.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react' -import { Button, message } from 'antd' +import { Button } from 'antd' import { MdContentCopy } from "react-icons/md"; import { FeedItemProps } from './YBFeedItem' @@ -8,7 +8,6 @@ export function FeedItemText(props:FeedItemProps) { const { name, feed } = item const [textValue,setTextValue] = useState("") - console.log("FeedItemText") const copyItem = () => { navigator.clipboard.writeText(textValue) }