cleanup code

This commit is contained in:
ilya-bkv 2024-03-15 17:58:34 +03:00
parent d202845aab
commit 00a0436835
3 changed files with 2 additions and 21 deletions

View File

@ -21,7 +21,6 @@ const PAGE_SIZE = 20
export const AuthorsList = (props: Props) => {
const { t } = useLocalize()
const { isOwnerSubscribed } = useFollowing()
const { authorsByShouts, authorsByFollowers } = useAuthorsStore()
const [loading, setLoading] = createSignal(false)
const [currentPage, setCurrentPage] = createSignal({ shouts: 0, followers: 0 })
@ -83,13 +82,7 @@ export const AuthorsList = (props: Props) => {
{(author) => (
<div class="row">
<div class="col-lg-20 col-xl-18">
<AuthorBadge
author={author}
isFollowed={{
loaded: !loading(),
value: isOwnerSubscribed(author.id),
}}
/>
<AuthorBadge author={author}/>
</div>
</div>
)}

View File

@ -30,7 +30,6 @@ type Props = {
export const Beside = (props: Props) => {
const { t } = useLocalize()
const { isOwnerSubscribed } = useFollowing()
return (
<Show when={!!props.beside?.slug && props.values?.length > 0}>
@ -86,12 +85,7 @@ export const Beside = (props: Props) => {
/>
</Show>
<Show when={props.wrapper === 'author'}>
<AuthorBadge
author={value as Author}
isFollowed={{
value: isOwnerSubscribed(value.id),
}}
/>
<AuthorBadge author={value as Author}/>
</Show>
<Show when={props.wrapper === 'article' && value?.slug}>
<ArticleCard

View File

@ -74,8 +74,6 @@ export const AllTopics = (props: Props) => {
return keys
})
const { isOwnerSubscribed } = useFollowing()
const showMore = () => setLimit((oldLimit) => oldLimit + PAGE_SIZE)
const [searchQuery, setSearchQuery] = createSignal('')
const filteredResults = createMemo(() => {
@ -190,10 +188,6 @@ export const AllTopics = (props: Props) => {
<>
<TopicBadge
topic={topic}
isFollowed={{
loaded: filteredResults().length > 0,
value: isOwnerSubscribed(topic.slug),
}}
showStat={true}
/>
</>