diff --git a/packages/atlas/src/components/_channel/ChannelLink/ChannelLink.tsx b/packages/atlas/src/components/_channel/ChannelLink/ChannelLink.tsx index f032cdff80..e4a711c3c3 100644 --- a/packages/atlas/src/components/_channel/ChannelLink/ChannelLink.tsx +++ b/packages/atlas/src/components/_channel/ChannelLink/ChannelLink.tsx @@ -105,7 +105,15 @@ export const ChannelLink: FC = ({ ) } -const FollowButton = ({ title, channelId }: { title?: string; channelId?: string }) => { +export const FollowButton = ({ + title, + channelId, + isSmall, +}: { + title?: string + channelId?: string + isSmall?: boolean +}) => { const { toggleFollowing, isFollowing } = useHandleFollowChannel(channelId, title) const handleFollowButtonClick = (e: MouseEvent) => { e.preventDefault() @@ -115,7 +123,7 @@ const FollowButton = ({ title, channelId }: { title?: string; channelId?: string return ( - diff --git a/packages/atlas/src/components/_video/BackgroundVideoPlayer/BackgroundVideoPlayer.styles.ts b/packages/atlas/src/components/_video/BackgroundVideoPlayer/BackgroundVideoPlayer.styles.ts index 42fa1e7b64..f5371d4d0e 100644 --- a/packages/atlas/src/components/_video/BackgroundVideoPlayer/BackgroundVideoPlayer.styles.ts +++ b/packages/atlas/src/components/_video/BackgroundVideoPlayer/BackgroundVideoPlayer.styles.ts @@ -47,6 +47,7 @@ export const ButtonBox = styled.div` z-index: ${zIndex.modals}; display: flex; gap: ${sizes(2)}; + flex-direction: column-reverse; ${media.sm} { bottom: 32px; diff --git a/packages/atlas/src/components/_video/BackgroundVideoPlayer/BackgroundVideoPlayer.tsx b/packages/atlas/src/components/_video/BackgroundVideoPlayer/BackgroundVideoPlayer.tsx index 2da75b69b7..e271b6e5fe 100644 --- a/packages/atlas/src/components/_video/BackgroundVideoPlayer/BackgroundVideoPlayer.tsx +++ b/packages/atlas/src/components/_video/BackgroundVideoPlayer/BackgroundVideoPlayer.tsx @@ -18,6 +18,8 @@ type BackgroundVideoPlayerProps = { withFade?: boolean src: string[] poster: string[] + onMuted?: (newState: boolean) => void + loop?: boolean customLink?: string } & Omit, 'src' | 'poster'> @@ -32,14 +34,16 @@ export const BackgroundVideoPlayer: FC = ({ handleActions, videoPlaytime, videoId, + onMuted, withFade, customLink, + loop, ...props }) => { const videoRef = useRef(null) const [isPosterVisible, setIsPosterVisible] = useState(true) const [isPlaying, setIsPlaying] = useState(autoPlay) - const [isMuted, setIsMuted] = useState(true) + const [isMuted, setIsMuted] = useState(props.muted) const [canPlay, setCanPlay] = useState(false) const initialRender = useRef(true) @@ -97,9 +101,14 @@ export const BackgroundVideoPlayer: FC = ({ } const handleEnded = (e: SyntheticEvent) => { + onEnded?.(e) + + if (loop && videoRef.current) { + videoRef.current.currentTime = 0 + return + } setIsPosterVisible(true) setIsPlaying(false) - onEnded?.(e) } return ( @@ -112,13 +121,18 @@ export const BackgroundVideoPlayer: FC = ({ variant="tertiary" />