refactor KefuChatShell component by removing unused host actions state and simplifying button rendering
This commit is contained in:
@@ -75,7 +75,6 @@ export function KefuChatShell() {
|
|||||||
const [isMaximized, setIsMaximized] = useState(false)
|
const [isMaximized, setIsMaximized] = useState(false)
|
||||||
const [isCloseDialogOpen, setIsCloseDialogOpen] = useState(false)
|
const [isCloseDialogOpen, setIsCloseDialogOpen] = useState(false)
|
||||||
const [isClosingConversation, setIsClosingConversation] = useState(false)
|
const [isClosingConversation, setIsClosingConversation] = useState(false)
|
||||||
const [showHostActions, setShowHostActions] = useState(false)
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
title,
|
title,
|
||||||
@@ -142,9 +141,6 @@ export function KefuChatShell() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return bindKefuHostBridge({
|
return bindKefuHostBridge({
|
||||||
onInit: () => {
|
|
||||||
setShowHostActions(true)
|
|
||||||
},
|
|
||||||
onOpen: () => {
|
onOpen: () => {
|
||||||
setIsOpen(true)
|
setIsOpen(true)
|
||||||
setIsVisible(true)
|
setIsVisible(true)
|
||||||
@@ -265,7 +261,6 @@ export function KefuChatShell() {
|
|||||||
>
|
>
|
||||||
<RotateCwIcon className="size-4" />
|
<RotateCwIcon className="size-4" />
|
||||||
</Button>
|
</Button>
|
||||||
{showHostActions ? (
|
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -277,8 +272,6 @@ export function KefuChatShell() {
|
|||||||
>
|
>
|
||||||
<MinusIcon className="size-4" />
|
<MinusIcon className="size-4" />
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
|
||||||
{showHostActions ? (
|
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -294,7 +287,6 @@ export function KefuChatShell() {
|
|||||||
<Maximize2Icon className="size-4" />
|
<Maximize2Icon className="size-4" />
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|||||||
Reference in New Issue
Block a user