changes
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
|||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
TextInput,
|
TextInput,
|
||||||
|
TextInputProps,
|
||||||
Title,
|
Title,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
UnstyledButton,
|
UnstyledButton,
|
||||||
@@ -48,6 +49,25 @@ interface Chat {
|
|||||||
messages?: Message[];
|
messages?: Message[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function InputWithButton(props: TextInputProps) {
|
||||||
|
const theme = useMantineTheme();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TextInput
|
||||||
|
radius="xl"
|
||||||
|
size="md"
|
||||||
|
placeholder="Type your message..."
|
||||||
|
rightSectionWidth={42}
|
||||||
|
rightSection={
|
||||||
|
<ActionIcon size={32} radius="xl" color={theme.primaryColor} variant="filled">
|
||||||
|
<IconSend size={18} stroke={1.5} />
|
||||||
|
</ActionIcon>
|
||||||
|
}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default function ChatLayout() {
|
export default function ChatLayout() {
|
||||||
const [mobileOpened, { toggle: toggleMobile }] = useDisclosure();
|
const [mobileOpened, { toggle: toggleMobile }] = useDisclosure();
|
||||||
const [desktopOpened, { toggle: toggleDesktop }] = useDisclosure(true);
|
const [desktopOpened, { toggle: toggleDesktop }] = useDisclosure(true);
|
||||||
@@ -342,8 +362,7 @@ export default function ChatLayout() {
|
|||||||
borderColor: isInputFocused ? theme.colors[primaryColor][6] : undefined,
|
borderColor: isInputFocused ? theme.colors[primaryColor][6] : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Group gap="xs">
|
<InputWithButton
|
||||||
<TextInput
|
|
||||||
variant="unstyled"
|
variant="unstyled"
|
||||||
placeholder="Type your message..."
|
placeholder="Type your message..."
|
||||||
value={inputValue}
|
value={inputValue}
|
||||||
@@ -352,19 +371,19 @@ export default function ChatLayout() {
|
|||||||
onFocus={() => setIsInputFocused(true)}
|
onFocus={() => setIsInputFocused(true)}
|
||||||
onBlur={() => setIsInputFocused(false)}
|
onBlur={() => setIsInputFocused(false)}
|
||||||
style={{ flex: 1, paddingLeft: rem(10) }}
|
style={{ flex: 1, paddingLeft: rem(10) }}
|
||||||
size="md"
|
rightSection={
|
||||||
/>
|
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
onClick={handleSendMessage}
|
onClick={handleSendMessage}
|
||||||
variant="filled"
|
variant="filled"
|
||||||
color={primaryColor}
|
color={primaryColor}
|
||||||
size="lg"
|
size={32}
|
||||||
radius="xl"
|
radius="xl"
|
||||||
disabled={!inputValue.trim()}
|
disabled={!inputValue.trim()}
|
||||||
>
|
>
|
||||||
<IconSend size={18} />
|
<IconSend size={18} />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Group>
|
}
|
||||||
|
/>
|
||||||
</Paper>
|
</Paper>
|
||||||
</Container>
|
</Container>
|
||||||
</AppShell.Main>
|
</AppShell.Main>
|
||||||
|
|||||||
Reference in New Issue
Block a user