Skip to content

Commit

Permalink
Merge pull request #3234 from omnivore-app/fix/web-site-name
Browse files Browse the repository at this point in the history
show site name on library view on web if site name exists
  • Loading branch information
sywhb authored Dec 11, 2023
2 parents d7a2a92 + bed5071 commit 64fd0d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,13 @@ const flairIconForLabel = (label: Label): JSX.Element | undefined => {

export const siteName = (
originalArticleUrl: string,
itemUrl: string
itemUrl: string,
siteName?: string
): string => {
if (siteName) {
return siteName
}

if (shouldHideUrl(originalArticleUrl)) {
return ''
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const GridImage = (props: GridImageProps): JSX.Element => {
const LibraryGridCardContent = (props: LinkedItemCardProps): JSX.Element => {
const { isChecked, setIsChecked, item } = props
const [menuOpen, setMenuOpen] = useState(false)
const originText = siteName(props.item.originalArticleUrl, props.item.url)
const originText = siteName(props.item.originalArticleUrl, props.item.url, props.item.siteName)

const handleCheckChanged = useCallback(() => {
const newValue = !isChecked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export function LibraryListCardContent(
): JSX.Element {
const [menuOpen, setMenuOpen] = useState(false)
const { isChecked, setIsChecked, item } = props
const originText = siteName(props.item.originalArticleUrl, props.item.url)
const originText = siteName(props.item.originalArticleUrl, props.item.url, props.item.siteName)

const handleCheckChanged = useCallback(() => {
setIsChecked(item.id, !isChecked)
Expand Down

1 comment on commit 64fd0d7

@vercel
Copy link

@vercel vercel bot commented on 64fd0d7 Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.