-
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
Merged
KristinAoki
merged 5 commits into
openedx:main
from
open-craft:artur/video-upload-layout-fixes
Dec 4, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b1ca6fe
fix: video upload page layout fixes
ArturGaspar 212578c
fix: video editor thumbnail fallback icon colour and size
ArturGaspar 85cc5be
fix: video uploader close button go back instead of closing app
ArturGaspar 204a70f
fix: video editor spinners vertical alignment
ArturGaspar 67a53d0
fix: use trailingElement for video uploader input button
ArturGaspar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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,52 @@ 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); }} | ||
trailingElement={( | ||
<IconButton | ||
className="url-submit-button" | ||
alt={intl.formatMessage(messages.submitButtonAltText)} | ||
src={ArrowForward} | ||
iconAs={Icon} | ||
size="inline" | ||
onClick={(event) => { | ||
event.stopPropagation(); | ||
if (textInputValue.trim() !== '') { | ||
onURLUpload(textInputValue); | ||
} | ||
}} | ||
/> | ||
)} | ||
/> | ||
<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> | ||
</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 +79,7 @@ export const VideoUploader = ({ setLoading, onClose }) => { | |
alt={intl.formatMessage(messages.closeButtonAltText)} | ||
src={Close} | ||
iconAs={Icon} | ||
onClick={handleCancel} | ||
onClick={goBack} | ||
/> | ||
</div> | ||
<Dropzone | ||
|
@@ -91,7 +93,6 @@ export const VideoUploader = ({ setLoading, onClose }) => { | |
|
||
VideoUploader.propTypes = { | ||
setLoading: PropTypes.func.isRequired, | ||
onClose: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default VideoUploader; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.