-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(flow): ⚡️ Smooth panning even with complexe flow
- Loading branch information
1 parent
3c67837
commit e9a9dc0
Showing
6 changed files
with
63 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { useTypebot } from 'contexts/TypebotContext' | ||
import { Block } from 'models' | ||
import React from 'react' | ||
import { AnswersCount } from 'services/analytics' | ||
import { Edges } from './Edges' | ||
import { BlockNode } from './Nodes/BlockNode' | ||
|
||
type Props = { | ||
answersCounts?: AnswersCount[] | ||
onUnlockProPlanClick?: () => void | ||
} | ||
const MyComponent = ({ answersCounts, onUnlockProPlanClick }: Props) => { | ||
const { typebot } = useTypebot() | ||
return ( | ||
<> | ||
<Edges | ||
edges={typebot?.edges ?? []} | ||
answersCounts={answersCounts} | ||
onUnlockProPlanClick={onUnlockProPlanClick} | ||
/> | ||
{typebot?.blocks.map((block, idx) => ( | ||
<BlockNode block={block as Block} blockIndex={idx} key={block.id} /> | ||
))} | ||
</> | ||
) | ||
} | ||
|
||
// Performance hack, never rerender when graph (parent) is panned | ||
const areEqual = () => true | ||
|
||
export default React.memo(MyComponent, areEqual) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e9a9dc0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
builder-v2 – ./apps/builder
builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io
e9a9dc0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viewer-v2 – ./apps/viewer
zap.fundviser.in
chat.hayuri.id
app.yvon.earth
viewer.typebot.io
bot.outstandbrand.com
bot.matthesv.de
88584434.therpm.club
chat.matthesv.de
demo.wemakebots.xyz
92109660.therpm.club
chat.atlasoutfittersk9.com
chat.thehomebuyersusa.com
link.venturasuceder.com
bot.pinpointinteractive.com
bot.pratikmandalia.com
typebot-viewer.vercel.app
tarian.theiofoundation.org
viewer-v2-typebot-io.vercel.app
bot.adventureconsulting.hu
criar.somaperuzzo.com
viewer-v2-git-main-typebot-io.vercel.app