[WiP] tree comments

This commit is contained in:
ilya-bkv 2022-12-23 10:50:02 +03:00
parent 5b7e249dd5
commit e85e011694
3 changed files with 9 additions and 28 deletions

View File

@ -9,32 +9,11 @@
margin-bottom: 0; margin-bottom: 0;
} }
.comment { $levels: 0, 1, 2, 3, 4;
&:before, $padding: 1rem;
&:after { @each $level in $levels {
content: ''; &.commentLevel-#{level} {
left: 0; padding-left: $padding * $level;
position: absolute;
}
&:before {
border-bottom: 2px solid #ccc;
border-left: 2px solid #ccc;
border-radius: 0 0 0 1.2rem;
top: -1rem;
height: 2.4rem;
width: 1.2rem;
}
&:after {
background: #ccc;
height: 100%;
top: 0;
width: 2px;
}
&:last-child:after {
display: none;
} }
} }

View File

@ -51,8 +51,10 @@ export default (props: Props) => {
formatDate(new Date(comment()?.createdAt), { hour: 'numeric', minute: 'numeric' }) formatDate(new Date(comment()?.createdAt), { hour: 'numeric', minute: 'numeric' })
) )
console.log('!!! lvl:', props.level)
return ( return (
<li class={clsx(styles.comment, { [styles[`commentLevel${props.level}`]]: Boolean(props.level) })}> <li class={clsx(styles.comment, { [styles[`commentLevel-${props.level}`]]: props.level })}>
{props.level}
<Show when={!!body()}> <Show when={!!body()}>
<div class={styles.commentContent}> <div class={styles.commentContent}>
<Show <Show

View File

@ -238,7 +238,7 @@ export type MutationDeleteMessageArgs = {
} }
export type MutationDeleteReactionArgs = { export type MutationDeleteReactionArgs = {
id: Scalars['Int'] reaction: Scalars['Int']
} }
export type MutationDeleteShoutArgs = { export type MutationDeleteShoutArgs = {