Skip to content

Commit

Permalink
feat(Add IPFS): Added IPFS list on web3 tools page (#78)
Browse files Browse the repository at this point in the history
* feat(Add IPFS): Added IPFS list on web3 tools page

* fix(Target): replace target type with isExternal

* fix(Section): remove duplicate target

* fix(Code Formatting): formatting issue fixed
  • Loading branch information
srmasharad committed Apr 19, 2023
1 parent 277e997 commit a38a5d6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/components/DetailedListView.astro
Expand Up @@ -28,7 +28,12 @@ const { props } = Astro;
{
props.items.map((item) => {
return (
<a class="list item" href={normalizeUrl(item.href)}>
<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
3 changes: 1 addition & 2 deletions src/components/Header/Section.astro
Expand Up @@ -22,8 +22,7 @@ const t = (x: any) => x;
<a
class="item container"
href={normalizeUrl(link.href)}
target={link.isExternal ? "_blank" : ""}
target={link.isExternal ? "_blank" : null}
target={link.isExternal ? "_blank" : undefined}
data-include-theme={link.includeTheme ? true : null}
>
{link.icon && <Icon size={"md"} variant={link.icon} />}
Expand Down
9 changes: 9 additions & 0 deletions src/data/tools.ts
Expand Up @@ -42,6 +42,15 @@ const tools: Web3ToolItem[] = [
category: 'Blockchain Hack Database',
icon: 'code-square-01',
badges: []
},
{
path: 'https://ipfs.neptunemutual.net/',
title: 'Neptune Mutual IPFS Gateway',
intro: 'Retrieve the IPFS content of our marketplace, the details surrounding our protocol.',
category: 'IPFS Gateway',
icon: 'code-square-01',
badges: [],
isExternal: true
}
]

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

interface NamedIcon {
Expand Down Expand Up @@ -228,6 +229,7 @@ interface Web3ToolItem {
icon: string
text: string
}>
isExternal?: boolean
}

interface TableRenderConfig<T> {
Expand Down

0 comments on commit a38a5d6

Please sign in to comment.