fix(frontend): using dark mode in tiptap (#2616)

# Description

Applying dark mode to icons in tiptap.

## Checklist before requesting a review

Please delete options that are not relevant.

- [X] My code follows the style guidelines of this project
- [X] I have performed a self-review of my code

## Screenshots:
<img width="906" alt="image"
src="https://github.com/QuivrHQ/quivr/assets/33584382/c8d86fa2-0f58-4c44-82d2-5162a5e025cd">
This commit is contained in:
Agustín Dye 2024-05-24 10:27:47 +02:00 committed by GitHub
parent 1a8303ce2a
commit a266066d25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View File

@ -21,4 +21,8 @@
.brain_name {
@include Typography.EllipsisOverflow;
}
}
.dark_image {
filter: invert(100%);
}
}

View File

@ -1,6 +1,7 @@
import Image from "next/image";
import Icon from "@/lib/components/ui/Icon/Icon";
import { useUserSettingsContext } from "@/lib/context/UserSettingsProvider/hooks/useUserSettingsContext";
import styles from "./MentionItem.module.scss";
@ -18,16 +19,18 @@ export const MentionItem = ({
onClick,
isSelected,
}: MentionItemProps): JSX.Element => {
const { isDarkMode } = useUserSettingsContext();
return (
<span
className={`${styles.mention_item_wrapper} ${
isSelected ? styles.selected : ""
}`}
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" />
<Image src={item.iconUrl} width={18} height={18} alt="logo_url" className={isDarkMode ? styles.dark_image : ""} />
) : (
<Icon color="primary" size="normal" name="brain" />
)}