mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
remove expand
method
This commit is contained in:
parent
82bb346a54
commit
ab107f1b25
@ -19,7 +19,6 @@ export default React.memo(({
|
|||||||
fullmode
|
fullmode
|
||||||
}) => {
|
}) => {
|
||||||
const [loading, setLoading] = React.useState(true)
|
const [loading, setLoading] = React.useState(true)
|
||||||
const [expanded, setExpanded] = React.useState(false)
|
|
||||||
|
|
||||||
const [likes, setLikes] = React.useState(data.likes ?? [])
|
const [likes, setLikes] = React.useState(data.likes ?? [])
|
||||||
const [comments, setComments] = React.useState(data.comments ?? [])
|
const [comments, setComments] = React.useState(data.comments ?? [])
|
||||||
@ -63,20 +62,6 @@ export default React.memo(({
|
|||||||
return await events.onClickOpen(data)
|
return await events.onClickOpen(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
const toogleExpand = (to) => {
|
|
||||||
if (to === undefined) {
|
|
||||||
to = !expanded
|
|
||||||
}
|
|
||||||
|
|
||||||
setExpanded(to)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleExpand = () => {
|
|
||||||
if (!expanded) {
|
|
||||||
return toogleExpand(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const onDataUpdate = (data) => {
|
const onDataUpdate = (data) => {
|
||||||
console.log("onDataUpdate", data)
|
console.log("onDataUpdate", data)
|
||||||
|
|
||||||
@ -138,9 +123,7 @@ export default React.memo(({
|
|||||||
{ ["liked"]: hasLiked },
|
{ ["liked"]: hasLiked },
|
||||||
{ ["noHide"]: !expansibleActions },
|
{ ["noHide"]: !expansibleActions },
|
||||||
{ ["fullmode"]: fullmode },
|
{ ["fullmode"]: fullmode },
|
||||||
{ ["expanded"]: expanded }
|
|
||||||
)}
|
)}
|
||||||
onClick={handleExpand}
|
|
||||||
>
|
>
|
||||||
<div className="wrapper">
|
<div className="wrapper">
|
||||||
<PostHeader
|
<PostHeader
|
||||||
|
Loading…
x
Reference in New Issue
Block a user