feat: ♿️ Typebot header back to folder if exists
This commit is contained in:
@ -79,16 +79,15 @@ export const FolderContent = ({ folder }: Props) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const { totalSharedTypebots, isLoading: isSharedTypebotsCountLoading } =
|
const { totalSharedTypebots } = useSharedTypebotsCount({
|
||||||
useSharedTypebotsCount({
|
userId: folder === null ? user?.id : undefined,
|
||||||
userId: folder === null ? user?.id : undefined,
|
onError: (error) => {
|
||||||
onError: (error) => {
|
toast({
|
||||||
toast({
|
title: "Couldn't fetch shared typebots",
|
||||||
title: "Couldn't fetch shared typebots",
|
description: error.message,
|
||||||
description: error.message,
|
})
|
||||||
})
|
},
|
||||||
},
|
})
|
||||||
})
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
@ -197,7 +196,6 @@ export const FolderContent = ({ folder }: Props) => {
|
|||||||
folderId={folder?.id}
|
folderId={folder?.id}
|
||||||
isLoading={isTypebotLoading}
|
isLoading={isTypebotLoading}
|
||||||
/>
|
/>
|
||||||
{isSharedTypebotsCountLoading && <ButtonSkeleton />}
|
|
||||||
{totalSharedTypebots > 0 && <SharedTypebotsButton />}
|
{totalSharedTypebots > 0 && <SharedTypebotsButton />}
|
||||||
{isFolderLoading && <ButtonSkeleton />}
|
{isFolderLoading && <ButtonSkeleton />}
|
||||||
{folders &&
|
{folders &&
|
||||||
|
@ -108,7 +108,11 @@ export const TypebotHeader = () => {
|
|||||||
as={NextChakraLink}
|
as={NextChakraLink}
|
||||||
aria-label="Back"
|
aria-label="Back"
|
||||||
icon={<ChevronLeftIcon fontSize={30} />}
|
icon={<ChevronLeftIcon fontSize={30} />}
|
||||||
href="/typebots"
|
href={
|
||||||
|
typebot?.folderId
|
||||||
|
? `/typebots/folders/${typebot.folderId}`
|
||||||
|
: '/typebots'
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
{typebot?.name && (
|
{typebot?.name && (
|
||||||
<EditableTypebotName
|
<EditableTypebotName
|
||||||
|
Reference in New Issue
Block a user