Merge branch 'dev' into feature/rating
This commit is contained in:
commit
69340e4b87
|
@ -39,6 +39,7 @@ export const PlayerPlaylist = (props: Props) => {
|
|||
}
|
||||
|
||||
const play = (index: number) => {
|
||||
props.onPlayMedia(index)
|
||||
const mi = props.media[index]
|
||||
gtag('event', 'select_item', {
|
||||
item_list_id: props.articleSlug,
|
||||
|
|
|
@ -23,6 +23,7 @@ import { Row2 } from '../../Feed/Row2'
|
|||
import { Row3 } from '../../Feed/Row3'
|
||||
import { Loading } from '../../_shared/Loading'
|
||||
|
||||
import { MODALS, hideModal } from '../../../stores/ui'
|
||||
import { byCreated } from '../../../utils/sortby'
|
||||
import stylesArticle from '../../Article/Article.module.scss'
|
||||
import styles from './Author.module.scss'
|
||||
|
@ -40,13 +41,14 @@ export const AuthorView = (props: Props) => {
|
|||
const { loadSubscriptions } = useFollowing()
|
||||
const { sortedArticles } = useArticlesStore({ shouts: props.shouts })
|
||||
const { authorEntities } = useAuthorsStore({ authors: [props.author] })
|
||||
const { page: getPage } = useRouter()
|
||||
const { page: getPage, searchParams } = useRouter()
|
||||
const [isLoadMoreButtonVisible, setIsLoadMoreButtonVisible] = createSignal(false)
|
||||
const [isBioExpanded, setIsBioExpanded] = createSignal(false)
|
||||
const [followers, setFollowers] = createSignal<Author[]>([])
|
||||
const [following, setFollowing] = createSignal<Array<Author | Topic>>([])
|
||||
const [showExpandBioControl, setShowExpandBioControl] = createSignal(false)
|
||||
const [commented, setCommented] = createSignal<Reaction[]>()
|
||||
const modal = MODALS[searchParams().m]
|
||||
|
||||
// current author
|
||||
const [author, setAuthor] = createSignal<Author>()
|
||||
|
@ -92,7 +94,13 @@ export const AuthorView = (props: Props) => {
|
|||
}
|
||||
}
|
||||
|
||||
onMount(() => fetchData(props.authorSlug))
|
||||
onMount(() => {
|
||||
fetchData(props.authorSlug)
|
||||
|
||||
if (!modal) {
|
||||
hideModal()
|
||||
}
|
||||
})
|
||||
|
||||
const loadMore = async () => {
|
||||
saveScrollPosition()
|
||||
|
|
|
@ -24,8 +24,8 @@ type Props = {
|
|||
layout: LayoutType
|
||||
}
|
||||
|
||||
export const PRERENDERED_ARTICLES_COUNT = 36
|
||||
const LOAD_MORE_PAGE_SIZE = 12
|
||||
export const PRERENDERED_ARTICLES_COUNT = 37
|
||||
const LOAD_MORE_PAGE_SIZE = 11
|
||||
|
||||
export const Expo = (props: Props) => {
|
||||
const [isLoaded, setIsLoaded] = createSignal<boolean>(Boolean(props.shouts))
|
||||
|
|
|
@ -15,12 +15,17 @@ export const getImageUrl = (
|
|||
src: string,
|
||||
options: { width?: number; height?: number; noSizeUrlPart?: boolean } = {},
|
||||
) => {
|
||||
const filename = src?.split('/').pop()
|
||||
const isAudio = src.toLowerCase().split('.').pop() in ['wav', 'mp3', 'ogg', 'aif', 'flac']
|
||||
const base = isAudio ? cdnUrl : `${thumborUrl}/unsafe/`
|
||||
const sizeUrlPart = isAudio ? '' : getSizeUrlPart(options)
|
||||
if (!src.includes('discours.io') && src.includes('http')) {
|
||||
return src
|
||||
}
|
||||
const filename = src.toLowerCase().split('/').pop()
|
||||
const ext = filename.split('.').pop()
|
||||
const isAudio = ext in ['wav', 'mp3', 'ogg', 'aif', 'flac']
|
||||
const base = isAudio ? cdnUrl : `${thumborUrl}/unsafe/`
|
||||
const suffix = isAudio || options.noSizeUrlPart ? '' : getSizeUrlPart(options)
|
||||
const subfolder = isAudio ? 'audio' : 'image'
|
||||
|
||||
return `${base}${sizeUrlPart}production/${isAudio ? 'audio' : 'image'}/${filename}`
|
||||
return `${base}${suffix}production/${subfolder}/${filename}`
|
||||
}
|
||||
|
||||
export const getOpenGraphImageUrl = (
|
||||
|
|
Loading…
Reference in New Issue
Block a user