This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
forked from ztjhz/BetterChatGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pr-299-chat-branches-called-versioned-refreshes-by-pr-a…
…uthor'
- Loading branch information
Showing
25 changed files
with
463 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/components/Chat/ChatContent/Message/Button/BaseButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
|
||
const BaseButton = ({ | ||
onClick, | ||
icon, | ||
disabled = false, | ||
}: { | ||
onClick: React.MouseEventHandler<HTMLButtonElement>; | ||
icon: React.ReactElement; | ||
disabled?: boolean; | ||
}) => { | ||
return ( | ||
<div className='text-gray-400 flex self-end lg:self-center justify-center gap-3 md:gap-4 visible'> | ||
<button | ||
className={`p-1 rounded-md dark:text-gray-400 md:invisible md:group-hover:visible ${ | ||
disabled | ||
? 'disabled:dark:hover:text-gray-400 cursor-default' | ||
: 'hover:bg-gray-100 hover:text-gray-700 dark:hover:bg-gray-700 dark:hover:text-gray-200' | ||
}`} | ||
onClick={disabled ? () => {} : onClick} | ||
disabled={disabled} | ||
> | ||
{icon} | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default BaseButton; |
23 changes: 23 additions & 0 deletions
23
src/components/Chat/ChatContent/Message/Button/LeftButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
|
||
import DownChevronArrow from '@icon/DownChevronArrow'; | ||
|
||
import BaseButton from './BaseButton'; | ||
|
||
const LeftButton = ({ | ||
disabled, | ||
onClick, | ||
}: { | ||
disabled: boolean; | ||
onClick: React.MouseEventHandler<HTMLButtonElement>; | ||
}) => { | ||
return ( | ||
<BaseButton | ||
icon={<DownChevronArrow className='rotate-90 m-1' />} | ||
disabled={disabled} | ||
onClick={onClick} | ||
/> | ||
); | ||
}; | ||
|
||
export default LeftButton; |
27 changes: 27 additions & 0 deletions
27
src/components/Chat/ChatContent/Message/Button/RightButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
|
||
import DownChevronArrow from '@icon/DownChevronArrow'; | ||
|
||
import BaseButton from './BaseButton'; | ||
|
||
const RightButton = ({ | ||
disabled, | ||
onClick, | ||
}: { | ||
disabled: boolean; | ||
onClick: React.MouseEventHandler<HTMLButtonElement>; | ||
}) => { | ||
return ( | ||
<BaseButton | ||
icon={ | ||
<DownChevronArrow | ||
className='rotate-[270deg] m-1' | ||
/> | ||
} | ||
disabled={disabled} | ||
onClick={onClick} | ||
/> | ||
); | ||
}; | ||
|
||
export default RightButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.