-
-
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): handle mentions in search bar (#2049)
# Description - Handle mentions in search bar - Add a Loader Icon component and use it in Search Bar - Custom Placeholder possible on Editor Component - Remove unused useEditorStateUpdater - Fix Bug when Enter was typed ## 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
12 changed files
with
142 additions
and
166 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
25 changes: 17 additions & 8 deletions
25
...omponents/ChatInput/components/ChatEditor/components/Editor/hooks/useCreateEditorState.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
74 changes: 0 additions & 74 deletions
74
...mponents/ChatInput/components/ChatEditor/components/Editor/hooks/useEditorStateUpdater.ts
This file was deleted.
Oops, something went wrong.
20 changes: 10 additions & 10 deletions
20
...ctionsBar/components/ChatInput/components/MenuControlButton/MenuControlButton.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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
@use '@/styles/Colors.module.scss'; | ||
@use '@/styles/IconSizes.module.scss'; | ||
@use '@/styles/Spacings.module.scss'; | ||
@use "@/styles/Colors.module.scss"; | ||
@use "@/styles/IconSizes.module.scss"; | ||
@use "@/styles/Spacings.module.scss"; | ||
|
||
.menu_icon { | ||
width: IconSizes.$medium; | ||
height: IconSizes.$medium; | ||
cursor: pointer; | ||
width: IconSizes.$large; | ||
height: IconSizes.$large; | ||
cursor: pointer; | ||
|
||
&:hover { | ||
color: Colors.$accent; | ||
} | ||
} | ||
&:hover { | ||
color: Colors.$accent; | ||
} | ||
} |
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
38 changes: 38 additions & 0 deletions
38
frontend/lib/components/ui/LoaderIcon/LoaderIcon.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,38 @@ | ||
@use "@/styles/Colors.module.scss"; | ||
@use "@/styles/IconSizes.module.scss"; | ||
|
||
.loader_icon { | ||
animation: spin 1s linear infinite; | ||
width: IconSizes.$big; | ||
height: IconSizes.$big; | ||
color: Colors.$accent; | ||
|
||
@keyframes spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
&.small { | ||
width: IconSizes.$small; | ||
height: IconSizes.$small; | ||
} | ||
|
||
&.normal { | ||
width: IconSizes.$normal; | ||
height: IconSizes.$normal; | ||
} | ||
|
||
&.large { | ||
width: IconSizes.$large; | ||
height: IconSizes.$large; | ||
} | ||
|
||
&.big { | ||
width: IconSizes.$big; | ||
height: IconSizes.$big; | ||
} | ||
} |
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,17 @@ | ||
import { AiOutlineLoading3Quarters } from "react-icons/ai"; | ||
|
||
import { IconSize } from "@/lib/types/Icons"; | ||
|
||
import styles from "./LoaderIcon.module.scss"; | ||
|
||
interface LoaderIconProps { | ||
size: IconSize; | ||
} | ||
|
||
export const LoaderIcon = (props: LoaderIconProps): JSX.Element => { | ||
return ( | ||
<AiOutlineLoading3Quarters | ||
className={`${styles.loader_icon ?? ""} ${styles[props.size] ?? ""}`} | ||
/> | ||
); | ||
}; |
61 changes: 26 additions & 35 deletions
61
frontend/lib/components/ui/SearchBar/SearchBar.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 |
---|---|---|
@@ -1,41 +1,32 @@ | ||
@use '@/styles/Colors.module.scss'; | ||
@use '@/styles/IconSizes.module.scss'; | ||
@use '@/styles/Spacings.module.scss'; | ||
@use "@/styles/Colors.module.scss"; | ||
@use "@/styles/IconSizes.module.scss"; | ||
@use "@/styles/Spacings.module.scss"; | ||
|
||
.search_bar_wrapper { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: Spacings.$spacing03; | ||
background-color: Colors.$white; | ||
padding: Spacings.$spacing05; | ||
border-radius: 12px; | ||
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: Spacings.$spacing03; | ||
background-color: Colors.$white; | ||
padding: Spacings.$spacing05; | ||
border-radius: 12px; | ||
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); | ||
|
||
&:hover { | ||
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); | ||
} | ||
|
||
.search_input { | ||
border: none; | ||
flex: 1; | ||
caret-color: Colors.$accent; | ||
|
||
&:focus { | ||
box-shadow: none; | ||
} | ||
} | ||
&:hover { | ||
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), | ||
0 8px 10px -6px rgb(0 0 0 / 0.1); | ||
} | ||
|
||
.search_icon { | ||
width: IconSizes.$big; | ||
height: IconSizes.$big; | ||
color: Colors.$accent; | ||
cursor: pointer; | ||
.search_icon { | ||
width: IconSizes.$big; | ||
height: IconSizes.$big; | ||
color: Colors.$accent; | ||
cursor: pointer; | ||
|
||
&.disabled { | ||
color: Colors.$black; | ||
pointer-events: none; | ||
opacity: 0.2; | ||
} | ||
&.disabled { | ||
color: Colors.$black; | ||
pointer-events: none; | ||
opacity: 0.2; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.