Skip to content

Commit

Permalink
Merge pull request #8 from anse-app/main
Browse files Browse the repository at this point in the history
feat: add chat type settings to the header. (anse-app#78)
  • Loading branch information
hisune committed Jul 3, 2023
2 parents 56330b4 + 071158c commit 43eb8a0
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 43eb8a0

Please sign in to comment.