Skip to content

Commit f2f4d55

Browse files
committed
fix(navbar): fix input
1 parent fec4d79 commit f2f4d55

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

app/src/components/ui/navbar.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import {
44
Text,
55
} from '@react-three/uikit'
66
import { Button, Defaults, Input } from '@react-three/uikit-default'
7-
import { GithubIcon, MoonIcon, SettingsIcon, SunIcon } from '@react-three/uikit-lucide'
7+
import { GithubIcon, MoonIcon, SendIcon, SettingsIcon, SunIcon } from '@react-three/uikit-lucide'
88
import { IfInSessionMode, useXRStore } from '@react-three/xr'
9+
import { useState } from 'react'
910

1011
import { useIsDarkValue, useToggleIsDark } from '~/hooks/use-is-dark'
1112
import { useNavigate } from '~/router'
@@ -19,6 +20,7 @@ export const Navbar = () => {
1920
const navigate = useNavigate()
2021
const isDark = useIsDarkValue()
2122
const toggleIsDark = useToggleIsDark()
23+
const [value, setValue] = useState('')
2224

2325
return (
2426
<IfInSessionMode deny={['immersive-ar', 'immersive-vr']}>
@@ -31,7 +33,23 @@ export const Navbar = () => {
3133
pointerEvents="listener"
3234
>
3335
<Container flexDirection="column" gap={8} lg={{ flexDirection: 'row' }}>
34-
<Input marginX="auto" maxWidth={288} placeholder="Send message..." />
36+
<Container gap={8} justifyContent="center">
37+
<Input
38+
marginX="auto"
39+
maxWidth={284}
40+
onValueChange={value => setValue(value)}
41+
placeholder="Write a message..."
42+
value={value}
43+
/>
44+
<Button
45+
data-test-id="send-message"
46+
onClick={() => setValue('')}
47+
size="icon"
48+
variant="secondary"
49+
>
50+
<SendIcon height={16} width={16} />
51+
</Button>
52+
</Container>
3553
<Container gap={8} justifyContent="center">
3654
<Button
3755
data-test-id="enter-vr"

0 commit comments

Comments
 (0)