diff --git a/package-lock.json b/package-lock.json index 22434ac0fa..0fef0300c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "matters-web", - "version": "3.11.0", + "version": "3.12.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8ea219bd62..1c8e2e6522 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matters-web", - "version": "3.12.0", + "version": "3.12.1", "description": "codebase of Matters' website", "sideEffects": false, "author": "Matters ", diff --git a/src/components/ArticleDigest/DropdownActions/SetTagUnselectedButton.tsx b/src/components/ArticleDigest/DropdownActions/SetTagUnselectedButton.tsx index 2d1a5e5766..95567f83f9 100644 --- a/src/components/ArticleDigest/DropdownActions/SetTagUnselectedButton.tsx +++ b/src/components/ArticleDigest/DropdownActions/SetTagUnselectedButton.tsx @@ -57,9 +57,10 @@ const SetTagUnselectedButton = ({ variables: { id: tagId, articles: [article.id] }, update: (cache) => { try { + // FIXME: circular dependencies const { TAG_ARTICLES_PUBLIC: query, - } = require('~/components/GQL/queries/tagArticles').default + } = require('~/components/GQL/queries/tagArticles') const variables = { id: tagId, selected: true } const data = cache.readQuery({ query, variables }) const node = _get(data, 'node', {}) as TagArticlesPublic_node_Tag diff --git a/src/components/DropdownDialog/index.tsx b/src/components/DropdownDialog/index.tsx index 5fdd5bf0ba..26a7f8a320 100644 --- a/src/components/DropdownDialog/index.tsx +++ b/src/components/DropdownDialog/index.tsx @@ -12,7 +12,7 @@ import { useResponsive, } from '~/components' -import { KEYCODES, TEXT, TextId } from '~/common/enums' +import { KEYCODES, TEXT, TextId, Z_INDEX } from '~/common/enums' /** * This is a responsive component which will show @@ -113,12 +113,14 @@ const BaseDropdownDialog = ({ if (isSmallUp) { return ( {dropdown.content}} onHidden={close} onClickOutside={close} visible={showDialog} + zIndex={Z_INDEX.OVER_STICKY_TABS} + appendTo={process.browser ? document.body : undefined} + {...dropdown} + content={{dropdown.content}} > diff --git a/src/components/GQL/updates/userArticles.ts b/src/components/GQL/updates/userArticles.ts index 9870c8a623..693fa6afd3 100644 --- a/src/components/GQL/updates/userArticles.ts +++ b/src/components/GQL/updates/userArticles.ts @@ -28,7 +28,7 @@ const update = ({ // FIXME: circular dependencies const { USER_ARTICLES_PUBLIC, - } = require('~/components/GQL/queries/userArticles').default + } = require('~/components/GQL/queries/userArticles') if (!userName) { return diff --git a/src/components/UserProfile/DropdownActions/index.tsx b/src/components/UserProfile/DropdownActions/index.tsx index ece1ad61c5..5fabd64e72 100644 --- a/src/components/UserProfile/DropdownActions/index.tsx +++ b/src/components/UserProfile/DropdownActions/index.tsx @@ -13,7 +13,7 @@ import { } from '~/components' import { BlockUser } from '~/components/BlockUser' -import { TEXT, Z_INDEX } from '~/common/enums' +import { TEXT } from '~/common/enums' import { DropdownActionsUserPublic } from './__generated__/DropdownActionsUserPublic' @@ -74,8 +74,6 @@ const BaseDropdownActions = ({ dropdown={{ content: , placement: 'bottom-end', - zIndex: Z_INDEX.OVER_STICKY_TABS, - appendTo: process.browser ? document.body : undefined, }} dialog={{ content: , diff --git a/src/views/TagDetail/Articles/index.tsx b/src/views/TagDetail/Articles/index.tsx index fb890dac0c..7faf844bcd 100644 --- a/src/views/TagDetail/Articles/index.tsx +++ b/src/views/TagDetail/Articles/index.tsx @@ -179,7 +179,8 @@ const TagDetailArticles = ({ tagId, selected }: TagArticlesProps) => { location: i, }) } - inTagDetailLatest + inTagDetailSelected={selected} + inTagDetailLatest={!selected} /> ))} diff --git a/src/views/TagDetail/Buttons/AddButton/index.tsx b/src/views/TagDetail/Buttons/AddButton/index.tsx index 648112f960..7c3e64b040 100644 --- a/src/views/TagDetail/Buttons/AddButton/index.tsx +++ b/src/views/TagDetail/Buttons/AddButton/index.tsx @@ -17,7 +17,7 @@ import { import { useMutation } from '~/components/GQL' import CREATE_DRAFT from '~/components/GQL/mutations/createDraft' -import { ADD_TOAST, Z_INDEX } from '~/common/enums' +import { ADD_TOAST } from '~/common/enums' import { analytics, parseFormSubmitErrors, @@ -158,8 +158,6 @@ const BaseDropdownActions = ({ dropdown={{ content: , placement: 'bottom-end', - zIndex: Z_INDEX.OVER_STICKY_TABS, - appendTo: process.browser ? document.body : undefined, }} dialog={{ content: , diff --git a/src/views/TagDetail/DropdownActions/index.tsx b/src/views/TagDetail/DropdownActions/index.tsx index 3b0d36c00b..66e93de2aa 100644 --- a/src/views/TagDetail/DropdownActions/index.tsx +++ b/src/views/TagDetail/DropdownActions/index.tsx @@ -13,7 +13,7 @@ import { useResponsive, } from '~/components' -import { TEXT, Z_INDEX } from '~/common/enums' +import { TEXT } from '~/common/enums' type DropdownActionsProps = { isMaintainer: boolean @@ -56,8 +56,6 @@ const BaseDropdownActions = ({ dropdown={{ content: , placement: 'bottom-end', - zIndex: Z_INDEX.OVER_STICKY_TABS, - appendTo: process.browser ? document.body : undefined, }} dialog={{ content: , diff --git a/src/views/TagDetail/gql.ts b/src/views/TagDetail/gql.ts index 0c9e44a428..dd855c7acc 100644 --- a/src/views/TagDetail/gql.ts +++ b/src/views/TagDetail/gql.ts @@ -22,6 +22,9 @@ export const TAG_DETAIL_PUBLIC = gql` id ...UserDigestMiniUser } + selectedArticles: articles(input: { first: 0, selected: true }) { + totalCount + } ...FollowersTag ...ArticleCountTag ...FollowButtonTagPrivate diff --git a/src/views/TagDetail/index.tsx b/src/views/TagDetail/index.tsx index 1e9366ef8d..bb7519f2c0 100644 --- a/src/views/TagDetail/index.tsx +++ b/src/views/TagDetail/index.tsx @@ -53,7 +53,7 @@ const TagDetail = ({ tag }: { tag: TagDetailPublic_node_Tag }) => { const viewer = useContext(ViewerContext) // feed type - const hasSelected = (tag?.articles.totalCount || 0) > 0 + const hasSelected = (tag?.selectedArticles.totalCount || 0) > 0 const [feed, setFeed] = useState( hasSelected ? 'selected' : 'latest' )