Skip to content

Commit

Permalink
fix(Target): replace target type with isExternal
Browse files Browse the repository at this point in the history
  • Loading branch information
srmasharad committed Apr 19, 2023
1 parent 2ddcbc2 commit 24a94a6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/components/DetailedListView.astro
Expand Up @@ -9,7 +9,6 @@ interface Props {
subtitle: string;
items: DetailedListViewItem[];
showArrow?: boolean;
target?: string;
}
const { props } = Astro;
Expand All @@ -29,7 +28,7 @@ const { props } = Astro;
{
props.items.map((item) => {
return (
<a class="list item" href={normalizeUrl(item.href)} target={item.target} rel={item.target ? "noreferrer" : undefined}>
<a class="list item" href={normalizeUrl(item.href)} target={item.isExternal ? "_blank" : undefined} rel={item.isExternal ? "noreferrer" : undefined}>
<div class="title and intro">
<div class="title with badge">
<h3 class="title">{item.title}</h3>
Expand Down
2 changes: 1 addition & 1 deletion src/data/tools.ts
Expand Up @@ -50,7 +50,7 @@ const tools: Web3ToolItem[] = [
category: 'IPFS Gateway',
icon: 'code-square-01',
badges: [],
target: '_blank'
isExternal: true
}
]

Expand Down
2 changes: 1 addition & 1 deletion src/views/Web3Tools.astro
Expand Up @@ -21,7 +21,7 @@ const items = tools.map((tool) => {
category: tool.category,
icon: tool.icon,
href: tool.path || `/web3-tools/${tool.slug}/`,
target: tool.target,
isExternal: tool.isExternal,
};
});
---
Expand Down
4 changes: 2 additions & 2 deletions types/custom.d.ts
Expand Up @@ -94,7 +94,7 @@ interface DetailedListViewItem {
href: string
icon: string
category: string
target?: string
isExternal?: boolean
}

interface NamedIcon {
Expand Down Expand Up @@ -229,7 +229,7 @@ interface Web3ToolItem {
icon: string
text: string
}>
target?: '_blank' | '_self' | '_parent' | '_top'
isExternal?: boolean
}

interface TableRenderConfig<T> {
Expand Down

0 comments on commit 24a94a6

Please sign in to comment.