identifying code for PR
This commit is contained in:
parent
f94317c404
commit
5c8139f326
5 changed files with 13 additions and 12 deletions
|
@ -35,6 +35,7 @@ const AbandonedChannelPreview = lazyImport(() =>
|
||||||
import('component/abandonedChannelPreview' /* webpackChunkName: "abandonedChannelPreview" */)
|
import('component/abandonedChannelPreview' /* webpackChunkName: "abandonedChannelPreview" */)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// preview images used on the landing page and on the channel page
|
||||||
type Props = {
|
type Props = {
|
||||||
uri: string,
|
uri: string,
|
||||||
claim: ?Claim,
|
claim: ?Claim,
|
||||||
|
|
|
@ -53,6 +53,7 @@ type Props = {
|
||||||
isLivestream: boolean,
|
isLivestream: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// preview image cards used in related video functionality
|
||||||
function ClaimPreviewTile(props: Props) {
|
function ClaimPreviewTile(props: Props) {
|
||||||
const {
|
const {
|
||||||
history,
|
history,
|
||||||
|
|
|
@ -17,10 +17,7 @@ type Props = {
|
||||||
function FileWatchLaterLink(props: Props) {
|
function FileWatchLaterLink(props: Props) {
|
||||||
const { claim, hasClaimInWatchLater, doToast, doCollectionEdit, focusable = true } = props;
|
const { claim, hasClaimInWatchLater, doToast, doCollectionEdit, focusable = true } = props;
|
||||||
const buttonRef = useRef();
|
const buttonRef = useRef();
|
||||||
console.log('ref');
|
|
||||||
console.log(buttonRef);
|
|
||||||
let isHovering = useHover(buttonRef);
|
let isHovering = useHover(buttonRef);
|
||||||
console.log(isHovering);
|
|
||||||
|
|
||||||
if (!claim) {
|
if (!claim) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -40,7 +37,10 @@ function FileWatchLaterLink(props: Props) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// text that will show if you keep cursor over dic
|
||||||
const title = hasClaimInWatchLater ? __('Remove from Watch Later') : __('Add to Watch Later');
|
const title = hasClaimInWatchLater ? __('Remove from Watch Later') : __('Add to Watch Later');
|
||||||
|
|
||||||
|
// label that is shown after hover
|
||||||
const label = !hasClaimInWatchLater ? __('Add') : __('Added');
|
const label = !hasClaimInWatchLater ? __('Add') : __('Added');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -9,17 +9,12 @@ export default function useHover(ref) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const refElement = ref.current;
|
const refElement = ref.current;
|
||||||
if (refElement) {
|
if (refElement) {
|
||||||
// refElement.addEventListener('mouseenter', hoverFunc);
|
refElement.addEventListener('mouseenter', hoverFunc);
|
||||||
// refElement.addEventListener('mouseleave', unHoverFunc);
|
refElement.addEventListener('mouseleave', unHoverFunc);
|
||||||
// refElement.addEventListener('touchstart', hoverFunc);
|
|
||||||
// refElement.addEventListener('touchmove', unHoverFunc);
|
|
||||||
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
// refElement.removeEventListener('mouseenter', hoverFunc);
|
refElement.removeEventListener('mouseenter', hoverFunc);
|
||||||
// refElement.removeEventListener('mouseleave', unHoverFunc);
|
refElement.removeEventListener('mouseleave', unHoverFunc);
|
||||||
// refElement.removeEventListener('touchstart', hoverFunc);
|
|
||||||
// refElement.removeEventListener('touchmove', unHoverFunc);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}, [ref, isHovering]);
|
}, [ref, isHovering]);
|
||||||
|
|
|
@ -130,6 +130,7 @@
|
||||||
@include handleChannelGif(6rem);
|
@include handleChannelGif(6rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// show watch later button and duration divs when hovered
|
||||||
&:hover {
|
&:hover {
|
||||||
.claim-preview__hover-actions {
|
.claim-preview__hover-actions {
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -645,6 +646,7 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// show duration and watch later button when hovered
|
||||||
.claim-preview--tile {
|
.claim-preview--tile {
|
||||||
&:hover {
|
&:hover {
|
||||||
.claim-preview__hover-actions {
|
.claim-preview__hover-actions {
|
||||||
|
@ -672,6 +674,7 @@
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// div that displays watch later button
|
||||||
.claim-preview__hover-actions {
|
.claim-preview__hover-actions {
|
||||||
display: none;
|
display: none;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -703,6 +706,7 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// show the additional watch later text (Add) when hovered
|
||||||
&:hover {
|
&:hover {
|
||||||
.button__label {
|
.button__label {
|
||||||
display: inline;
|
display: inline;
|
||||||
|
|
Loading…
Add table
Reference in a new issue