mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
show site name on library view on web if site name exists
This commit is contained in:
parent
d7a2a926d9
commit
bed50716ee
3 changed files with 8 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue