Skip to content

Commit

Permalink
Merge pull request #717 from 3DStreet/quick-hack-show-geo
Browse files Browse the repository at this point in the history
show the geo icon for non pro users
  • Loading branch information
kfarr authored Jul 19, 2024
2 parents 2e1736f + 7aa687d commit 22c5434
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions src/editor/components/components/GeoPanel/GeoPanel.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@ import GeoImg from '../../../../../ui_assets/geo.png';
import styles from './GeoPanel.module.scss';
import Events from '../../../lib/Events';
import { useAuthContext, useGeoContext } from '../../../contexts/index.js';

import posthog from 'posthog-js';
/**
* GeoPanel component.
*
* @author Rostyslav Nahornyi
* @category Components.
*/
const GeoPanel = () => {
const onClick = () => Events.emit('opengeomodal');
const { currentUser } = useAuthContext();
const onClick = () => {
posthog.capture('geo_panel_clicked');
if (currentUser.isPro) {
Events.emit('opengeomodal');
} else {
Events.emit('openpaymentmodal');
}
};

const streetGeo = useGeoContext();
let coordinateInfo = null;

Expand All @@ -21,18 +29,15 @@ const GeoPanel = () => {

return (
<div className={styles.geo}>
{currentUser?.isPro ? (
<>
<img src={GeoImg} onClick={onClick} alt="geo" />
{coordinateInfo ? (
<a onClick={onClick}>{coordinateInfo}</a>
) : (
<a onClick={onClick}>Click to set location</a>
)}
</>
) : (
<></>
)}
<>
<img src={GeoImg} onClick={onClick} alt="geo" />
{coordinateInfo ? (
<a onClick={onClick}>{coordinateInfo}</a>
) : (
<a onClick={onClick}>Click to set location</a>
)}
</>
)
</div>
);
};
Expand Down

0 comments on commit 22c5434

Please sign in to comment.