-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): display which brain you are talking to (#2137)
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
- Loading branch information
Showing
22 changed files
with
246 additions
and
82 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,5 @@ | |
height: 0; | ||
} | ||
.mention { | ||
background-color: #E0DDFC; | ||
border-radius: 4px; | ||
padding: 2px 4px; | ||
display: none; | ||
} |
22 changes: 22 additions & 0 deletions
22
frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/index.module.scss
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,22 @@ | ||
@use "@/styles/Colors.module.scss"; | ||
@use "@/styles/Radius.module.scss"; | ||
@use "@/styles/Spacings.module.scss"; | ||
|
||
.chat_container { | ||
display: flex; | ||
flex-direction: column; | ||
background-color: Colors.$white; | ||
gap: Spacings.$spacing03; | ||
border-radius: Radius.$big; | ||
border: 1px solid Colors.$lighter-grey; | ||
overflow: hidden; | ||
|
||
.chat_wrapper { | ||
display: flex; | ||
padding: Spacings.$spacing05; | ||
|
||
&.with_brain { | ||
padding-top: 0; | ||
} | ||
} | ||
} |
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
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
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
33 changes: 33 additions & 0 deletions
33
frontend/lib/components/CurrentBrain/CurrentBrain.module.scss
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,33 @@ | ||
@use "@/styles/Colors.module.scss"; | ||
@use "@/styles/Spacings.module.scss"; | ||
@use "@/styles/Typography.module.scss"; | ||
|
||
.current_brain_wrapper { | ||
background-color: Colors.$lightest-grey; | ||
padding-inline: Spacings.$spacing05; | ||
padding-block: Spacings.$spacing01; | ||
font-size: Typography.$small; | ||
color: Colors.$normal-grey; | ||
|
||
.brain_infos { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
.left { | ||
display: flex; | ||
gap: Spacings.$spacing02; | ||
align-items: center; | ||
|
||
.brain_name_wrapper { | ||
display: flex; | ||
gap: Spacings.$spacing02; | ||
align-items: center; | ||
|
||
.brain_name { | ||
color: Colors.$black; | ||
} | ||
} | ||
} | ||
} | ||
} |
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,39 @@ | ||
import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext"; | ||
|
||
import styles from "./CurrentBrain.module.scss"; | ||
|
||
import { Icon } from "../ui/Icon/Icon"; | ||
|
||
export const CurrentBrain = (): JSX.Element => { | ||
const { currentBrain, setCurrentBrainId } = useBrainContext(); | ||
|
||
const removeCurrentBrain = (): void => { | ||
setCurrentBrainId(null); | ||
}; | ||
|
||
if (!currentBrain) { | ||
return <></>; | ||
} | ||
|
||
return ( | ||
<div className={styles.current_brain_wrapper}> | ||
<div className={styles.brain_infos}> | ||
<div className={styles.left}> | ||
<span>Talking to</span> | ||
<div className={styles.brain_name_wrapper}> | ||
<Icon size="small" name="brain" color="primary" /> | ||
<span className={styles.brain_name}>{currentBrain.name}</span> | ||
</div> | ||
</div> | ||
<div | ||
onClick={(event) => { | ||
event.nativeEvent.stopImmediatePropagation(); | ||
removeCurrentBrain(); | ||
}} | ||
> | ||
<Icon size="normal" name="close" color="black" handleHover={true} /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
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
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.