Skip to content

Commit

Permalink
feat(new-article-path): Revise pathname of article detail page #4196
Browse files Browse the repository at this point in the history
for #4196
  • Loading branch information
tx0c authored and TomasC committed Mar 7, 2024
1 parent 35f2841 commit c2847f1
Show file tree
Hide file tree
Showing 3 changed files with 283 additions and 100 deletions.
3 changes: 3 additions & 0 deletions src/pages/a/[shortHash].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ArticleDetail from '~/views/ArticleDetail'

export default ArticleDetail
41 changes: 35 additions & 6 deletions src/views/ArticleDetail/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import gql from 'graphql-tag'

import { UserDigest } from '~/components/UserDigest'

import { AuthorSidebar } from './AuthorSidebar'
import { FromAuthor } from './AuthorSidebar/FromAuthor'
import { RelatedArticles } from './AuthorSidebar/RelatedArticles'
import Content from './Content'
import MetaInfo from './MetaInfo'
import RelatedArticles from './RelatedArticles'
import State from './State'
import { fragments as supportWidgetFragments } from './SupportWidget/gql'
import TagList from './TagList'
Expand All @@ -17,6 +19,7 @@ const articlePublicFragment = gql`
title
slug
mediaHash
shortHash
state
cover
summary
Expand All @@ -42,6 +45,7 @@ const articlePublicFragment = gql`
}
}
canComment
commentCount
license
sensitiveByAuthor
sensitiveByAdmin
Expand All @@ -61,20 +65,24 @@ const articlePublicFragment = gql`
language
}
availableTranslations
...AuthorSidebarArticle
...MetaInfoArticle
...ContentArticle
...TagListArticle
...RelatedArticles
...AuthorSidebarRelatedArticles
...AuthorSidebarFromAuthor
...StateArticle
...ToolbarArticlePublic
...ToolbarArticlePrivate
...SupportWidgetArticlePublic
...SupportWidgetArticlePrivate
}
${AuthorSidebar.fragments.article}
${MetaInfo.fragments.article}
${Content.fragments.article}
${TagList.fragments.article}
${RelatedArticles.fragments.article}
${FromAuthor.fragments.article}
${State.fragments.article}
${UserDigest.Rich.fragments.user.public}
${UserDigest.Rich.fragments.user.private}
Expand All @@ -87,8 +95,8 @@ const articlePublicFragment = gql`
`

export const ARTICLE_AVAILABLE_TRANSLATIONS = gql`
query ArticleAvailableTranslations($mediaHash: String!) {
article(input: { mediaHash: $mediaHash }) {
query ArticleAvailableTranslations($mediaHash: String, $shortHash: String) {
article(input: { mediaHash: $mediaHash, shortHash: $shortHash }) {
id
availableTranslations
}
Expand All @@ -108,12 +116,13 @@ export const ARTICLE_AVAILABLE_TRANSLATIONS_BY_NODE_ID = gql`

export const ARTICLE_DETAIL_PUBLIC = gql`
query ArticleDetailPublic(
$mediaHash: String!
$mediaHash: String
$shortHash: String
$language: UserLanguage!
$includeTranslation: Boolean = false
$includeCanSuperLike: Boolean = true
) {
article(input: { mediaHash: $mediaHash }) {
article(input: { mediaHash: $mediaHash, shortHash: $shortHash }) {
...ArticlePublicArticle
}
}
Expand Down Expand Up @@ -177,3 +186,23 @@ export const ARTICLE_TRANSLATION = gql`
}
}
`

export const EDIT_ARTICLE_SUPPORT_SETTING = gql`
mutation EditArticleSupportSetting(
$id: ID!
$requestForDonation: requestForDonation_String_maxLength_140
$replyToDonator: replyToDonator_String_maxLength_140
) {
editArticle(
input: {
id: $id
requestForDonation: $requestForDonation
replyToDonator: $replyToDonator
}
) {
id
requestForDonation
replyToDonator
}
}
`
Loading

0 comments on commit c2847f1

Please sign in to comment.