diff --git a/app/soapbox/features/status/components/detailed_status.js b/app/soapbox/features/status/components/detailed_status.js
index a88395e2a..56dec3dd8 100644
--- a/app/soapbox/features/status/components/detailed_status.js
+++ b/app/soapbox/features/status/components/detailed_status.js
@@ -16,7 +16,8 @@ import classNames from 'classnames';
import Icon from 'soapbox/components/icon';
import PollContainer from 'soapbox/containers/poll_container';
import { StatusInteractionBar } from './status_interaction_bar';
-import UserPanel from '../../ui/components/user_panel';
+import ProfileHoverCardContainer from 'soapbox/features/profile_hover_card/profile_hover_card_container';
+import { isMobile } from 'soapbox/is_mobile';
export default class DetailedStatus extends ImmutablePureComponent {
@@ -39,9 +40,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
state = {
height: null,
- profilePanelVisible: false,
- profilePanelX: 0,
- profilePanelY: 0,
+ profileCardVisible: false,
};
handleOpenVideo = (media, startTime) => {
@@ -85,21 +84,19 @@ export default class DetailedStatus extends ImmutablePureComponent {
window.open(href, 'soapbox-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');
}
- isMobile = () => window.matchMedia('only screen and (max-width: 895px)').matches;
-
handleProfileHover = e => {
- if (!this.isMobile()) this.setState({ profilePanelVisible: true, profilePanelX: e.nativeEvent.offsetX, profilePanelY: e.nativeEvent.offsetY });
+ if (!isMobile(window.innerWidth)) this.setState({ profileCardVisible: true });
}
handleProfileLeave = e => {
- if (!this.isMobile()) this.setState({ profilePanelVisible: false });
+ if (!isMobile(window.innerWidth)) this.setState({ profileCardVisible: false });
}
render() {
const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status;
const outerStyle = { boxSizing: 'border-box' };
const { compact } = this.props;
- const { profilePanelVisible, profilePanelX, profilePanelY } = this.state;
+ const { profileCardVisible } = this.state;
if (!status) {
return null;
@@ -176,9 +173,10 @@ export default class DetailedStatus extends ImmutablePureComponent {
{status.get('group') && (
diff --git a/app/styles/components/profile_hover_card.scss b/app/styles/components/profile_hover_card.scss
index ed99d923f..d8c47175d 100644
--- a/app/styles/components/profile_hover_card.scss
+++ b/app/styles/components/profile_hover_card.scss
@@ -1,17 +1,25 @@
.display-name__account {
position: relative;
+ cursor: pointer;
}
.profile-hover-card {
@include standard-panel;
position: absolute;
+ pointer-events: none;
opacity: 0;
transition-property: opacity;
- transition-duration: 0.5s;
+ transition-duration: 0.2s;
+ transition-delay: 0.7s;
z-index: 998;
- opacity: 1;
- transition-delay: 1s;
left: -10px;
+ top: 70px;
+
+ &--visible {
+ opacity: 1;
+ pointer-events: all;
+ }
+
@media(min-width: 750px) {
left: -80px;
@@ -45,6 +53,7 @@
margin-right: 5px;
border-radius: 3px;
font-size: 11px;
+ opacity: 1;
}
}
@@ -52,3 +61,10 @@
margin: 0 20px 20px;
}
}
+
+.detailed-status {
+ .profile-hover-card {
+ top: -20px;
+ left: 80px;
+ }
+}