zhiwen0905 commited on
Commit
7ba5bbd
·
1 Parent(s): 350816f

feature(#191): update UI...

Browse files
Extension/src/pages/Panel/Message/index.css CHANGED
@@ -25,8 +25,6 @@
25
  .message_received {
26
  width: fit-content;
27
  padding: 5px;
28
- border-radius: 5px;
29
- background-color: var(--receive-theme-color);
30
  }
31
 
32
 
 
25
  .message_received {
26
  width: fit-content;
27
  padding: 5px;
 
 
28
  }
29
 
30
 
Extension/src/pages/Panel/Panel.css CHANGED
@@ -30,8 +30,11 @@
30
 
31
  .footer {
32
  padding: 10px;
33
- justify-self: end;
34
  background-color: var(--theme-color);
 
 
 
 
35
  }
36
 
37
  .content {
@@ -58,4 +61,18 @@
58
  .divider {
59
  margin: 0;
60
  background-color: grey;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
 
30
 
31
  .footer {
32
  padding: 10px;
 
33
  background-color: var(--theme-color);
34
+ display: flex;
35
+ gap: 5px;
36
+ align-items: center;
37
+ color: grey;
38
  }
39
 
40
  .content {
 
61
  .divider {
62
  margin: 0;
63
  background-color: grey;
64
+ }
65
+
66
+ .footer-btn {
67
+ padding: 3px;
68
+ background-color: inherit;
69
+ border: 0;
70
+ color: grey;
71
+ height: 25px;
72
+ }
73
+
74
+ .footer-btn:hover {
75
+ background-color: #8753e9;
76
+ border: 1px solid inherit;
77
+ border-radius: 10px;
78
  }
Extension/src/pages/Panel/Panel.jsx CHANGED
@@ -1,12 +1,23 @@
1
  import React, {useEffect, useRef, useState} from 'react';
2
- import {Divider, Input, Layout} from 'antd';
3
- import {SendOutlined} from '@ant-design/icons';
 
 
 
 
4
  import { getDatabase, onValue, ref } from "firebase/database";
5
 
6
  import Message from './Message'
7
  import './Panel.css';
8
  import app from './FirebaseApp/firebase-app'
9
  import Browser from 'webextension-polyfill'
 
 
 
 
 
 
 
10
 
11
  const {Footer, Content} = Layout;
12
  const URL_BASE = 'https://ttt246-brain.hf.space/'
@@ -34,7 +45,7 @@ const Panel = () => {
34
  const [messages, setMessages] = useState([]);
35
  const [isLoading, setLoadingStatus] = useState(false);
36
  const chat_box = useRef(null);
37
-
38
  const handleQuestionUpdated = (event) => {
39
  if (event.key === "Enter" && !isLoading) {
40
  addMessage(question, true);
@@ -318,7 +329,7 @@ const Panel = () => {
318
  return (
319
  <Layout className="main-layout" data-theme={isDarkMode ? 'dark': 'light'}>
320
  <div className="header">
321
- <img src={logoUrl} height="48px" alt="no image" />
322
  </div>
323
  <Divider className="divider"/>
324
  <Content className="content" ref={chat_box}>
@@ -331,11 +342,36 @@ const Panel = () => {
331
  </Content>
332
  <Divider className="divider"/>
333
  <Footer className="footer">
 
 
 
 
 
334
  <Input
335
- addonAfter={<SendOutlined/>}
336
  value={question}
337
  onChange={handleQuestionChange}
338
- onKeyDown={handleQuestionUpdated}/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  </Footer>
340
  </Layout>
341
  );
 
1
  import React, {useEffect, useRef, useState} from 'react';
2
+ import {
3
+ Divider,
4
+ Input,
5
+ Layout,
6
+ Tooltip
7
+ } from 'antd';
8
  import { getDatabase, onValue, ref } from "firebase/database";
9
 
10
  import Message from './Message'
11
  import './Panel.css';
12
  import app from './FirebaseApp/firebase-app'
13
  import Browser from 'webextension-polyfill'
14
+ import {
15
+ SettingOutlined,
16
+ SyncOutlined,
17
+ SoundOutlined,
18
+ CopyOutlined,
19
+ MessageOutlined
20
+ } from '@ant-design/icons'
21
 
22
  const {Footer, Content} = Layout;
23
  const URL_BASE = 'https://ttt246-brain.hf.space/'
 
45
  const [messages, setMessages] = useState([]);
46
  const [isLoading, setLoadingStatus] = useState(false);
47
  const chat_box = useRef(null);
48
+
49
  const handleQuestionUpdated = (event) => {
50
  if (event.key === "Enter" && !isLoading) {
51
  addMessage(question, true);
 
329
  return (
330
  <Layout className="main-layout" data-theme={isDarkMode ? 'dark': 'light'}>
331
  <div className="header">
332
+ <img src={logoUrl} height="50px" alt="no image" />
333
  </div>
334
  <Divider className="divider"/>
335
  <Content className="content" ref={chat_box}>
 
342
  </Content>
343
  <Divider className="divider"/>
344
  <Footer className="footer">
345
+ <Tooltip title="Settings" arrow="show" placement="bottom">
346
+ <div className="footer-btn">
347
+ <SettingOutlined />
348
+ </div>
349
+ </Tooltip>
350
  <Input
 
351
  value={question}
352
  onChange={handleQuestionChange}
353
+ onKeyDown={handleQuestionUpdated}
354
+ />
355
+ <Tooltip title="re-send" arrow="show" placement="bottom">
356
+ <div className="footer-btn">
357
+ <SyncOutlined />
358
+ </div>
359
+ </Tooltip>
360
+ <Tooltip title="voice recognition" arrow="show" placement="bottom">
361
+ <div className="footer-btn">
362
+ <SoundOutlined />
363
+ </div>
364
+ </Tooltip>
365
+ <Tooltip title="copy" arrow="show" placement="bottom">
366
+ <div className="footer-btn">
367
+ <CopyOutlined />
368
+ </div>
369
+ </Tooltip>
370
+ <Tooltip title="message" arrow="show" placement="bottom">
371
+ <div className="footer-btn">
372
+ <MessageOutlined />
373
+ </div>
374
+ </Tooltip>
375
  </Footer>
376
  </Layout>
377
  );