Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzen1 committed May 9, 2024
1 parent 9508e77 commit 5d1c8a7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions govtool/frontend/src/pages/DRepDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const DRepDetails = ({ isConnected }: DRepDetailsProps) => {
</DRepDetailsInfoItem>
{/* TODO: fetch metadata, add views for metadata errors */}
<DRepDetailsInfoItem label={t("email")}>
{/* TODO: change email*/}
{/* TODO: change email */}
<MoreInfoLink
label="darlenelonglink.DRepwebsiteorwhatever.com"
navTo="example@gmail.com"
Expand All @@ -189,7 +189,7 @@ export const DRepDetails = ({ isConnected }: DRepDetailsProps) => {
flexDirection="column"
gap={1.5}
>
{/* TODO: update links*/}
{/* TODO: update links */}
{LINKS.map((link) => (
<MoreInfoLink
key={link}
Expand Down Expand Up @@ -310,8 +310,14 @@ type LinkWithIconProps = {
};

const MoreInfoLink = ({ label, navTo, isEmail = false }: LinkWithIconProps) => {
const openLink = () =>
isEmail ? window.location.assign(`mailto:${navTo}`) : openInNewTab(navTo);
const openLink = () => {
if (isEmail) {
window.location.assign(`mailto:${navTo}`);

return;
}
openInNewTab(navTo);
};

return (
<ButtonBase
Expand Down

0 comments on commit 5d1c8a7

Please sign in to comment.