Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
Hide external links
Browse files Browse the repository at this point in the history
Closes #45.
  • Loading branch information
lujjjh committed Dec 20, 2021
1 parent fb14b5f commit 757ae6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion packages/lito/src/components/ResourceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ const PlayButton = styled.button`
`

const Resource = ({ value }: ResourceProps) => {
const { artwork, url, id, type } = value
const { link, artwork, url, id, type } = value
if (link) {
// Hide the resource if it's an external link.
return null
}
// TODO: some resource's artwork is optional, fallback to render the title?
if (!artwork) {
throw new Error(`artwork not found in resource: ${JSON.stringify(value)}`)
Expand Down

0 comments on commit 757ae6a

Please sign in to comment.