cleanup code
This commit is contained in:
parent
d202845aab
commit
00a0436835
|
@ -21,7 +21,6 @@ const PAGE_SIZE = 20
|
||||||
|
|
||||||
export const AuthorsList = (props: Props) => {
|
export const AuthorsList = (props: Props) => {
|
||||||
const { t } = useLocalize()
|
const { t } = useLocalize()
|
||||||
const { isOwnerSubscribed } = useFollowing()
|
|
||||||
const { authorsByShouts, authorsByFollowers } = useAuthorsStore()
|
const { authorsByShouts, authorsByFollowers } = useAuthorsStore()
|
||||||
const [loading, setLoading] = createSignal(false)
|
const [loading, setLoading] = createSignal(false)
|
||||||
const [currentPage, setCurrentPage] = createSignal({ shouts: 0, followers: 0 })
|
const [currentPage, setCurrentPage] = createSignal({ shouts: 0, followers: 0 })
|
||||||
|
@ -83,13 +82,7 @@ export const AuthorsList = (props: Props) => {
|
||||||
{(author) => (
|
{(author) => (
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-20 col-xl-18">
|
<div class="col-lg-20 col-xl-18">
|
||||||
<AuthorBadge
|
<AuthorBadge author={author}/>
|
||||||
author={author}
|
|
||||||
isFollowed={{
|
|
||||||
loaded: !loading(),
|
|
||||||
value: isOwnerSubscribed(author.id),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -30,7 +30,6 @@ type Props = {
|
||||||
|
|
||||||
export const Beside = (props: Props) => {
|
export const Beside = (props: Props) => {
|
||||||
const { t } = useLocalize()
|
const { t } = useLocalize()
|
||||||
const { isOwnerSubscribed } = useFollowing()
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Show when={!!props.beside?.slug && props.values?.length > 0}>
|
<Show when={!!props.beside?.slug && props.values?.length > 0}>
|
||||||
|
@ -86,12 +85,7 @@ export const Beside = (props: Props) => {
|
||||||
/>
|
/>
|
||||||
</Show>
|
</Show>
|
||||||
<Show when={props.wrapper === 'author'}>
|
<Show when={props.wrapper === 'author'}>
|
||||||
<AuthorBadge
|
<AuthorBadge author={value as Author}/>
|
||||||
author={value as Author}
|
|
||||||
isFollowed={{
|
|
||||||
value: isOwnerSubscribed(value.id),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Show>
|
</Show>
|
||||||
<Show when={props.wrapper === 'article' && value?.slug}>
|
<Show when={props.wrapper === 'article' && value?.slug}>
|
||||||
<ArticleCard
|
<ArticleCard
|
||||||
|
|
|
@ -74,8 +74,6 @@ export const AllTopics = (props: Props) => {
|
||||||
return keys
|
return keys
|
||||||
})
|
})
|
||||||
|
|
||||||
const { isOwnerSubscribed } = useFollowing()
|
|
||||||
|
|
||||||
const showMore = () => setLimit((oldLimit) => oldLimit + PAGE_SIZE)
|
const showMore = () => setLimit((oldLimit) => oldLimit + PAGE_SIZE)
|
||||||
const [searchQuery, setSearchQuery] = createSignal('')
|
const [searchQuery, setSearchQuery] = createSignal('')
|
||||||
const filteredResults = createMemo(() => {
|
const filteredResults = createMemo(() => {
|
||||||
|
@ -190,10 +188,6 @@ export const AllTopics = (props: Props) => {
|
||||||
<>
|
<>
|
||||||
<TopicBadge
|
<TopicBadge
|
||||||
topic={topic}
|
topic={topic}
|
||||||
isFollowed={{
|
|
||||||
loaded: filteredResults().length > 0,
|
|
||||||
value: isOwnerSubscribed(topic.slug),
|
|
||||||
}}
|
|
||||||
showStat={true}
|
showStat={true}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user