Merge pull request #3234 from omnivore-app/fix/web-site-name
show site name on library view on web if site name exists
This commit is contained in:
@ -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 ''
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user