Skip to content

Commit

Permalink
Fix button location
Browse files Browse the repository at this point in the history
  • Loading branch information
nygrenh committed Sep 30, 2024
1 parent 95118f2 commit 2c4b3d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from "@emotion/css"
import { css, cx } from "@emotion/css"
import { UseQueryResult } from "@tanstack/react-query"
import { Account, AddMessage } from "@vectopus/atlas-icons-react"
import React from "react"
Expand Down Expand Up @@ -59,6 +59,10 @@ const buttonStyle = css`
}
`

const buttonsWrapper = css`
display: flex;
`

const ChatbotDialogHeader: React.FC<ChatbotDialogHeaderProps> = ({
setDialogOpen,
currentConversationInfo,
Expand All @@ -82,7 +86,7 @@ const ChatbotDialogHeader: React.FC<ChatbotDialogHeaderProps> = ({
<Account />
</div>
<h1 className={titleStyle}>{currentConversationInfo.data?.chatbot_name}</h1>
<div>
<div className={buttonsWrapper}>
<button
onClick={() => newConversationMutation.mutate()}
disabled={newConversationMutation.isPending}
Expand All @@ -93,11 +97,13 @@ const ChatbotDialogHeader: React.FC<ChatbotDialogHeaderProps> = ({
</button>
<button
onClick={() => setDialogOpen(false)}
className={css`
${buttonStyle}
position: relative;
top: -3px;
`}
className={cx(
buttonStyle,
css`
position: relative;
top: -3px;
`,
)}
aria-label={t("close")}
>
<DownIcon />
Expand Down
2 changes: 1 addition & 1 deletion services/course-material/src/services/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ export const sendChatbotMessage = async (

const requestOptions: RequestInit = {
method: "POST",
body: JSON.stringify({ message }), // It's better to send an object for clarity
body: JSON.stringify(message),
headers: {
"Content-Type": "application/json",
},
Expand Down

0 comments on commit 2c4b3d4

Please sign in to comment.