Revert "o_0"
This reverts commit 899632a74d193e8c857541fe9adedf4e15434677.
This commit is contained in:
parent
417f2c6678
commit
c2f0ce0145
681
package-lock.json
generated
681
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -153,12 +153,12 @@ export const CommentsTree = (props: Props) => {
|
||||||
</Show>
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
<ul class={styles.comments}>
|
<ul class={styles.comments}>
|
||||||
<For each={sortedComments().filter((r) => !r.reply_to)}>
|
<For each={sortedComments().filter((r) => !r.replyTo)}>
|
||||||
{(reaction) => (
|
{(reaction) => (
|
||||||
<Comment
|
<Comment
|
||||||
sortedComments={sortedComments()}
|
sortedComments={sortedComments()}
|
||||||
isArticleAuthor={Boolean(
|
isArticleAuthor={Boolean(
|
||||||
props.articleAuthors.some((a) => a.slug === reaction.created_by.slug),
|
props.articleAuthors.some((a) => a?.slug === reaction.created_by.slug),
|
||||||
)}
|
)}
|
||||||
comment={reaction}
|
comment={reaction}
|
||||||
clickedReply={(id) => setClickedReplyId(id)}
|
clickedReply={(id) => setClickedReplyId(id)}
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
import { clsx } from 'clsx'
|
import { clsx } from 'clsx'
|
||||||
import { createEffect, createMemo, createSignal, Show } from 'solid-js'
|
import { createEffect, createMemo, createSignal, Show } from 'solid-js'
|
||||||
|
|
||||||
import { useLocalize } from '../../../context/localize'
|
import styles from './TopicBadge.module.scss'
|
||||||
import { useMediaQuery } from '../../../context/mediaQuery'
|
|
||||||
import { useSession } from '../../../context/session'
|
|
||||||
import { FollowingEntity, Topic } from '../../../graphql/schema/core.gen'
|
import { FollowingEntity, Topic } from '../../../graphql/schema/core.gen'
|
||||||
|
import { createMemo, createSignal, Show } from 'solid-js'
|
||||||
|
import { imageProxy } from '../../../utils/imageProxy'
|
||||||
|
import { Button } from '../../_shared/Button'
|
||||||
|
import { useSession } from '../../../context/session'
|
||||||
|
import { useLocalize } from '../../../context/localize'
|
||||||
import { follow, unfollow } from '../../../stores/zine/common'
|
import { follow, unfollow } from '../../../stores/zine/common'
|
||||||
import { capitalize } from '../../../utils/capitalize'
|
import { capitalize } from '../../../utils/capitalize'
|
||||||
import { getImageUrl } from '../../../utils/getImageUrl'
|
import { getImageUrl } from '../../../utils/getImageUrl'
|
||||||
|
@ -19,16 +22,16 @@ type Props = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TopicBadge = (props: Props) => {
|
export const TopicBadge = (props: Props) => {
|
||||||
const { t, lang } = useLocalize()
|
|
||||||
const { mediaMatches } = useMediaQuery()
|
|
||||||
const [isMobileView, setIsMobileView] = createSignal(false)
|
|
||||||
const [isSubscribing, setIsSubscribing] = createSignal(false)
|
const [isSubscribing, setIsSubscribing] = createSignal(false)
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
setIsMobileView(!mediaMatches.sm)
|
setIsMobileView(!mediaMatches.sm)
|
||||||
})
|
})
|
||||||
|
const { t } = useLocalize()
|
||||||
const {
|
const {
|
||||||
subscriptions,
|
subscriptions,
|
||||||
actions: { loadSubscriptions },
|
actions: { loadSubscriptions, loadSession },
|
||||||
|
isAuthenticated,
|
||||||
|
session,
|
||||||
} = useSession()
|
} = useSession()
|
||||||
|
|
||||||
const subscribed = createMemo(() =>
|
const subscribed = createMemo(() =>
|
||||||
|
@ -51,18 +54,10 @@ export const TopicBadge = (props: Props) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class={styles.TopicBadge}>
|
<div class={styles.TopicBadge}>
|
||||||
<div class={styles.basicInfo}>
|
|
||||||
<a
|
<a
|
||||||
href={`/topic/${props.topic.slug}`}
|
href={`/topic/${props.topic.slug}`}
|
||||||
class={clsx(styles.picture, {
|
class={clsx(styles.picture, { [styles.withImage]: props.topic.pic })}
|
||||||
[styles.withImage]: props.topic.pic,
|
style={props.topic.pic && { 'background-image': `url('${imageProxy(props.topic.pic)}')` }}
|
||||||
[styles.smallSize]: isMobileView(),
|
|
||||||
})}
|
|
||||||
style={
|
|
||||||
props.topic.pic && {
|
|
||||||
'background-image': `url('${getImageUrl(props.topic.pic, { width: 40, height: 40 })}')`,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
<a href={`/topic/${props.topic.slug}`} class={styles.info}>
|
<a href={`/topic/${props.topic.slug}`} class={styles.info}>
|
||||||
<span class={styles.title}>{title()}</span>
|
<span class={styles.title}>{title()}</span>
|
||||||
|
@ -77,13 +72,16 @@ export const TopicBadge = (props: Props) => {
|
||||||
<div class={clsx('text-truncate', styles.description)}>{props.topic.body}</div>
|
<div class={clsx('text-truncate', styles.description)}>{props.topic.body}</div>
|
||||||
</Show>
|
</Show>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
<Show when={isAuthenticated()}>
|
||||||
|
|
||||||
<div class={styles.actions}>
|
<div class={styles.actions}>
|
||||||
<Show
|
<Show
|
||||||
when={!props.minimizeSubscribeButton}
|
when={!props.minimizeSubscribeButton}
|
||||||
fallback={
|
fallback={
|
||||||
<CheckButton text={t('Follow')} checked={subscribed()} onClick={() => subscribe(!subscribed)} />
|
<CheckButton
|
||||||
|
text={t('Follow')}
|
||||||
|
checked={subscribed()}
|
||||||
|
onClick={() => subscribe(!subscribed)}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Show
|
<Show
|
||||||
|
@ -92,7 +90,7 @@ export const TopicBadge = (props: Props) => {
|
||||||
<Button
|
<Button
|
||||||
variant="primary"
|
variant="primary"
|
||||||
size="S"
|
size="S"
|
||||||
value={isSubscribing() ? t('subscribing...') : t('Subscribe')}
|
value={isSubscribing() ? t('...subscribing') : t('Subscribe')}
|
||||||
onClick={() => subscribe(true)}
|
onClick={() => subscribe(true)}
|
||||||
class={styles.subscribeButton}
|
class={styles.subscribeButton}
|
||||||
/>
|
/>
|
||||||
|
@ -108,6 +106,7 @@ export const TopicBadge = (props: Props) => {
|
||||||
</Show>
|
</Show>
|
||||||
</Show>
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,8 +181,6 @@ export const InboxView = (props: Props) => {
|
||||||
setIsScrollToNewVisible(false)
|
setIsScrollToNewVisible(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
const isLoaded = createMemo(() => props.isLoaded)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class={clsx('container', styles.Inbox)}>
|
<div class={clsx('container', styles.Inbox)}>
|
||||||
<Modal variant="narrow" name="inviteToChat">
|
<Modal variant="narrow" name="inviteToChat">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user