Skip to content

Commit

Permalink
feat: add chat type settings to the header. (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
chancelyg authored Jul 3, 2023
1 parent 4d9ee64 commit 071158c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
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

0 comments on commit 071158c

Please sign in to comment.