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