Ver código fonte

add loading progres button and fix bugs

serg1557733 1 ano atrás
pai
commit
f062b9b26e
1 arquivos alterados com 9 adições e 2 exclusões
  1. 9 2
      frontend/src/components/chatPage/ChatPage.jsx

+ 9 - 2
frontend/src/components/chatPage/ChatPage.jsx

@@ -165,9 +165,14 @@ export const ChatPage = () => {
                            
                         }>
                         <Button
+                            disabled={showSpinner}
                             variant="contained" 
                             component="label"
-                            sx = {{
+                            sx = {showSpinner? 
+                                {
+                                minWidth: 'auto'}
+                                :
+                                {
                                 minWidth: 'auto',
                                 backgroundImage:'url(' + imgBtn + ')' ,
                                 backgroundPosition: 'center', 
@@ -175,6 +180,7 @@ export const ChatPage = () => {
                                 backgroundSize: '20px 40px'
 
                             }}
+                            style = {{color: 'green'}}
                         >
                         <input
                             onChange={e =>{
@@ -187,7 +193,7 @@ export const ChatPage = () => {
                             hidden
                         />
 
-                       
+                       {showSpinner? loadingPercentage : ""}
                         </Button>    
                         <Button
                             variant="contained" 
@@ -203,6 +209,7 @@ export const ChatPage = () => {
 
                             onClick = {() => webcamEventHandler()}
                         >
+                            
                         </Button>          
 
                         <TextareaAutosize