diff --git a/css/main.scss b/css/main.scss index df4ac20b7..1d063023c 100644 --- a/css/main.scss +++ b/css/main.scss @@ -40,7 +40,6 @@ $flagsImagePath: "../images/"; @import 'modals/invite/info'; @import 'modals/screen-share/share-audio'; @import 'modals/screen-share/share-screen-warning'; -@import 'modals/virtual-background/virtual-background'; @import 'modals/local-recording/local-recording'; @import 'videolayout_default'; @import 'notice'; diff --git a/css/modals/virtual-background/_virtual-background.scss b/css/modals/virtual-background/_virtual-background.scss deleted file mode 100644 index 274d60b6d..000000000 --- a/css/modals/virtual-background/_virtual-background.scss +++ /dev/null @@ -1,207 +0,0 @@ -.virtual-background-dialog { - margin-left: -10px; - position: relative; - max-height: 300px; - color: white; - display: inline-grid; - grid-template-columns: auto auto auto auto auto; - column-gap: 9px; - cursor: pointer; - .desktop-share:hover, - .thumbnail:hover, - .blur:hover, - .slight-blur:hover, - .virtual-background-none:hover { - opacity: 0.5; - border: 2px solid #99bbf3; - @media (max-width: 632px) { - height: 60px; - width: 60px; - } - } - .background-option { - margin-top: 8px; - border-radius: 6px; - height: 60px; - width: 107px; - text-align: center; - justify-content: center; - font-weight: bold; - box-sizing: border-box; - display: flex; - align-items: center; - } - .thumbnail { - object-fit: cover; - } - - .thumbnail:hover ~ .delete-image-icon { - display: block; - } - .thumbnail-selected { - object-fit: cover; - border: 2px solid #246fe5; - } - .blur { - box-shadow: inset 0 0 12px #000000; - background: #7e8287; - padding: 0 10px; - } - .blur-selected { - box-shadow: inset 0 0 12px #000000; - background: #7e8287; - border: 2px solid #246fe5; - padding: 0 10px; - } - .slight-blur { - box-shadow: inset 0 0 12px #000000; - background: #a4a4a4; - padding: 0 10px; - } - .slight-blur-selected { - box-shadow: inset 0 0 12px #000000; - background: #a4a4a4; - border: 2px solid #246fe5; - padding: 0 10px; - } - .virtual-background-none { - background: #525252; - padding: 0 10px; - } - .none-selected { - background: #525252; - border: 2px solid #246fe5; - padding: 0 10px; - } - - .desktop-share { - background: #525252; - } - .desktop-share-selected { - background: #525252; - border: 2px solid #246fe5; - padding: 0 10px; - } - - @media (max-width: 632px) { - font-size: 1.5vw; - .desktop-share, - .virtual-background-none, - .thumbnail, - .blur, - .slight-blur { - height: 60px; - width: 60px; - } - .desktop-share-selected, - .thumbnail-selected, - .none-selected, - .blur-selected, - .slight-blur-selected { - height: 60px; - width: 60px; - } - } - @media (max-width: 360px) { - grid-template-columns: auto auto auto; - } -} - -.modal-dialog-form .virtual-background-loading { - overflow: hidden; - position: fixed; - left: 50%; - margin-top: 10px; - transform: translateX(-50%); -} -.modal-dialog-form .video-preview { - height: 250px; -} -.file-upload-btn { - display: none; -} -.file-upload-label { - font-size: 14px; - font-weight: 600; - line-height: 20px; - margin-left: -10px; - margin-top: 16px; - margin-bottom: 8px; - color: #669aec; - display: inline-flex; - cursor: pointer; -} - -.delete-image-icon { - background: #3d3d3d; - position: absolute; - display: none; - left: 96; - bottom: 51; - @media (max-width: 632px) { - left: 51px; - } -} - -.delete-image-icon:hover { - display: block; -} - -.thumbnail-container { - position: relative; - &:focus-within { - .thumbnail ~ .delete-image-icon { - display: block; - } - } -} - -.add-background { - margin-right: 8px; -} - -.apply-background-btn { - margin-top: 16px; - float: right; -} - -.video-background-preview-entry { - margin-left: -10px; - height: 250px; - width: 570px; - margin-bottom: 8px; - z-index: 2; - @media (max-width: 632px) { - max-width: 336; - } -} - -.virtual-background-preview-video { - margin-left: -10; - border-radius: 6px; - height: 100%; - object-fit: cover; - width: 100%; -} -.video-preview-loader { - border-radius: 6px; - background-color: transparent; - height: 250px; - margin-bottom: 8px; - width: 572px; - position: fixed; - z-index: 2; - @media (min-width: 432px) and (max-width: 632px) { - width: 340px; - } -} - -.video-preview-loader svg { - position: absolute; - top: 40%; - left: 45%; -} - -.dialog-margin-top{ - margin-top: 44px; -} \ No newline at end of file diff --git a/react/features/virtual-background/components/UploadImageButton.js b/react/features/virtual-background/components/UploadImageButton.js index a8517316f..1098f5c46 100644 --- a/react/features/virtual-background/components/UploadImageButton.js +++ b/react/features/virtual-background/components/UploadImageButton.js @@ -1,5 +1,6 @@ // @flow +import { makeStyles } from '@material-ui/styles'; import React, { useCallback, useRef } from 'react'; import { v4 as uuidv4 } from 'uuid'; @@ -42,6 +43,28 @@ type Props = { t: Function } +const useStyles = makeStyles(theme => { + return { + addBackground: { + marginRight: `${theme.spacing(2)}px` + }, + button: { + display: 'none' + }, + label: { + fontSize: '14px', + fontWeight: '600', + lineHeight: '20px', + marginLeft: '-10px', + marginTop: `${theme.spacing(3)}px`, + marginBottom: `${theme.spacing(2)}px`, + color: '#669aec', + display: 'inline-flex', + cursor: 'pointer' + } + }; +}); + /** * Component used to upload an image. * @@ -56,6 +79,7 @@ function UploadImageButton({ storedImages, t }: Props) { + const classes = useStyles(); const uploadImageButton: Object = useRef(null); const uploadImageKeyPress = useCallback(e => { if (uploadImageButton.current && (e.key === ' ' || e.key === 'Enter')) { @@ -100,12 +124,12 @@ function UploadImageButton({ <> {showLabel &&