Skip to content

Commit

Permalink
Cleanup unused elements
Browse files Browse the repository at this point in the history
  • Loading branch information
ybizeul committed Aug 14, 2023
1 parent 7b3e20e commit e1b7dca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
21 changes: 1 addition & 20 deletions ui/src/YBFeed/YBFeedItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState,useEffect } from 'react'
import { useState } from 'react'
import { Space, Modal } from 'antd'

import {
Expand Down Expand Up @@ -65,32 +65,13 @@ 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})
} else {
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(
<div className='item'>
<YBHeading item={item} />
Expand Down
3 changes: 1 addition & 2 deletions ui/src/YBFeed/YBFeedItemText.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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)
}
Expand Down

0 comments on commit e1b7dca

Please sign in to comment.