feat(dashboard): 🚸 Add version number in settings modal
This commit is contained in:
@ -12,7 +12,7 @@ import { useUser } from 'contexts/UserContext'
|
|||||||
import { GraphNavigation } from 'db'
|
import { GraphNavigation } from 'db'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
export const EditorSettings = () => {
|
export const EditorSettingsForm = () => {
|
||||||
const { user, saveUser } = useUser()
|
const { user, saveUser } = useUser()
|
||||||
const [value, setValue] = useState<string>(
|
const [value, setValue] = useState<string>(
|
||||||
user?.graphNavigation ?? GraphNavigation.TRACKPAD
|
user?.graphNavigation ?? GraphNavigation.TRACKPAD
|
@ -21,7 +21,7 @@ import { useState } from 'react'
|
|||||||
import { BillingForm } from './BillingForm'
|
import { BillingForm } from './BillingForm'
|
||||||
import { MembersList } from './MembersList'
|
import { MembersList } from './MembersList'
|
||||||
import { MyAccountForm } from './MyAccountForm'
|
import { MyAccountForm } from './MyAccountForm'
|
||||||
import { EditorSettings } from './UserSettingsForm'
|
import { EditorSettingsForm } from './EditorSettingsForm'
|
||||||
import { WorkspaceSettingsForm } from './WorkspaceSettingsForm'
|
import { WorkspaceSettingsForm } from './WorkspaceSettingsForm'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@ -51,86 +51,102 @@ export const WorkspaceSettingsModal = ({
|
|||||||
<Modal isOpen={isOpen} onClose={onClose} size="4xl">
|
<Modal isOpen={isOpen} onClose={onClose} size="4xl">
|
||||||
<ModalOverlay />
|
<ModalOverlay />
|
||||||
<ModalContent h="600px" flexDir="row">
|
<ModalContent h="600px" flexDir="row">
|
||||||
<Stack spacing={8} w="250px" py="6" borderRightWidth={1} h="full">
|
<Stack
|
||||||
<Stack>
|
spacing={8}
|
||||||
<Text pl="4" color="gray.500">
|
w="250px"
|
||||||
{user.email}
|
py="6"
|
||||||
</Text>
|
borderRightWidth={1}
|
||||||
<Button
|
h="full"
|
||||||
variant={selectedTab === 'my-account' ? 'solid' : 'ghost'}
|
justifyContent="space-between"
|
||||||
onClick={() => setSelectedTab('my-account')}
|
>
|
||||||
leftIcon={
|
<Stack spacing={8}>
|
||||||
<Avatar
|
<Stack>
|
||||||
name={user.name ?? undefined}
|
<Text pl="4" color="gray.500">
|
||||||
src={user.image ?? undefined}
|
{user.email}
|
||||||
boxSize="15px"
|
</Text>
|
||||||
/>
|
|
||||||
}
|
|
||||||
size="sm"
|
|
||||||
justifyContent="flex-start"
|
|
||||||
pl="4"
|
|
||||||
>
|
|
||||||
My account
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
variant={selectedTab === 'user-settings' ? 'solid' : 'ghost'}
|
|
||||||
onClick={() => setSelectedTab('user-settings')}
|
|
||||||
leftIcon={<SettingsIcon />}
|
|
||||||
size="sm"
|
|
||||||
justifyContent="flex-start"
|
|
||||||
pl="4"
|
|
||||||
>
|
|
||||||
Preferences
|
|
||||||
</Button>
|
|
||||||
</Stack>
|
|
||||||
<Stack>
|
|
||||||
<Text pl="4" color="gray.500">
|
|
||||||
Workspace
|
|
||||||
</Text>
|
|
||||||
{canEdit && (
|
|
||||||
<Button
|
<Button
|
||||||
variant={
|
variant={selectedTab === 'my-account' ? 'solid' : 'ghost'}
|
||||||
selectedTab === 'workspace-settings' ? 'solid' : 'ghost'
|
onClick={() => setSelectedTab('my-account')}
|
||||||
}
|
|
||||||
onClick={() => setSelectedTab('workspace-settings')}
|
|
||||||
leftIcon={
|
leftIcon={
|
||||||
<EmojiOrImageIcon
|
<Avatar
|
||||||
icon={workspace.icon}
|
name={user.name ?? undefined}
|
||||||
|
src={user.image ?? undefined}
|
||||||
boxSize="15px"
|
boxSize="15px"
|
||||||
defaultIcon={HardDriveIcon}
|
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
size="sm"
|
size="sm"
|
||||||
justifyContent="flex-start"
|
justifyContent="flex-start"
|
||||||
pl="4"
|
pl="4"
|
||||||
>
|
>
|
||||||
Settings
|
My account
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
|
||||||
<Button
|
|
||||||
variant={selectedTab === 'members' ? 'solid' : 'ghost'}
|
|
||||||
onClick={() => setSelectedTab('members')}
|
|
||||||
leftIcon={<UsersIcon />}
|
|
||||||
size="sm"
|
|
||||||
justifyContent="flex-start"
|
|
||||||
pl="4"
|
|
||||||
>
|
|
||||||
Members
|
|
||||||
</Button>
|
|
||||||
{canEdit && (
|
|
||||||
<Button
|
<Button
|
||||||
variant={selectedTab === 'billing' ? 'solid' : 'ghost'}
|
variant={selectedTab === 'user-settings' ? 'solid' : 'ghost'}
|
||||||
onClick={() => setSelectedTab('billing')}
|
onClick={() => setSelectedTab('user-settings')}
|
||||||
leftIcon={<CreditCardIcon />}
|
leftIcon={<SettingsIcon />}
|
||||||
size="sm"
|
size="sm"
|
||||||
justifyContent="flex-start"
|
justifyContent="flex-start"
|
||||||
pl="4"
|
pl="4"
|
||||||
>
|
>
|
||||||
Billing
|
Preferences
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
</Stack>
|
||||||
|
<Stack>
|
||||||
|
<Text pl="4" color="gray.500">
|
||||||
|
Workspace
|
||||||
|
</Text>
|
||||||
|
{canEdit && (
|
||||||
|
<Button
|
||||||
|
variant={
|
||||||
|
selectedTab === 'workspace-settings' ? 'solid' : 'ghost'
|
||||||
|
}
|
||||||
|
onClick={() => setSelectedTab('workspace-settings')}
|
||||||
|
leftIcon={
|
||||||
|
<EmojiOrImageIcon
|
||||||
|
icon={workspace.icon}
|
||||||
|
boxSize="15px"
|
||||||
|
defaultIcon={HardDriveIcon}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
size="sm"
|
||||||
|
justifyContent="flex-start"
|
||||||
|
pl="4"
|
||||||
|
>
|
||||||
|
Settings
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
<Button
|
||||||
|
variant={selectedTab === 'members' ? 'solid' : 'ghost'}
|
||||||
|
onClick={() => setSelectedTab('members')}
|
||||||
|
leftIcon={<UsersIcon />}
|
||||||
|
size="sm"
|
||||||
|
justifyContent="flex-start"
|
||||||
|
pl="4"
|
||||||
|
>
|
||||||
|
Members
|
||||||
|
</Button>
|
||||||
|
{canEdit && (
|
||||||
|
<Button
|
||||||
|
variant={selectedTab === 'billing' ? 'solid' : 'ghost'}
|
||||||
|
onClick={() => setSelectedTab('billing')}
|
||||||
|
leftIcon={<CreditCardIcon />}
|
||||||
|
size="sm"
|
||||||
|
justifyContent="flex-start"
|
||||||
|
pl="4"
|
||||||
|
>
|
||||||
|
Billing
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
|
<Flex justify="center" pt="10">
|
||||||
|
<Text color="gray.500" fontSize="xs">
|
||||||
|
Version: 2.5.0
|
||||||
|
</Text>
|
||||||
|
</Flex>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
{isOpen && (
|
{isOpen && (
|
||||||
<Flex flex="1" p="10">
|
<Flex flex="1" p="10">
|
||||||
<SettingsContent tab={selectedTab} onClose={onClose} />
|
<SettingsContent tab={selectedTab} onClose={onClose} />
|
||||||
@ -152,7 +168,7 @@ const SettingsContent = ({
|
|||||||
case 'my-account':
|
case 'my-account':
|
||||||
return <MyAccountForm />
|
return <MyAccountForm />
|
||||||
case 'user-settings':
|
case 'user-settings':
|
||||||
return <EditorSettings />
|
return <EditorSettingsForm />
|
||||||
case 'workspace-settings':
|
case 'workspace-settings':
|
||||||
return <WorkspaceSettingsForm onClose={onClose} />
|
return <WorkspaceSettingsForm onClose={onClose} />
|
||||||
case 'members':
|
case 'members':
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
ModalContent,
|
ModalContent,
|
||||||
ModalOverlay,
|
ModalOverlay,
|
||||||
} from '@chakra-ui/react'
|
} from '@chakra-ui/react'
|
||||||
import { EditorSettings } from 'components/dashboard/WorkspaceSettingsModal/UserSettingsForm'
|
import { EditorSettingsForm } from 'components/dashboard/WorkspaceSettingsModal/EditorSettingsForm'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@ -20,7 +20,7 @@ export const EditorSettingsModal = ({ isOpen, onClose }: Props) => {
|
|||||||
<ModalContent>
|
<ModalContent>
|
||||||
<ModalCloseButton />
|
<ModalCloseButton />
|
||||||
<ModalBody pt="12" pb="8" px="8">
|
<ModalBody pt="12" pb="8" px="8">
|
||||||
<EditorSettings />
|
<EditorSettingsForm />
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "2.3.0",
|
"version": "2.5.0",
|
||||||
"name": "typebot-os",
|
"name": "typebot-os",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
|
Reference in New Issue
Block a user