diff --git a/mdx.config.ts b/mdx.config.ts index 71ef2e8f..a6a87346 100644 --- a/mdx.config.ts +++ b/mdx.config.ts @@ -26,7 +26,7 @@ export const markdownOptions: AstroUserConfig['markdown'] = { remarkPlugins: [remarkCodeTitles], rehypePlugins: [ rehypeSlug, - [rehypeToc as RehypePlugin, { headings: ['h1', 'h2', 'h3'] }], + [rehypeToc as RehypePlugin, { headings: ['h1', 'h2', 'h3'] }], [rehypeAutolinkHeadings, { behavior: 'prepend' }], [addClasses, { 'h1,h2,h3': 'title' }] ], diff --git a/src/components/Feed/Sidebar.tsx b/src/components/Feed/Sidebar.tsx index 3eadd9ef..b347310e 100644 --- a/src/components/Feed/Sidebar.tsx +++ b/src/components/Feed/Sidebar.tsx @@ -63,8 +63,8 @@ export const FeedSidebar = (props: FeedSidebarProps) => { - - {(authorSlug) => ( + + {(authorSlug: string) => (
  • @{authorSlug} @@ -74,8 +74,8 @@ export const FeedSidebar = (props: FeedSidebarProps) => { )} - - {(topicSlug) => ( + + {(topicSlug: string) => (
  • {topicEntities()[topicSlug]?.title} diff --git a/src/components/Nav/Private.tsx b/src/components/Nav/Private.tsx index 4675a614..3330ff02 100644 --- a/src/components/Nav/Private.tsx +++ b/src/components/Nav/Private.tsx @@ -26,7 +26,7 @@ export default () => { {/*FIXME: replace with route*/}
    - +
    diff --git a/src/components/Topic/Card.tsx b/src/components/Topic/Card.tsx index 2544ae6c..257dad2e 100644 --- a/src/components/Topic/Card.tsx +++ b/src/components/Topic/Card.tsx @@ -24,11 +24,11 @@ export const TopicCard = (props: TopicProps) => { const { session } = useAuthStore() const subscribed = createMemo(() => { - if (!session()?.user?.slug || !session()?.info?.topics) { + if (!session()?.user?.slug || !session()?.news?.topics) { return false } - return props.topic.slug in session().info.topics + return session()?.news.topics.includes(props.topic.slug) }) // FIXME use store actions diff --git a/src/components/Topic/Full.tsx b/src/components/Topic/Full.tsx index a7641366..7219c961 100644 --- a/src/components/Topic/Full.tsx +++ b/src/components/Topic/Full.tsx @@ -14,7 +14,7 @@ type Props = { export const FullTopic = (props: Props) => { const { session } = useAuthStore() - const subscribed = createMemo(() => session()?.info?.topics?.includes(props.topic?.slug)) + const subscribed = createMemo(() => session()?.news?.topics?.includes(props.topic?.slug)) return (
    diff --git a/src/components/Views/AllAuthors.tsx b/src/components/Views/AllAuthors.tsx index 2c141739..dbe5ddc4 100644 --- a/src/components/Views/AllAuthors.tsx +++ b/src/components/Views/AllAuthors.tsx @@ -26,7 +26,7 @@ export const AllAuthorsView = (props: Props) => { const { session } = useAuthStore() - const subscribed = (s) => Boolean(session()?.info?.authors && session()?.info?.authors?.includes(s || '')) + const subscribed = (s) => Boolean(session()?.news?.authors && session()?.news?.authors?.includes(s || '')) const { getSearchParams } = useRouter() diff --git a/src/components/Views/AllTopics.tsx b/src/components/Views/AllTopics.tsx index 857fb1eb..fa40f8fe 100644 --- a/src/components/Views/AllTopics.tsx +++ b/src/components/Views/AllTopics.tsx @@ -33,7 +33,7 @@ export const AllTopicsView = (props: AllTopicsViewProps) => { setSortAllTopicsBy(getSearchParams().by || 'shouts') }) - const subscribed = (s) => Boolean(session()?.info?.topics && session()?.info?.topics?.includes(s || '')) + const subscribed = (s) => Boolean(session()?.news?.topics && session()?.news?.topics?.includes(s || '')) return (
    diff --git a/src/graphql/mutation/my-session.ts b/src/graphql/mutation/my-session.ts index 49c95baa..fa09c87f 100644 --- a/src/graphql/mutation/my-session.ts +++ b/src/graphql/mutation/my-session.ts @@ -13,7 +13,8 @@ export default gql` userpic links } - info { + news { + unread inbox topics authors diff --git a/src/graphql/types.gen.ts b/src/graphql/types.gen.ts index f57b48ff..9f318698 100644 --- a/src/graphql/types.gen.ts +++ b/src/graphql/types.gen.ts @@ -16,7 +16,7 @@ export type Scalars = { export type AuthResult = { error?: Maybe - info?: Maybe + news?: Maybe token?: Maybe user?: Maybe } @@ -638,14 +638,6 @@ export type Role = { permissions: Array } -export type SessionInfo = { - authors?: Maybe>> - communities?: Maybe>> - reactions?: Maybe>> - topics?: Maybe>> - unread?: Maybe -} - export type Shout = { authors?: Maybe>> body: Scalars['String'] @@ -773,6 +765,14 @@ export type User = { wasOnlineAt?: Maybe } +export type UserFollowings = { + authors?: Maybe>> + communities?: Maybe>> + reactions?: Maybe>> + topics?: Maybe>> + unread?: Maybe +} + export type UserNotification = { id: Scalars['Int'] kind: Scalars['String']