-
-
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.
Merge pull request #21 from baptisteArno/feat/zoom
feat(editor): ✨ Zoom in/out
- Loading branch information
Showing
16 changed files
with
336 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { | ||
Heading, | ||
Modal, | ||
ModalBody, | ||
ModalCloseButton, | ||
ModalContent, | ||
ModalOverlay, | ||
Stack, | ||
Text, | ||
Radio, | ||
VStack, | ||
RadioGroup, | ||
HStack, | ||
} from '@chakra-ui/react' | ||
import { LaptopIcon, MouseIcon } from 'assets/icons' | ||
import { useUser } from 'contexts/UserContext' | ||
import { GraphNavigation } from 'db' | ||
import React, { useEffect, useState } from 'react' | ||
|
||
type Props = { | ||
isOpen: boolean | ||
onClose: () => void | ||
} | ||
|
||
export const EditorSettingsModal = ({ isOpen, onClose }: Props) => { | ||
return ( | ||
<Modal isOpen={isOpen} onClose={onClose} size="xl"> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalCloseButton /> | ||
<ModalBody pt="12" pb="8" px="8"> | ||
<EditorSettings /> | ||
</ModalBody> | ||
</ModalContent> | ||
</Modal> | ||
) | ||
} | ||
|
||
const EditorSettings = () => { | ||
const { user, saveUser } = useUser() | ||
const [value, setValue] = useState<string>( | ||
user?.graphNavigation ?? GraphNavigation.TRACKPAD | ||
) | ||
|
||
useEffect(() => { | ||
if (user?.graphNavigation === value) return | ||
saveUser({ graphNavigation: value as GraphNavigation }).then() | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [value]) | ||
|
||
const options = [ | ||
{ | ||
value: GraphNavigation.MOUSE, | ||
label: 'Mouse', | ||
description: | ||
'Move by dragging the board and zoom in/out using the scroll wheel', | ||
icon: <MouseIcon boxSize="35px" />, | ||
}, | ||
{ | ||
value: GraphNavigation.TRACKPAD, | ||
label: 'Trackpad', | ||
description: 'Move the board using 2 fingers and zoom in/out by pinching', | ||
icon: <LaptopIcon boxSize="35px" />, | ||
}, | ||
] | ||
|
||
return ( | ||
<Stack spacing={4}> | ||
<Heading size="md">Navigation</Heading> | ||
<RadioGroup onChange={setValue} value={value}> | ||
<HStack spacing={4} w="full"> | ||
{options.map((option) => ( | ||
<VStack | ||
key={option.value} | ||
as="label" | ||
htmlFor={option.label} | ||
cursor="pointer" | ||
borderWidth="1px" | ||
borderRadius="md" | ||
w="full" | ||
p="6" | ||
spacing={6} | ||
> | ||
{option.icon} | ||
<Stack> | ||
<Text fontWeight="bold">{option.label}</Text> | ||
<Text>{option.description}</Text> | ||
</Stack> | ||
|
||
<Radio value={option.value} id={option.label} /> | ||
</VStack> | ||
))} | ||
</HStack> | ||
</RadioGroup> | ||
</Stack> | ||
) | ||
} |
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
Oops, something went wrong.
47947a6
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
bot.joof.it
yoda.riku.ai
bots.bridge.ai
bot.jesopizz.it
bergamo.store
app.yvon.earth
bot.tvbeat.it
chat.hayuri.id
gollum.riku.ai
talk.gocare.io
viewer.typebot.io
fitness.riku.ai
bot.contakit.com
zap.fundviser.in
bot.rihabilita.it
bot.dsignagency.com
demo.wemakebots.xyz
88584434.therpm.club
bot.danyservice.it
chatbot.matthesv.de
bot.barrettamario.it
92109660.therpm.club
bot.digitalpointer.id
hello.advergreen.com
bot.eikju.photography
bot.coachayongzul.com
bot.outstandbrand.com
criar.somaperuzzo.com
bot.ilmuseoaiborghi.it
bot.robertohairlab.it
bot.pratikmandalia.com
form.bridesquadapp.com
michaeljackson.riku.ai
arrivalx2.wpwakanda.com
bot.hotelplayarimini.it
91375310.actualizar.xyz
invite.bridesquadapp.com
88152257.actualizar.xyz
87656003.actualizar.xyz
link.venturasuceder.com
chat.thehomebuyersusa.com
bot.amicidisanfaustino.it
forms.hiabhaykulkarni.com
typebot-viewer.vercel.app
casestudyemb.wpwakanda.com
bot.adventureconsulting.hu
homepageonly.wpwakanda.com
chat.atlasoutfittersk9.com
liveconvert.kandalearn.com
herbalife.barrettamario.it
mainmenu1one.wpwakanda.com
tarian.theiofoundation.org
bot.pinpointinteractive.com
bot.seidinembroseanchetu.it
forms.escoladeautomacao.com.br
bot.seidibergamoseanchetu.it
bot.polychromes-project.com
liveconvert2.kandalearn.com
bot.studiotecnicoimmobiliaremerelli.it
viewer-v2-git-main-typebot-io.vercel.app
viewer-v2-typebot-io.vercel.app
47947a6
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:
landing-page-v2 – ./apps/landing-page
landing-page-v2-typebot-io.vercel.app
landing-page-v2-git-main-typebot-io.vercel.app
get-typebot.com
www.typebot.io
typebot.io
www.get-typebot.com
47947a6
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-alpha – ./apps/viewer
stan.vselise.com
boyfriend-breakup.riku.ai
chat.hayurihijab.com
bot.upfunnel.art
gcase.barrettamario.it
sakuranembro.it
zap.techadviser.in
piazzatorre.barrettamario.it
forms.webisharp.com
aibot.angrybranding.co.uk
personal-trainer.barrettamario.it
onboarding.libertydreamcare.ie
viewer-v2-alpha-typebot-io.vercel.app
viewer-v2-alpha-git-main-typebot-io.vercel.app
47947a6
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
app.typebot.io
builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app