Skip to content

Commit

Permalink
fixed hit box for popover navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinalong committed Jun 25, 2021
1 parent 299922d commit 9e54019
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
45 changes: 28 additions & 17 deletions components/core/ApplicationUserControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { css } from "@emotion/react";
import { Link } from "~/components/core/Link";

import { Boundary } from "~/components/system/components/fragments/Boundary";
import { useIntercom } from 'react-use-intercom';
import { useIntercom } from "react-use-intercom";

const STYLES_HEADER = css`
position: relative;
Expand Down Expand Up @@ -104,17 +104,18 @@ const STYLES_ITEM_BOX = css`

const OpenIntercom = ({ user }) => {
const { show } = useIntercom();

const showWithProps = () => show({
name: user.data.name || user.username,
});

return(
<span style={{ cursor: "pointer" }} onClick={() => showWithProps()}>
const showWithProps = () =>
show({
name: user.data.name || user.username,
});

return (
<span style={{ cursor: "pointer", display: "block" }} onClick={() => showWithProps()}>
Help
</span>
);
}
};

export class ApplicationUserControlsPopup extends React.Component {
_handleAction = (props) => {
Expand Down Expand Up @@ -169,14 +170,22 @@ export class ApplicationUserControlsPopup extends React.Component {
[
{
text: (
<Link href={`/$/user/${this.props.viewer.id}`} onAction={this._handleAction}>
<Link
href={`/$/user/${this.props.viewer.id}`}
style={{ display: "block" }}
onAction={this._handleAction}
>
Profile
</Link>
),
},
{
text: (
<Link href={"/_/directory"} onAction={this._handleAction}>
<Link
href={"/_/directory"}
style={{ display: "block" }}
onAction={this._handleAction}
>
Directory
</Link>
),
Expand All @@ -185,21 +194,25 @@ export class ApplicationUserControlsPopup extends React.Component {
[
{
text: (
<Link href={"/_/filecoin"} onAction={this._handleAction}>
<Link href={"/_/filecoin"} style={{ display: "block" }} onAction={this._handleAction}>
Filecoin
</Link>
),
},
{
text: (
<Link href={"/_/storage-deal"} onAction={this._handleAction}>
<Link
href={"/_/storage-deal"}
style={{ display: "block" }}
onAction={this._handleAction}
>
Storage deal
</Link>
),
},
{
text: (
<Link href={"/_/api"} onAction={this._handleAction}>
<Link href={"/_/api"} style={{ display: "block" }} onAction={this._handleAction}>
API
</Link>
),
Expand All @@ -208,17 +221,15 @@ export class ApplicationUserControlsPopup extends React.Component {
[
{
text: (
<Link href={"/_/settings"} onAction={this._handleAction}>
<Link href={"/_/settings"} style={{ display: "block" }} onAction={this._handleAction}>
Settings
</Link>
),
},
],
[
{
text: (
<OpenIntercom user={this.props.viewer} />
),
text: <OpenIntercom style={{ display: "block" }} user={this.props.viewer} />,
},
{
text: "Sign out",
Expand Down
4 changes: 3 additions & 1 deletion components/system/components/PopoverNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export class PopoverNavigation extends React.Component {
style={this.props.itemStyle}
onClick={each.onClick}
>
<div css={Styles.HEADING_05 || this.props.css}>{each.text}</div>
<div css={Styles.HEADING_05 || this.props.css} style={{ width: "100%" }}>
{each.text}
</div>
</div>
))}
</div>
Expand Down

0 comments on commit 9e54019

Please sign in to comment.