Skip to content

Commit

Permalink
🐛 fix: improve editing width issue (#264)
Browse files Browse the repository at this point in the history
* 🐛 fix: improve editing padding issue

* 🐛 fix: update docs
  • Loading branch information
arvinxx authored Feb 15, 2025
1 parent fcb80ed commit b1b4e5b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/chat/ChatItem/demos/Editing.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ChatItem } from '@lobehub/ui/chat';

import { avatar } from './data';

const data = {
loading: false,
message:
"要使用 dayjs 的 fromNow 函数,需要先安装 dayjs 库并在代码中引入它。然后,可以使用以下语法来获取当前时间与给定时间之间的相对时间:\n\n```javascript\ndayjs().fromNow();\ndayjs('2021-05-01').fromNow();\n```",
time: 1_686_538_950_084,
};
export default () => {
return <ChatItem {...data} avatar={avatar} editing={true} />;
};
2 changes: 1 addition & 1 deletion src/chat/ChatItem/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apiHeader:

## Default

<code src="./demos/index.tsx" nopadding></code>
<code src="./demos/index.tsx" nopadding></code> <code src="./demos/Editing.tsx"></code>

## Alert

Expand Down
2 changes: 1 addition & 1 deletion src/chat/ChatItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const ChatItem = memo<ChatItemProps>(
}
gap={8}
>
<Flexbox>
<Flexbox width={'100%'}>
{error && (message === placeholderMessage || !message) ? (
<ErrorContent error={error} message={errorMessage} placement={placement} />
) : (
Expand Down

0 comments on commit b1b4e5b

Please sign in to comment.