Skip to content

Commit 420f517

Browse files
authored
Update @radix-ui/themes to v3 (#63)
1 parent 2d8939d commit 420f517

File tree

11 files changed

+765
-770
lines changed

11 files changed

+765
-770
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ For OpenAI account:
7979
| Name | Description | Default Value |
8080
| ------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------ |
8181
| OPENAI_API_BASE_URL | Use if you plan to use a reverse proxy for `api.openai.com`. | `https://api.openai.com` |
82-
| OPENAI_API_KEY | Secret key string obtained from the [OpenAI API website](https://platform.openai.com/account/api-keys). |
82+
| OPENAI_API_KEY | Secret key string obtained from the [OpenAI API website](https://platform.openai.com/account/api-keys). | |
8383
| OPENAI_MODEL | Model of GPT used | `gpt-3.5-turbo` |
8484

8585
For Azure OpenAI account:
8686

87-
| Name | Description |
88-
| ------------------------- | ---------------------------------------------- |
89-
| AZURE_OPENAI_API_BASE_URL | Endpoint (e.g., https://xxx.openai.azure.com). |
90-
| AZURE_OPENAI_API_KEY | Key |
91-
| AZURE_OPENAI_DEPLOYMENT | Model deployment name |
87+
| Name | Description |
88+
| ------------------------- | ------------------------------------------------ |
89+
| AZURE_OPENAI_API_BASE_URL | Endpoint (e.g., <https://xxx.openai.azure.com>). |
90+
| AZURE_OPENAI_API_KEY | Key |
91+
| AZURE_OPENAI_DEPLOYMENT | Model deployment name |
9292

9393
## Contribution
9494

README.zh-CN.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ OpenAI账户环境变量:
7979
| 名称 | 描述 | 默认值 |
8080
| ------------------- | ---------------------------------------------------------------------------------- | ------------------------ |
8181
| OPENAI_API_BASE_URL | 如需为`api.openai.com`使用反向代理,请使用此变量。 | `https://api.openai.com` |
82-
| OPENAI_API_KEY |[OpenAI API网站](https://platform.openai.com/account/api-keys)获取的密钥字符串。 |
82+
| OPENAI_API_KEY |[OpenAI API网站](https://platform.openai.com/account/api-keys)获取的密钥字符串。 | |
8383
| OPENAI_MODEL | GPT模型 | `gpt-3.5-turbo` |
8484

8585
Azure OpenAI账户环境变量:
8686

87-
| 名称 | 描述 |
88-
| ------------------------- | ------------------------------------------ |
89-
| AZURE_OPENAI_API_BASE_URL | 端点(如,https://xxx.openai.azure.com)。 |
90-
| AZURE_OPENAI_API_KEY | 密钥 |
91-
| AZURE_OPENAI_DEPLOYMENT | 模型部署名称 |
87+
| 名称 | 描述 |
88+
| ------------------------- | -------------------------------------------- |
89+
| AZURE_OPENAI_API_BASE_URL | 端点(如,<https://xxx.openai.azure.com)。> |
90+
| AZURE_OPENAI_API_KEY | 密钥 |
91+
| AZURE_OPENAI_DEPLOYMENT | 模型部署名称 |
9292

9393
## 贡献
9494

app/chat/PersonaModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const PersonaModal = () => {
3131
<Dialog.Description size="2" mb="4"></Dialog.Description>
3232
<form onSubmit={formSubmit}>
3333
<Flex direction="column" gap="3">
34-
<TextField.Input placeholder="Name" {...register('name', { required: true })} />
34+
<TextField.Root placeholder="Name" {...register('name', { required: true })} />
3535
<TextArea placeholder="Prompt" rows={7} {...register('prompt', { required: true })} />
3636
</Flex>
3737
<Flex gap="3" mt="4" justify="end">

app/chat/PersonaPanel.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const PersonaPanel = (_props: PersonaPanelProps) => {
6565
width="100%"
6666
height="100%"
6767
className="absolute top-0 z-10 flex-1"
68-
style={{ backgroundColor: 'var(--color-page-background)' }}
68+
style={{ backgroundColor: 'var(--color-background)' }}
6969
>
7070
<Flex
7171
justify="between"
@@ -87,17 +87,18 @@ const PersonaPanel = (_props: PersonaPanelProps) => {
8787
</Flex>
8888
<Container size="3" className="grow-0 px-4">
8989
<Flex gap="4" py="5">
90-
<TextField.Root size="3" className="flex-1" radius="large">
90+
<TextField.Root
91+
size="3"
92+
className="flex-1"
93+
radius="large"
94+
placeholder="Search Persona Template"
95+
onChange={({ target }) => {
96+
setSearchText(target.value)
97+
}}
98+
>
9199
<TextField.Slot>
92100
<MagnifyingGlassIcon height="16" width="16" />
93101
</TextField.Slot>
94-
<TextField.Input
95-
className="flex-1"
96-
placeholder="Search Persona Template"
97-
onChange={({ target }) => {
98-
setSearchText(target.value)
99-
}}
100-
/>
101102
</TextField.Root>
102103
<Button size="3" radius="large" variant="surface" onClick={onOpenPersonaModal}>
103104
Create

app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const metadata = {
2020

2121
export default function RootLayout({ children }: { children: React.ReactNode }) {
2222
return (
23-
<html lang="en" suppressHydrationWarning>
23+
<html lang="en">
2424
<body>
2525
<ThemesProvider>
2626
<Header />

components/Chat/ChatSideBar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const ChatSideBar = () => {
2424
} = useContext(ChatContext)
2525

2626
return (
27-
<Flex direction="column" className={cs('chart-side-bar', { show: toggleSidebar })}>
27+
<Flex direction="column" className={cs('chat-side-bar', { show: toggleSidebar })}>
2828
<Flex className="p-2 h-full overflow-hidden w-64" direction="column" gap="3">
2929
<Box
3030
width="auto"
@@ -34,7 +34,7 @@ export const ChatSideBar = () => {
3434
<FiPlus className="size-4" />
3535
<Text>New Chat</Text>
3636
</Box>
37-
<ScrollArea className="flex-1" type="auto" scrollbars="vertical">
37+
<ScrollArea className="flex-1 " style={{ width: '100%' }} type="auto">
3838
<Flex direction="column" gap="3">
3939
{chatList.map((chat) => (
4040
<Box
@@ -45,7 +45,7 @@ export const ChatSideBar = () => {
4545
})}
4646
onClick={() => onChangeChat?.(chat)}
4747
>
48-
<Flex gap="2" align="center">
48+
<Flex gap="2" align="center" className="overflow-hidden whitespace-nowrap">
4949
<BiMessageDetail className="size-4" />
5050
<Text as="p" className="truncate">
5151
{chat.persona?.name}

components/Chat/index.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
}
1414

15-
.chart-side-bar {
15+
.chat-side-bar {
1616
@apply overflow-hidden w-64 z-10;
1717

1818
background-color: var(--color-background);
@@ -22,6 +22,7 @@
2222

2323
.rt-ScrollAreaViewport > div {
2424
display: block;
25+
width: 100%;
2526
}
2627

2728
> div {

components/Link.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { GetPropDefTypes, Link as RadixLink, linkPropDefs } from '@radix-ui/themes'
1+
import { ComponentProps } from 'react'
2+
import { Link as RadixLink } from '@radix-ui/themes'
23
import NextLink from 'next/link'
34

4-
type LinkOwnProps = GetPropDefTypes<typeof linkPropDefs>
5+
type LinkOwnProps = ComponentProps<typeof RadixLink>
56

67
interface LinkProps {
78
href: string

0 commit comments

Comments
 (0)