-
-
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): better UI/UX on select brain (#2288)
# 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
26 changed files
with
105 additions
and
208 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.../[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/ChatEditor.tsx
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
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
...s/ChatInput/components/ChatEditor/Editor/MentionsList/MentionItem/MentionItem.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,24 @@ | ||
@use "@/styles/Colors.module.scss"; | ||
@use "@/styles/Radius.module.scss"; | ||
@use "@/styles/Spacings.module.scss"; | ||
@use "@/styles/Typography.module.scss"; | ||
|
||
.mention_item_wrapper { | ||
display: flex; | ||
cursor: pointer; | ||
gap: Spacings.$spacing03; | ||
align-items: center; | ||
border-radius: Radius.$normal; | ||
overflow: hidden; | ||
padding: Spacings.$spacing02; | ||
|
||
&:hover, | ||
&.selected { | ||
background-color: Colors.$primary-light; | ||
font-weight: 550; | ||
} | ||
|
||
.brain_name { | ||
@include Typography.EllipsisOverflow; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...omponents/ChatInput/components/ChatEditor/Editor/MentionsList/MentionItem/MentionItem.tsx
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,37 @@ | ||
import Image from "next/image"; | ||
|
||
import Icon from "@/lib/components/ui/Icon/Icon"; | ||
|
||
import styles from "./MentionItem.module.scss"; | ||
|
||
import { SuggestionDataType, SuggestionItem } from "../../types"; | ||
|
||
type MentionItemProps = { | ||
item: SuggestionItem; | ||
type: SuggestionDataType; | ||
isSelected: boolean; | ||
onClick: () => void; | ||
}; | ||
|
||
export const MentionItem = ({ | ||
item, | ||
onClick, | ||
isSelected, | ||
}: MentionItemProps): JSX.Element => { | ||
return ( | ||
<span | ||
className={`${styles.mention_item_wrapper} ${ | ||
isSelected ? styles.selected : "" | ||
}`} | ||
key={item.id} | ||
onClick={onClick} | ||
> | ||
{item.iconUrl ? ( | ||
<Image src={item.iconUrl} width={18} height={18} alt="logo_url" /> | ||
) : ( | ||
<Icon color="primary" size="normal" name="brain" /> | ||
)} | ||
<span className={styles.brain_name}>{item.label}</span> | ||
</span> | ||
); | ||
}; |
23 changes: 23 additions & 0 deletions
23
...r/components/ChatInput/components/ChatEditor/Editor/MentionsList/MentionsList.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,23 @@ | ||
@use "@/styles/Colors.module.scss"; | ||
@use "@/styles/Radius.module.scss"; | ||
@use "@/styles/Spacings.module.scss"; | ||
|
||
.mentions_list_wrapper { | ||
display: flex; | ||
background-color: Colors.$white; | ||
flex-direction: column; | ||
padding: Spacings.$spacing03; | ||
box-shadow: 0 1px 2px rgb(0, 0, 0, 0.25); | ||
border-radius: Radius.$normal; | ||
gap: Spacings.$spacing03; | ||
max-width: 300px; | ||
position: relative; | ||
overflow: hidden; | ||
|
||
.mentions_list { | ||
overflow: hidden; | ||
display: flex; | ||
flex-direction: column; | ||
gap: Spacings.$spacing02; | ||
} | ||
} |
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...s/Editor/components/MentionsList/types.ts → ...s/ChatEditor/Editor/MentionsList/types.ts
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions
22
...ts/ChatEditor/components/Editor/components/MentionsList/components/AddNewPromptButton.tsx
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
...atEditor/components/Editor/components/MentionsList/components/MentionItem/MentionItem.tsx
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
...ponents/Editor/components/MentionsList/components/MentionItem/hooks/useMentionItemIcon.ts
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
...atEditor/components/Editor/components/MentionsList/hooks/useSuggestionsOverflowHandler.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.