Redirect to chat
This commit is contained in:
parent
c491edc8f7
commit
267b201732
|
@ -10,6 +10,8 @@ import { follow, unfollow } from '../../stores/zine/common'
|
|||
import { clsx } from 'clsx'
|
||||
import { useSession } from '../../context/session'
|
||||
import { FollowingEntity } from '../../graphql/types.gen'
|
||||
import { router, useRouter } from '../../stores/router'
|
||||
import { openPage } from '@nanostores/router'
|
||||
|
||||
interface AuthorCardProps {
|
||||
caption?: string
|
||||
|
@ -43,6 +45,11 @@ export const AuthorCard = (props: AuthorCardProps) => {
|
|||
: translit(props.author.name || '', locale() || 'ru')
|
||||
}
|
||||
// TODO: reimplement AuthorCard
|
||||
const { changeSearchParam } = useRouter()
|
||||
const handleInitChat = () => {
|
||||
openPage(router, 'inbox')
|
||||
changeSearchParam('openChat', `${props.author.id}`)
|
||||
}
|
||||
return (
|
||||
<div
|
||||
class={clsx(styles.author)}
|
||||
|
@ -127,6 +134,7 @@ export const AuthorCard = (props: AuthorCardProps) => {
|
|||
'button--subscribe-topic': props.isAuthorsList,
|
||||
[styles.buttonWrite]: props.liteButtons && props.isAuthorsList
|
||||
}}
|
||||
onClick={handleInitChat}
|
||||
>
|
||||
<Icon name="comment" class={styles.icon} />
|
||||
<Show when={!props.liteButtons}>{t('Write')}</Show>
|
||||
|
|
|
@ -7,3 +7,7 @@ export type AuthModalSearchParams = {
|
|||
export type ConfirmEmailSearchParams = {
|
||||
token: string
|
||||
}
|
||||
|
||||
export type CreateChatSearchParams = {
|
||||
id: number
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ export default gql`
|
|||
query GetAuthorBySlugQuery($slug: String!) {
|
||||
getAuthor(slug: $slug) {
|
||||
_id: slug
|
||||
id
|
||||
slug
|
||||
name
|
||||
bio
|
||||
|
|
|
@ -4,6 +4,7 @@ export default gql`
|
|||
query UserSubscribersQuery($slug: String!) {
|
||||
userSubcribers(slug: $slug) {
|
||||
_id: slug
|
||||
id
|
||||
slug
|
||||
name
|
||||
bio
|
||||
|
|
|
@ -4,6 +4,7 @@ export default gql`
|
|||
query UserFollowingQuery($slug: String!) {
|
||||
userFollowing(slug: $slug) {
|
||||
_id: slug
|
||||
id
|
||||
slug
|
||||
name
|
||||
bio
|
||||
|
|
|
@ -4,6 +4,7 @@ export default gql`
|
|||
query AuthorsAllQuery {
|
||||
authorsAll {
|
||||
_id: slug
|
||||
id
|
||||
slug
|
||||
name
|
||||
bio
|
||||
|
|
|
@ -4,6 +4,7 @@ export default gql`
|
|||
query AuthorLoadByQuery($by: AuthorsBy, $limit: Int, $offset: Int) {
|
||||
loadAuthorsBy(by: $by, limit: $limit, offset: $offset) {
|
||||
_id: slug
|
||||
id
|
||||
slug
|
||||
name
|
||||
bio
|
||||
|
|
Loading…
Reference in New Issue
Block a user