Profile settings fixes (#219)
This commit is contained in:
parent
a95a075755
commit
218c190d2e
|
@ -44,9 +44,9 @@ export const AuthorView = (props: Props) => {
|
||||||
const [followers, setFollowers] = createSignal<Author[]>([])
|
const [followers, setFollowers] = createSignal<Author[]>([])
|
||||||
const [subscriptions, setSubscriptions] = createSignal<Array<Author | Topic>>([])
|
const [subscriptions, setSubscriptions] = createSignal<Array<Author | Topic>>([])
|
||||||
const [bioWrapper, setBioWrapper] = createSignal<HTMLElement>()
|
const [bioWrapper, setBioWrapper] = createSignal<HTMLElement>()
|
||||||
const [bioContainer, setBioContainer] = createSignal<HTMLElement>()
|
|
||||||
const [showExpandBioControl, setShowExpandBioControl] = createSignal(false)
|
const [showExpandBioControl, setShowExpandBioControl] = createSignal(false)
|
||||||
|
|
||||||
|
const bioContainerRef: { current: HTMLDivElement } = { current: null }
|
||||||
const fetchSubscriptions = async (): Promise<{ authors: Author[]; topics: Topic[] }> => {
|
const fetchSubscriptions = async (): Promise<{ authors: Author[]; topics: Topic[] }> => {
|
||||||
try {
|
try {
|
||||||
const [getAuthors, getTopics] = await Promise.all([
|
const [getAuthors, getTopics] = await Promise.all([
|
||||||
|
@ -63,8 +63,8 @@ export const AuthorView = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkBioHeight = () => {
|
const checkBioHeight = () => {
|
||||||
if (bioContainer()) {
|
if (bioContainerRef.current) {
|
||||||
setShowExpandBioControl(bioContainer().offsetHeight > bioWrapper().offsetHeight)
|
setShowExpandBioControl(bioContainerRef.current.offsetHeight > bioWrapper().offsetHeight)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ export const AuthorView = (props: Props) => {
|
||||||
class={styles.longBio}
|
class={styles.longBio}
|
||||||
classList={{ [styles.longBioExpanded]: isBioExpanded() }}
|
classList={{ [styles.longBioExpanded]: isBioExpanded() }}
|
||||||
>
|
>
|
||||||
<div ref={setBioContainer}>{author().about}</div>
|
<div ref={(el) => (bioContainerRef.current = el)} innerHTML={author().about} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Show when={showExpandBioControl()}>
|
<Show when={showExpandBioControl()}>
|
||||||
|
|
|
@ -40,7 +40,6 @@ export const GrowingTextarea = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Show when={value()}>
|
|
||||||
<div
|
<div
|
||||||
class={clsx(styles.GrowingTextarea, {
|
class={clsx(styles.GrowingTextarea, {
|
||||||
[styles.bordered]: props.variant === 'bordered',
|
[styles.bordered]: props.variant === 'bordered',
|
||||||
|
@ -79,6 +78,5 @@ export const GrowingTextarea = (props: Props) => {
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user