Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add chat type settings to the header. #78

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/components/header/ConversationMessageSettingButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { useStore } from '@nanostores/solid'
import { showConversationEditModal } from '@/stores/ui'
import { currentConversationId } from '@/stores/conversation'

export default () => {
// Retrieve the current conversation ID from the store
const $currentConversationId = useStore(currentConversationId)

return (
<>
{/* Render the following code if the current conversation ID exists */}
{$currentConversationId() && (
<div
class="fcc p-2 rounded-md text-xl hv-foreground"
onClick={() => { showConversationEditModal.set(true) }}
>
{/* Render the carbon settings adjust icon */}
<div i-carbon-settings-adjust />
</div>
)}
</>
)
}
2 changes: 2 additions & 0 deletions src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useLargeScreen } from '@/hooks'
import ConversationHeaderInfo from './ConversationHeaderInfo'
import ConversationMessageClearButton from './ConversationMessageClearButton'
import ConversationMessageShareButton from './ConversationMessageShareButton'
import ConversationMessageSettingButton from './ConversationMessageSettingButton'

export default () => {
onMount(() => {
Expand All @@ -25,6 +26,7 @@ export default () => {
<ConversationHeaderInfo />
</div>
<div class="fi gap-1 overflow-hidden">
<ConversationMessageSettingButton />
<ConversationMessageClearButton />
<ConversationMessageShareButton />
<div
Expand Down
Loading