-
-
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.
- Loading branch information
1 parent
1d3917f
commit d2ac13b
Showing
14 changed files
with
294 additions
and
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Icon, IconProps } from '@chakra-ui/react' | ||
import React from 'react' | ||
|
||
export const DefaultAvatar = (props: IconProps) => { | ||
return ( | ||
<Icon | ||
viewBox="0 0 75 75" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
boxSize="40px" | ||
data-testid="default-avatar" | ||
{...props} | ||
> | ||
<mask id="mask0" x="0" y="0" mask-type="alpha"> | ||
<circle cx="37.5" cy="37.5" r="37.5" fill="#0042DA" /> | ||
</mask> | ||
<g mask="url(#mask0)"> | ||
<rect x="-30" y="-43" width="131" height="154" fill="#0042DA" /> | ||
<rect | ||
x="2.50413" | ||
y="120.333" | ||
width="81.5597" | ||
height="86.4577" | ||
rx="2.5" | ||
transform="rotate(-52.6423 2.50413 120.333)" | ||
stroke="#FED23D" | ||
strokeWidth="5" | ||
/> | ||
<circle cx="76.5" cy="-1.5" r="29" stroke="#FF8E20" strokeWidth="5" /> | ||
<path | ||
d="M-49.8224 22L-15.5 -40.7879L18.8224 22H-49.8224Z" | ||
stroke="#F7F8FF" | ||
strokeWidth="5" | ||
/> | ||
</g> | ||
</Icon> | ||
) | ||
} |
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,82 @@ | ||
import React from 'react' | ||
import { AvatarProps } from 'models' | ||
import { | ||
Heading, | ||
HStack, | ||
Popover, | ||
PopoverContent, | ||
PopoverTrigger, | ||
Stack, | ||
Switch, | ||
Image, | ||
Flex, | ||
Box, | ||
Portal, | ||
} from '@chakra-ui/react' | ||
import { ImageUploadContent } from 'components/shared/ImageUploadContent' | ||
import { DefaultAvatar } from 'assets/DefaultAvatar' | ||
|
||
type Props = { | ||
title: string | ||
avatarProps?: AvatarProps | ||
isDefaultCheck?: boolean | ||
onAvatarChange: (avatarProps: AvatarProps) => void | ||
} | ||
|
||
export const AvatarForm = ({ | ||
title, | ||
avatarProps, | ||
isDefaultCheck = false, | ||
onAvatarChange, | ||
}: Props) => { | ||
const isChecked = avatarProps ? avatarProps.isEnabled : isDefaultCheck | ||
const handleOnCheck = () => | ||
onAvatarChange({ ...avatarProps, isEnabled: !isChecked }) | ||
const handleImageUrl = (url: string) => | ||
onAvatarChange({ isEnabled: isChecked, url }) | ||
return ( | ||
<Stack borderWidth={1} rounded="md" p="4" spacing={4}> | ||
<Flex justifyContent="space-between"> | ||
<HStack> | ||
<Heading as="label" fontSize="lg" htmlFor={title} mb="1"> | ||
{title} | ||
</Heading> | ||
<Switch isChecked={isChecked} id={title} onChange={handleOnCheck} /> | ||
</HStack> | ||
{isChecked && ( | ||
<Popover isLazy> | ||
<PopoverTrigger> | ||
{avatarProps?.url ? ( | ||
<Image | ||
src={avatarProps.url} | ||
alt="Website image" | ||
cursor="pointer" | ||
_hover={{ filter: 'brightness(.9)' }} | ||
transition="filter 200ms" | ||
rounded="full" | ||
boxSize="40px" | ||
objectFit="cover" | ||
/> | ||
) : ( | ||
<Box> | ||
<DefaultAvatar | ||
cursor="pointer" | ||
_hover={{ filter: 'brightness(.9)' }} | ||
/> | ||
</Box> | ||
)} | ||
</PopoverTrigger> | ||
<Portal> | ||
<PopoverContent p="4"> | ||
<ImageUploadContent | ||
url={avatarProps?.url} | ||
onSubmit={handleImageUrl} | ||
/> | ||
</PopoverContent> | ||
</Portal> | ||
</Popover> | ||
)} | ||
</Flex> | ||
</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
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,24 @@ | ||
import React from 'react' | ||
import { DefaultAvatar } from './DefaultAvatar' | ||
|
||
export const Avatar = ({ avatarSrc }: { avatarSrc: string }): JSX.Element => { | ||
return ( | ||
<div className="w-full h-full rounded-full text-2xl md:text-4xl text-center xs:w-10 xs:h-10"> | ||
{avatarSrc !== '' ? ( | ||
<figure | ||
className={ | ||
'flex justify-center items-center rounded-full text-white w-6 h-6 text-sm relative xs:w-full xs:h-full xs:text-xl' | ||
} | ||
> | ||
<img | ||
src={avatarSrc} | ||
alt="Bot avatar" | ||
className="rounded-full object-cover w-full h-full" | ||
/> | ||
</figure> | ||
) : ( | ||
<DefaultAvatar /> | ||
)} | ||
</div> | ||
) | ||
} |
Oops, something went wrong.
d2ac13b
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
www.get-typebot.com
typebot.io
landing-page-v2-git-main-typebot-io.vercel.app
landing-page-v2-typebot-io.vercel.app
www.typebot.io
get-typebot.com
d2ac13b
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:
docs – ./apps/docs
docs.typebot.io
docs-typebot-io.vercel.app
docs-git-main-typebot-io.vercel.app
d2ac13b
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
d2ac13b
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
typebot-viewer.vercel.app
viewer-v2-typebot-io.vercel.app
viewer-v2-git-main-typebot-io.vercel.app