-
Notifications
You must be signed in to change notification settings - Fork 806
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RNMobile] Disable VideoPress settings for not belonged videos (#30759)
* Disable details block settings if video does not belong to site * Add video not owned message to Details panel * Add changelog * Update VideoPress package version * Fix styles import in `DetailsPanel` component * Render warning component after detail settings * Disable privacy and rating settings if video does not belong to site * Add `VideoNotOwnedWarning` component * Show video not owned warning in Privacy and Rating panel * Update changelog
- Loading branch information
Showing
8 changed files
with
101 additions
and
6 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...ts/packages/videopress/changelog/rnmobile-videopress-disable-settings-not-belonged-videos
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: added | ||
|
||
RNMobile: Disable VideoPress settings if video does not belong to the site |
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
41 changes: 41 additions & 0 deletions
41
...s/src/client/block-editor/blocks/video/components/video-not-owned-warning/index.native.js
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { usePreferredColorSchemeStyle } from '@wordpress/compose'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { Icon, warning } from '@wordpress/icons'; | ||
/** | ||
* External dependencies | ||
*/ | ||
import { Text, View } from 'react-native'; | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import styles from './styles.scss'; | ||
|
||
/** | ||
* React component that renders a warning message about the video not owned by the site. | ||
* | ||
* @returns {import('react').ReactElement} - Details panel component. | ||
*/ | ||
export default function VideoNotOwnedWarning() { | ||
const msgStyle = usePreferredColorSchemeStyle( | ||
styles[ 'video-not-owned-notice__message' ], | ||
styles[ 'video-not-owned-notice__message--dark' ] | ||
); | ||
const iconStyle = usePreferredColorSchemeStyle( | ||
styles[ 'video-not-owned-notice__icon' ], | ||
styles[ 'video-not-owned-notice__icon--dark' ] | ||
); | ||
return ( | ||
<View style={ styles[ 'video-not-owned-notice__container' ] }> | ||
<Icon style={ iconStyle } icon={ warning } /> | ||
<Text style={ msgStyle }> | ||
{ __( | ||
'This video is not owned by this site. You can still embed it and customize the player, but you won’t be able to edit the video.', | ||
'jetpack-videopress-pkg' | ||
) } | ||
</Text> | ||
</View> | ||
); | ||
} |
26 changes: 26 additions & 0 deletions
26
...rc/client/block-editor/blocks/video/components/video-not-owned-warning/styles.native.scss
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.video-not-owned-notice__container { | ||
flex-direction: row; | ||
align-items: center; | ||
padding: 8px 0; | ||
justify-content: space-between; | ||
} | ||
|
||
.video-not-owned-notice__message { | ||
font-size: 11px; | ||
font-weight: 500; | ||
color: $yellow-50; | ||
flex: 1; | ||
} | ||
|
||
.video-not-owned-notice__message--dark { | ||
color: $yellow-30; | ||
} | ||
|
||
.video-not-owned-notice__icon { | ||
color: $yellow-50; | ||
margin-right: 5px; | ||
} | ||
|
||
.video-not-owned-notice__icon--dark { | ||
color: $yellow-30; | ||
} |
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