2
0

⚗️ Implement bot v2 MVP (#194)

Closes #190
This commit is contained in:
Baptiste Arnaud
2022-12-22 17:02:34 +01:00
committed by GitHub
parent e55823e011
commit 1a3869ae6d
202 changed files with 8060 additions and 1152 deletions

View File

@ -1,7 +1,6 @@
import {
createContext,
ReactNode,
useCallback,
useContext,
useEffect,
useMemo,
@ -26,6 +25,7 @@ const workspaceContext = createContext<{
updateWorkspace: (updates: { icon?: string; name?: string }) => void
deleteCurrentWorkspace: () => Promise<void>
refreshWorkspace: () => void
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
}>({})
@ -59,12 +59,12 @@ export const WorkspaceProvider = ({
)
const { data: workspaceData } = trpc.workspace.getWorkspace.useQuery(
{ workspaceId: workspaceId! },
{ workspaceId: workspaceId as string },
{ enabled: !!workspaceId }
)
const { data: membersData } = trpc.workspace.listMembersInWorkspace.useQuery(
{ workspaceId: workspaceId! },
{ workspaceId: workspaceId as string },
{ enabled: !!workspaceId }
)

View File

@ -15,7 +15,7 @@ import {
UsersIcon,
} from '@/components/icons'
import { EmojiOrImageIcon } from '@/components/EmojiOrImageIcon'
import { GraphNavigation, User, Workspace, WorkspaceRole } from 'db'
import { User, Workspace, WorkspaceRole } from 'db'
import { useState } from 'react'
import { MembersList } from './MembersList'
import { WorkspaceSettingsForm } from './WorkspaceSettingsForm'
@ -149,13 +149,7 @@ export const WorkspaceSettingsModal = ({
{isOpen && (
<Flex flex="1" p="10">
<SettingsContent
tab={selectedTab}
onClose={onClose}
defaultGraphNavigation={
user.graphNavigation ?? GraphNavigation.TRACKPAD
}
/>
<SettingsContent tab={selectedTab} onClose={onClose} />
</Flex>
)}
</ModalContent>
@ -165,11 +159,9 @@ export const WorkspaceSettingsModal = ({
const SettingsContent = ({
tab,
defaultGraphNavigation,
onClose,
}: {
tab: SettingsTab
defaultGraphNavigation: GraphNavigation
onClose: () => void
}) => {
switch (tab) {