-
Notifications
You must be signed in to change notification settings - Fork 266
WS-2095: Add share function to video carousels (Productionised) #13628
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
Open
emilysaffron
wants to merge
92
commits into
latest
Choose a base branch
from
portraitvideoshare
base: latest
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
cf396fd
copy webcore
emilysaffron a7ffec9
with logs
emilysaffron cc2e36f
fix build
emilysaffron c105ad8
memoise modal
emilysaffron 7783bf3
remove unused memo
emilysaffron dc81069
remove need for memo and fix autpplay
emilysaffron 6f62af5
player ref
emilysaffron d5d7637
fix build
emilysaffron 63fc4f8
share url
emilysaffron 75288f0
remove unnecessary things
emilysaffron 2e6fbc8
return is lite check to correct place
emilysaffron 6d1074f
rename shareurl
emilysaffron 84c5399
Merge branch 'latest' into portraitvideoshare
emilysaffron 92d3c40
use fabl to fetch shareUrl
emilysaffron 074a5bf
Merge branch 'portraitvideoshare' of github.com:bbc/simorgh into port…
emilysaffron 895ea4c
update share link on each swipe/click to next pv
emilysaffron 163a2f5
Merge branch 'latest' into portraitvideoshare
emilysaffron d4db280
extract share button into components and use in overlay
emilysaffron 6549edf
Merge branch 'portraitvideoshare' of github.com:bbc/simorgh into port…
emilysaffron 331e32d
Merge branch 'latest' into portraitvideoshare
emilysaffron d1bbfed
fix build
emilysaffron a94e9aa
Merge branch 'portraitvideoshare' of github.com:bbc/simorgh into port…
emilysaffron 9cb2068
show share button on hover
emilysaffron 3c29d4d
Merge branch 'latest' into portraitvideoshare
emilysaffron 1deecce
simplify setCurrentItem
emilysaffron 0bc5abc
Merge branch 'portraitvideoshare' of github.com:bbc/simorgh into port…
emilysaffron c7870f9
wrap handleCloseModal in useCallback
emilysaffron 3e28b6e
Merge branch 'latest' into portraitvideoshare
emilysaffron 73b3fc6
Merge branch 'latest' into portraitvideoshare
emilysaffron 09b87d2
Bring components in line with our coding standards
emilysaffron 10be5f3
only load plugin for carousel
emilysaffron b3f78f9
check .enabled
emilysaffron e662677
Merge branch 'latest' into portraitvideoshare
emilysaffron e69cf7a
fix build error
emilysaffron 66f183e
WS-2106: Updates click tracking data for share button
Isabella-Mitchell 88bce64
Merge branch 'latest' into portraitvideoshare
emilysaffron 75579f3
increase bundle size
emilysaffron d978d41
update unit test mock
emilysaffron 126e3ae
prevent cypress fail
emilysaffron bbf05f0
Merge branch 'latest' into portraitvideoshare
emilysaffron b1e1e5a
WS-2095: Refactors tracking data
Isabella-Mitchell 39178ec
WS-2095: Add type
Isabella-Mitchell fca41d0
WS-2095: Fix
Isabella-Mitchell f94f8a4
dont render button if no share url is available
emilysaffron 1b01ff1
Merge branch 'portraitvideoshare' of github.com:bbc/simorgh into port…
emilysaffron 82c54d1
dont render share button if the share api is not available
emilysaffron fd39dea
WS-2095: Refactors Share Button to be a shared component
Isabella-Mitchell a08d9c8
use plugin from simorgh static assets
emilysaffron 953cc1c
Merge branch 'portraitvideoshare' of github.com:bbc/simorgh into port…
emilysaffron 691cc76
Merge branch 'latest' into portraitvideoshare
emilysaffron ba13491
WS-2095: Updates tracking values for post share button for consistency
Isabella-Mitchell cacb25a
WS-2095: Constructs plugin link outside of useEffect
Isabella-Mitchell bd5324d
Merge branch 'latest' into portraitvideoshare
emilysaffron 8a6de08
Merge branch 'latest' into portraitvideoshare
emilysaffron a71e13a
Merge branch 'latest' into portraitvideoshare
Isabella-Mitchell f233373
Merge branch 'latest' into portraitvideoshare
Isabella-Mitchell f869dcf
Merge branch 'latest' into portraitvideoshare
emilysaffron 453178e
WS-2095: Fix merge
Isabella-Mitchell 4983e96
Merge branch 'latest' into portraitvideoshare
emilysaffron acd5708
Merge branch 'latest' into portraitvideoshare
Isabella-Mitchell ee4df83
WS-2095: Adds test coverage [copilot]
Isabella-Mitchell ec6eeb9
WS-2095: Adds unit test coverage [copilot]
Isabella-Mitchell a5e9d34
WS-2095: Renames constants and functions for clarity
Isabella-Mitchell ccbc68c
WS-2095: Simplify early return
Isabella-Mitchell e7d0158
Merge branch 'latest' into portraitvideoshare
Isabella-Mitchell 3c74673
WS-2095: Refactors early returns
Isabella-Mitchell cb54829
TEMP change: hasShareApi as const
Isabella-Mitchell 93b645a
TEMP change: hasShareApi as const
Isabella-Mitchell deb8bd0
WS-2095: Tidies
Isabella-Mitchell ef4f2d5
WS-2095: Adds story
Isabella-Mitchell a4d7121
WS-2095: Fix
Isabella-Mitchell 543bae7
WS-2095: Removes text from share button (UX review)
Isabella-Mitchell fa14632
WS-2095: Focus indicator styles fix
Isabella-Mitchell e825b64
WS-2095: Reverts navigator change to try fix safari bug
Isabella-Mitchell f82ac17
Revert "WS-2095: Reverts navigator change to try fix safari bug"
Isabella-Mitchell afc41de
WS-2095: Temp to debug, fetch plugin from PS
Isabella-Mitchell b989159
Revert "WS-2095: Temp to debug, fetch plugin from PS"
Isabella-Mitchell f3920fb
WS-2095: Temp, reflects plugin update on A11y swarm branch
Isabella-Mitchell bb45716
WS-2095: Temp, refactors fullScreenPlugin
Isabella-Mitchell 6ee15c2
WS-2095: temp, cache bust for videoOverlayPlugin
Isabella-Mitchell 375e0af
Merge branch 'latest' into portraitvideoshare
emilysaffron 8130750
Merge branch 'latest' into portraitvideoshare
emilysaffron 0ca3ba5
WS-2095: Temp, adds fullscreen plugin cache busting
Isabella-Mitchell 9a88adf
WS-2095: Try fix issues on mobile
Isabella-Mitchell 187a50c
WS-2095: debug
Isabella-Mitchell 1c5f76d
setCurrentVideo using mediaItemChanged smp event
emilysaffron 0a37863
temporary logs for preview
emilysaffron 7a8986a
WS-2095: HCM hover focus styles
Isabella-Mitchell 7fa5b9f
WS-2095: Updates visually hidden text
Isabella-Mitchell 21c2636
Merge branch 'latest' into portraitvideoshare
emilysaffron c79a60d
WS-2095: UX update - align share button spacing with PS
Isabella-Mitchell 5dabca2
Merge branch 'latest' into portraitvideoshare
emilysaffron 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
65 changes: 65 additions & 0 deletions
65
src/app/components/PortraitVideoCarousel/VideoOverlay/index.styles.ts
This file contains hidden or 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,65 @@ | ||
| import { css, Theme } from '@emotion/react'; | ||
|
|
||
| const styles = { | ||
| overlayWrapper: () => | ||
| css({ | ||
| zIndex: 200, | ||
| position: 'absolute', | ||
| top: 0, | ||
| bottom: 0, | ||
| left: 0, | ||
| right: 0, | ||
| containerType: 'inline-size', | ||
| containerName: 'overlayWrapper', | ||
| '@supports not (container-type: inline-size)': { | ||
| display: 'none', | ||
| }, | ||
| }), | ||
| overlayFooterContents: ({ spacings }: Theme) => | ||
| css({ | ||
| display: 'flex', | ||
| flexDirection: 'row', | ||
| justifyContent: 'space-between', | ||
| gap: `${spacings.DOUBLE}rem`, | ||
| maxWidth: `77.5rem`, | ||
| margin: 'auto', | ||
| alignItems: 'flex-end', | ||
| }), | ||
| overlayFooter: ({ spacings }: Theme) => | ||
| css({ | ||
| position: 'absolute', | ||
| left: `${spacings.FULL}rem`, | ||
| right: `${spacings.FULL}rem`, | ||
| bottom: 0, | ||
| paddingBottom: '1rem', | ||
| '@supports not (container-type: inline-size)': { | ||
| display: 'none', | ||
| }, | ||
|
|
||
| '@container overlayWrapper (min-width: 20rem)': { | ||
| paddingBottom: '5rem', | ||
| left: `${spacings.DOUBLE}rem`, | ||
| right: `${spacings.DOUBLE}rem`, | ||
| }, | ||
|
|
||
| // @container (min-width: 500px) | ||
| '@container overlayWrapper (min-width: 31.25rem)': { | ||
| left: `${spacings.TRIPLE}rem`, | ||
| right: `${spacings.TRIPLE}rem`, | ||
| }, | ||
|
|
||
| // @container (min-width: 860px) | ||
| '@container overlayWrapper (min-width: 53.75rem)': { | ||
| paddingBottom: '8.75rem', | ||
| left: `${spacings.DOUBLE}rem`, | ||
| right: `${spacings.DOUBLE}rem`, | ||
| }, | ||
| }), | ||
| shareToolWrapper: () => | ||
| css({ | ||
| marginLeft: 'auto', | ||
| pointerEvents: 'auto', | ||
| }), | ||
| }; | ||
|
|
||
| export default styles; |
63 changes: 63 additions & 0 deletions
63
src/app/components/PortraitVideoCarousel/VideoOverlay/index.tsx
This file contains hidden or 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,63 @@ | ||
| import { useEffect, useState } from 'react'; | ||
| import { EventTrackingData } from '#app/lib/analyticsUtils/types'; | ||
| import { PortraitClipMediaBlock } from '#app/components/MediaLoader/types'; | ||
| import ShareButton from '../../ShareButton'; | ||
| import styles from './index.styles'; | ||
|
|
||
| const ShareToolComponent = ({ shareUrlPath, title, id }) => { | ||
| const [shareUrl, setShareUrl] = useState(''); | ||
|
|
||
| useEffect(() => { | ||
| setShareUrl(`https://bbc.com${shareUrlPath}`); | ||
| }, [shareUrlPath]); | ||
|
|
||
| const eventTrackingData: EventTrackingData = { | ||
| componentName: 'share-button-portrait-video-carousel', | ||
| itemTracker: { | ||
| resourceId: id, | ||
| }, | ||
| }; | ||
|
|
||
| return ( | ||
| <div key={shareUrlPath} css={styles.shareToolWrapper}> | ||
| <ShareButton | ||
| title={title} | ||
| url={shareUrl} | ||
| eventTrackingData={eventTrackingData} | ||
| /> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| const VideoOverlay = ({ | ||
| currentVideo, | ||
| controlsDisplayed, | ||
| }: { | ||
| currentVideo: PortraitClipMediaBlock | undefined; | ||
| controlsDisplayed: boolean; | ||
| }) => { | ||
| const { shareUrl, title, id } = currentVideo?.model?.video || {}; | ||
|
|
||
| return ( | ||
| <div css={[styles.overlayWrapper, !shareUrl && 'display: none']}> | ||
| <div | ||
| className="video-overlay-footer fadedIn fadedOut" | ||
| // The video-overlay plugin will use this attribute to instruct SMP not to render subtitles in the space occupied by this div. | ||
| data-region-exclude-subtitles | ||
| css={[ | ||
| styles.overlayFooter, | ||
| controlsDisplayed ? 'opacity: 1' : 'opacity: 0', | ||
| ]} | ||
| > | ||
| <div | ||
| className="video-overlay-footer-contents" | ||
| css={styles.overlayFooterContents} | ||
| > | ||
| <ShareToolComponent shareUrlPath={shareUrl} title={title} id={id} /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default VideoOverlay; |
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.
Temp- busts cache on preview