refactor(web): ♻ ren License Url

This commit is contained in:
Collin M. Barrett 2020-08-29 14:59:34 -05:00
parent 73b8d72656
commit 4e1634ca65
3 changed files with 6 additions and 6 deletions

View file

@ -3,7 +3,7 @@ import * as React from "react";
interface Props {
name: string;
descriptionUrl?: string;
url?: string;
showLabel?: boolean;
}
@ -12,15 +12,15 @@ export const LicenseTag = (props: Props) =>
<span>
{props.showLabel && <h3>License:</h3>}
<Tag>
<TagContents name={props.name} descriptionUrl={props.descriptionUrl} />
<TagContents name={props.name} url={props.url} />
</Tag>
</span>
) : null;
const TagContents = (props: Props) =>
props.descriptionUrl ? (
props.url ? (
<a
href={props.descriptionUrl}
href={props.url}
title={`View ${props.name}'s homepage.`}
target="_blank"
rel="noopener noreferrer"

View file

@ -69,7 +69,7 @@ export const ListInfoDrawer = (props: RouteComponentProps & Props) => {
{props.license && (
<LicenseTag
name={props.license.name}
descriptionUrl={props.license.descriptionUrl}
url={props.license.url}
showLabel={true}
/>
)}

View file

@ -374,7 +374,7 @@ export const ListsTable = (props: RouteComponentProps & Props) => {
return license ? (
<LicenseTag
name={license.name}
descriptionUrl={license.descriptionUrl}
url={license.url}
showLabel={false}
/>
) : null;