You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2024/05/06 07:23:49 UTC

(incubator-answer) 01/02: fix: mentions style format

This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch feat/1.3.1/ui
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 40a6cbdab74ba404323798817ce760e3ecaa8a93
Author: shuai <li...@sifou.com>
AuthorDate: Mon May 6 15:22:58 2024 +0800

    fix: mentions style format
---
 ui/src/components/Mentions/index.scss | 4 ++++
 ui/src/components/Mentions/index.tsx  | 9 ++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/ui/src/components/Mentions/index.scss b/ui/src/components/Mentions/index.scss
new file mode 100644
index 00000000..bd8614a3
--- /dev/null
+++ b/ui/src/components/Mentions/index.scss
@@ -0,0 +1,4 @@
+.bg-gray-200 {
+  color: var(--bs-body-color);
+  background-color: var(--an-invite-answer-item-active);
+}
diff --git a/ui/src/components/Mentions/index.tsx b/ui/src/components/Mentions/index.tsx
index 63d0f702..fd1beb03 100644
--- a/ui/src/components/Mentions/index.tsx
+++ b/ui/src/components/Mentions/index.tsx
@@ -23,6 +23,8 @@ import { Dropdown } from 'react-bootstrap';
 import { useSearchUserStaff } from '@/services';
 import * as Types from '@/common/interface';
 
+import './index.scss';
+
 interface IProps {
   children: React.ReactNode;
   pageUsers;
@@ -50,8 +52,6 @@ const Mentions: FC<IProps> = ({ children, pageUsers, onSelected }) => {
           users.findIndex((user) => user.userName === item.userName) < 0,
       ) || [];
 
-  console.log('staffUserList:', staffUserList);
-
   const searchUser = () => {
     const element = dropdownRef.current?.children[0];
     const { value, selectionStart = 0 } = element as HTMLTextAreaElement;
@@ -71,9 +71,6 @@ const Mentions: FC<IProps> = ({ children, pageUsers, onSelected }) => {
     if (str.substring(str.lastIndexOf(' '), selectionStart).indexOf('@') < 0) {
       return;
     }
-
-    console.log('str111111:', str);
-    console.log('str2222:', str.substring(1));
     setValue(str.substring(1));
 
     if (!str.substring(1)) {
@@ -148,6 +145,8 @@ const Mentions: FC<IProps> = ({ children, pageUsers, onSelected }) => {
     }
   };
 
+  console.log('keyCode11111', cursor);
+
   return (
     <Dropdown
       ref={dropdownRef}