-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: video editor and uploader layout fixes #410
Changes from 4 commits
b1ca6fe
212578c
85cc5be
204a70f
67a53d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ import { ArrowForward, FileUpload, Close } from '@edx/paragon/icons'; | |
import { useDispatch } from 'react-redux'; | ||
import { thunkActions } from '../../data/redux'; | ||
import * as hooks from './hooks'; | ||
import * as editorHooks from '../EditorContainer/hooks'; | ||
import messages from './messages'; | ||
|
||
const URLUploader = () => { | ||
|
@@ -17,49 +16,51 @@ const URLUploader = () => { | |
const intl = useIntl(); | ||
return ( | ||
<div className="d-flex flex-column"> | ||
<div style={{ backgroundColor: '#F2F0EF' }} className="justify-content-center align-self-center rounded-circle p-5"> | ||
<Icon src={FileUpload} className="text-muted" size="lg" /> | ||
<div className="justify-content-center align-self-center rounded-circle bg-light-300 p-2.5"> | ||
<Icon src={FileUpload} className="text-muted" style={{ height: '2rem', width: '2rem' }} /> | ||
</div> | ||
<div className="d-flex align-self-center justify-content-center flex-wrap flex-column pt-5"> | ||
<span className="small">{intl.formatMessage(messages.dropVideoFileHere)}</span> | ||
<span className="align-self-center" style={{ fontSize: '0.8rem' }}>{intl.formatMessage(messages.info)}</span> | ||
<div className="d-flex align-self-center justify-content-center flex-wrap flex-column pt-3"> | ||
<span>{intl.formatMessage(messages.dropVideoFileHere)}</span> | ||
<span className="x-small align-self-center pt-2">{intl.formatMessage(messages.info)}</span> | ||
</div> | ||
<div className="x-small align-self-center justify-content-center mx-2 text-dark font-weight-normal">OR</div> | ||
<div className="zindex-9 video-id-prompt p-4"> | ||
<InputGroup className="video-upload-input-group"> | ||
<div className="small align-self-center justify-content-center mx-2 text-dark font-weight-normal pt-3"> | ||
OR | ||
</div> | ||
<div className="zindex-9 video-id-prompt py-3"> | ||
<InputGroup> | ||
<FormControl | ||
className="m-0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KristinAoki Using the trailingElement fixed this. |
||
placeholder={intl.formatMessage(messages.pasteURL)} | ||
aria-label={intl.formatMessage(messages.pasteURL)} | ||
aria-describedby="basic-addon2" | ||
borderless | ||
onClick={(event) => { event.stopPropagation(); }} | ||
onChange={(event) => { setTextInputValue(event.target.value); }} | ||
/> | ||
<div className="light-300 justify-content-center align-self-center bg-light rounded-circle p-0 x-small url-submit-button"> | ||
<IconButton | ||
className="text-muted" | ||
alt={intl.formatMessage(messages.submitButtonAltText)} | ||
src={ArrowForward} | ||
iconAs={Icon} | ||
size="inline" | ||
onClick={(event) => { | ||
event.stopPropagation(); | ||
if (textInputValue.trim() !== '') { | ||
onURLUpload(textInputValue); | ||
} | ||
}} | ||
/> | ||
</div> | ||
<IconButton | ||
className="position-absolute align-self-center text-muted bg-transparent shadow-none" | ||
style={{ marginLeft: '20.25rem' }} | ||
alt={intl.formatMessage(messages.submitButtonAltText)} | ||
src={ArrowForward} | ||
iconAs={Icon} | ||
size="inline" | ||
onClick={(event) => { | ||
event.stopPropagation(); | ||
if (textInputValue.trim() !== '') { | ||
onURLUpload(textInputValue); | ||
} | ||
}} | ||
/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason you are using
where
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KristinAoki Done. |
||
</InputGroup> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export const VideoUploader = ({ setLoading, onClose }) => { | ||
export const VideoUploader = ({ setLoading }) => { | ||
const dispatch = useDispatch(); | ||
const intl = useIntl(); | ||
const handleCancel = editorHooks.handleCancel({ onClose }); | ||
const goBack = hooks.useHistoryGoBack(); | ||
|
||
const handleProcessUpload = ({ fileData }) => { | ||
dispatch(thunkActions.video.uploadVideo({ | ||
|
@@ -77,7 +78,7 @@ export const VideoUploader = ({ setLoading, onClose }) => { | |
alt={intl.formatMessage(messages.closeButtonAltText)} | ||
src={Close} | ||
iconAs={Icon} | ||
onClick={handleCancel} | ||
onClick={goBack} | ||
/> | ||
</div> | ||
<Dropzone | ||
|
@@ -91,7 +92,6 @@ export const VideoUploader = ({ setLoading, onClose }) => { | |
|
||
VideoUploader.propTypes = { | ||
setLoading: PropTypes.func.isRequired, | ||
onClose: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default VideoUploader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using CSS classes seems to be better here https://paragon-openedx.netlify.app/foundations/css-utilities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@farhaanbukhsh There is no CSS class for top: 0, left: 0 or right: 0, and I thought leaving everything under style makes it clearer that this entire part is copied from the styling of the Paragon FullscreenModal.