Skip to content

Commit

Permalink
update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
1997roylee committed Feb 17, 2023
1 parent 9b8e8a8 commit 1332d9d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 30 deletions.
11 changes: 9 additions & 2 deletions src/components/ChatApp/ChatApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ export const ChatApp = ({ onClose }: Props): JSX.Element => {
width: 370,
height: 660,
position: 'fixed',
zIndex: 99999,
bottom: 0,
right: 24,
right: 6,
background: '#fff',
// position: 'relative',
borderRadius: '24px 24px 0px 0px',
'--shadow-1': 'rgba(0, 0, 0, 0.1)',
'--shadow-2': 'rgba(0, 0, 0, 0.2)',
Expand All @@ -53,7 +55,12 @@ export const ChatApp = ({ onClose }: Props): JSX.Element => {
>
<Header onClose={onClose} />
<FancyMessagePanel />
<Box sx={{ position: 'relative', paddingTop: 16, borderTop: '1px solid #eee' }}>
<Box
left={0}
right={0}
bottom={0}
sx={{ position: 'absolute', paddingTop: 1, borderTop: '1px solid #eee' }}
>
<MessageInput />
<Copyright />
</Box>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ChatApp/Copyright.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Box, Text } from "@chakra-ui/react"
import { Box, Text } from '@chakra-ui/react'

export const Copyright = (): JSX.Element => {
return (
<Box sx={{ paddingTop: 4, paddingBottom: 4 }}>
<Box sx={{ paddingTop: 1, paddingBottom: 1 }}>
<Text
fontSize={14}
align='center'
Expand Down
8 changes: 4 additions & 4 deletions src/components/ChatApp/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, CloseButton, Flex, Text } from '@chakra-ui/react'
import { AppState, useAppStore } from '../../stores'
import { OpenAi } from '../OpenAI'
import { OpenAI } from '../OpenAI'

interface Props {
onClose?: () => void
Expand All @@ -14,13 +14,13 @@ export const Header = ({ onClose }: Props): JSX.Element => {
return (
<Box
sx={{
padding: 16,
padding: 4,
borderBottom: '1px solid #eee',
}}
>
<Flex align={'center'}>
<Box w={32} h={32} mr={16}>
<OpenAi w={32} h={32} />
<Box w={8} h={8} mr={4}>
<OpenAI w={8} h={8} />
{/* <Image w={32} h={32} src={Openai} alt='Openai' /> */}
</Box>
<Box>
Expand Down
13 changes: 4 additions & 9 deletions src/components/ChatApp/MessageBox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box, Flex, Text } from '@chakra-ui/react'
import { OpenAi } from '../OpenAI'
import { OpenAI } from '../OpenAI'

interface Props {
isMe?: boolean
Expand All @@ -8,15 +8,10 @@ interface Props {

export const MessageBox = ({ isMe = false, message = '' }: Props): JSX.Element => {
return (
<Box bg={isMe ? '#eee' : '#fff'} p={12} w='auto'>
<Box bg={isMe ? '#eee' : '#fff'} p={3} w='auto'>
<Flex w='100%'>
<Box
sx={{
width: 24,
}}
mr={12}
>
{!isMe ? <OpenAi w={24} /> : null}
<Box w={'28px'} mr={1}>
{!isMe ? <OpenAI w={6} /> : null}
</Box>
<Box
sx={{
Expand Down
4 changes: 2 additions & 2 deletions src/components/ChatApp/MessagePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const MessagePanel = (): JSX.Element => {
sx={{
flex: 1,
overflowY: 'scroll',
paddingBottom: 40,
paddingBottom: 10,
}}
>
<Box>
Expand All @@ -36,7 +36,7 @@ export const MessagePanel = (): JSX.Element => {
<MessageBox isMe={message.sender === 'me'} message={message.text} />
)}

{index < getMessageList().length - 1 && <Divider color='#eee' />}
{index < getMessageList().length - 1 && <Divider my={0} color='#eee' />}
</Box>
)
})}
Expand Down
11 changes: 0 additions & 11 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

0 comments on commit 1332d9d

Please sign in to comment.