diff --git a/package.json b/package.json
index 50b2bf13..6b01203d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "matters-oss",
- "version": "0.34.0",
+ "version": "0.35.0",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.2.1",
diff --git a/src/components/Tag/DigestList/index.tsx b/src/components/Tag/DigestList/index.tsx
index 5afd109b..2380c318 100644
--- a/src/components/Tag/DigestList/index.tsx
+++ b/src/components/Tag/DigestList/index.tsx
@@ -7,7 +7,7 @@ import DateTime from '../../DateTime'
import SetBoost from '../../SetBoost'
import TagLink from '../../Tag/Link'
import TagStateTag from '../../Tag/StateTag'
-import ToggleSelected from '../ToggleSelected'
+// import ToggleSelected from '../ToggleSelected'
import withTagMutaitons, {
TagMutationsChildProps,
} from '../../../hocs/withTagMutations'
@@ -448,7 +448,7 @@ class TagDigestList extends React.Component<
width={100}
/>
)}
- {inRecommendedTagsPage && (
+ {/* {inRecommendedTagsPage && (
dataIndex="oss.selected"
title="推薦精選"
@@ -457,7 +457,7 @@ class TagDigestList extends React.Component<
)}
/>
- )}
+ )} */}
>
)
diff --git a/src/components/Tag/ToggleSelected/index.tsx b/src/components/Tag/ToggleSelected/index.tsx
deleted file mode 100644
index 30bf3fdb..00000000
--- a/src/components/Tag/ToggleSelected/index.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import * as React from 'react'
-import { Switch } from 'antd'
-import _get from 'lodash/get'
-
-import ErrorMessage from '../../ErrorMessage'
-import withToggleSelected, { ChildProps } from './withToggleSelected'
-
-type ToggleSelectedState = {
- checked: boolean
- loading: boolean
- error: any
-}
-
-class ToggleSelected extends React.Component {
- state: Readonly = {
- checked: this.props.checked,
- loading: false,
- error: null,
- }
-
- private _onChange = async () => {
- this.setState({ loading: true, error: null })
-
- const { mutate, tagId } = this.props
-
- try {
- const result = await mutate({
- variables: {
- input: {
- id: tagId,
- enabled: !this.state.checked,
- },
- },
- })
- const selected = _get(result, 'data.toggleTagRecommend.oss.selected')
- this.setState({ checked: selected, loading: false, error: null })
- } catch (error) {
- this.setState({ loading: false, error })
- }
- }
-
- public render() {
- const { checked, loading, error } = this.state
-
- if (error) {
- return
- }
-
- return (
-
- )
- }
-}
-
-export default withToggleSelected(ToggleSelected)
diff --git a/src/components/Tag/ToggleSelected/withToggleSelected.ts b/src/components/Tag/ToggleSelected/withToggleSelected.ts
deleted file mode 100644
index 0ceed74b..00000000
--- a/src/components/Tag/ToggleSelected/withToggleSelected.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { graphql, ChildMutateProps } from 'react-apollo'
-import gql from 'graphql-tag'
-
-const TOGGLE_TAG_SELECTED = gql`
- mutation ToggleTagSelected($input: ToggleRecommendInput!) {
- toggleTagRecommend(input: $input) {
- id
- oss {
- selected
- }
- }
- }
-`
-
-type Response = {
- toggleTagSelected: {
- oss: {
- selected: boolean
- }
- }
-}
-
-type InputProps = {
- checked: boolean
- tagId: string
-}
-
-type Variables = {
- input: {
- id: string
- enabled: boolean
- }
-}
-
-export type ChildProps = ChildMutateProps
-
-const withToggleSelected = graphql(
- TOGGLE_TAG_SELECTED
-)
-
-export default withToggleSelected
diff --git a/src/components/User/ResetWallet/index.tsx b/src/components/User/ResetWallet/index.tsx
deleted file mode 100644
index efc05824..00000000
--- a/src/components/User/ResetWallet/index.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import * as React from 'react'
-import { Button, Modal, message, Tag } from 'antd'
-
-import withResetWallet, { ChildProps } from './withResetWallet'
-import { ApolloError } from 'apollo-client'
-
-type ResetWalletState = {
- loading: boolean
- error: any
-}
-
-class ResetWallet extends React.Component {
- state: Readonly = {
- loading: false,
- error: null,
- }
-
- private action = async (resetWallet: any): Promise => {
- const { id } = this.props
- if (!resetWallet) {
- return
- }
-
- this.setState((prev) => ({
- ...prev,
- loading: true,
- error: null,
- }))
-
- try {
- const result = await resetWallet({
- variables: {
- input: {
- id,
- },
- },
- })
- message.success('重置成功')
- } catch (error) {
- this.setState(
- (prev) => ({ ...prev, loading: false, error }),
- () => {
- if (error instanceof ApolloError) {
- message.error(`重置失敗: ${error}`)
- } else {
- message.error('重置失敗')
- }
- }
- )
- }
- }
-
- private _onReset = async () => {
- const { mutate, ethAddress } = this.props
- Modal.confirm({
- title: `確認重置此用户加密錢包?`,
- cancelText: '取消',
- okText: '確認重置',
- onOk: async () => {
- await this.action(mutate)
- },
- })
- }
-
- public render() {
- const { loading } = this.state
- const { ethAddress } = this.props
-
- return (
-
- )
- }
-}
-
-export default withResetWallet(ResetWallet)
diff --git a/src/components/User/ResetWallet/withResetWallet.ts b/src/components/User/ResetWallet/withResetWallet.ts
deleted file mode 100644
index 462fd560..00000000
--- a/src/components/User/ResetWallet/withResetWallet.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { graphql, ChildMutateProps } from 'react-apollo'
-import gql from 'graphql-tag'
-
-const RESET_WALLET = gql`
- mutation ResetWallet($input: ResetWalletInput!) {
- resetWallet(input: $input) {
- id
- __typename
- }
- }
-`
-
-type Response = {
- resetWallet: {
- user: {
- id: string
- }
- }
-}
-
-type InputProps = {
- id: string
- ethAddress: string | undefined
-}
-
-type Variables = {
- input: {
- id: string
- }
-}
-
-export type ChildProps = ChildMutateProps
-
-const withResetWallet = graphql(
- RESET_WALLET
-)
-
-export default withResetWallet
diff --git a/src/definitions/index.d.ts b/src/definitions/index.d.ts
index 970f1399..50ff5015 100644
--- a/src/definitions/index.d.ts
+++ b/src/definitions/index.d.ts
@@ -85,7 +85,6 @@ export type TagDigest = {
oss: {
boost: number
score: number
- selected: boolean
}
deleted: boolean
}
@@ -93,16 +92,6 @@ export type TagDigest = {
export type TagDetail = TagDigest & {
articles: Connection
remark: string
- creator: {
- id: string
- userName: string
- displayName: string
- }
- editors: Array<{
- id: string
- userName: string
- displayName: string
- }>
}
/**
@@ -143,8 +132,6 @@ export type ArticleDetail = ArticleDigest & {
appreciationsReceivedTotal: number
collection: Connection
collectedBy: Connection
- subscribers: UserDigest[]
- subscribed: boolean
hasAppreciate: boolean
remark: string
comments: Connection
diff --git a/src/definitions/schema.d.ts b/src/definitions/schema.d.ts
index 82907f85..d3ce4c9c 100644
--- a/src/definitions/schema.d.ts
+++ b/src/definitions/schema.d.ts
@@ -76,12 +76,6 @@ export type Scalars = {
Upload: { input: any; output: any }
}
-export type GQLAddArticlesTagsInput = {
- articles?: InputMaybe>
- id: Scalars['ID']['input']
- selected?: InputMaybe
-}
-
export type GQLAddCollectionsArticlesInput = {
articles: Array
collections: Array
@@ -193,6 +187,7 @@ export type GQLArticle = GQLNode &
author: GQLUser
/** Available translation languages. */
availableTranslations?: Maybe>
+ bookmarked: Scalars['Boolean']['output']
/** associated campaigns */
campaigns: Array
/** whether readers can comment */
@@ -223,11 +218,6 @@ export type GQLArticle = GQLNode &
donationCount: Scalars['Int']['output']
/** Donations of this article, grouped by sender */
donations: GQLArticleDonationConnection
- /**
- * Drafts linked to this article.
- * @deprecated Use Article.newestUnpublishedDraft or Article.newestPublishedDraft instead
- */
- drafts?: Maybe>
/** List of featured comments of this article. */
featuredComments: GQLCommentConnection
/** This value determines if current viewer has appreciated or not. */
@@ -244,15 +234,12 @@ export type GQLArticle = GQLNode &
license: GQLArticleLicenseType
/** Media hash, composed of cid encoding, of this article. */
mediaHash: Scalars['String']['output']
- /** Newest published draft linked to this article. */
- newestPublishedDraft: GQLDraft
- /** Newest unpublished draft linked to this article. */
- newestUnpublishedDraft?: Maybe
oss: GQLArticleOss
/** The number determines how many comments can be set as pinned comment. */
pinCommentLeft: Scalars['Int']['output']
/** The number determines how many pinned comments can be set. */
pinCommentLimit: Scalars['Int']['output']
+ /** This value determines if this article is an author selected article or not. */
pinned: Scalars['Boolean']['output']
/** List of pinned comments. */
pinnedComments?: Maybe>
@@ -288,14 +275,10 @@ export type GQLArticle = GQLNode &
/** State of this article. */
state: GQLArticleState
/**
- * This value determines if this article is an author selected article or not.
- * @deprecated Use pinned instead
+ * This value determines if current Viewer has bookmarked of not.
+ * @deprecated Use bookmarked instead
*/
- sticky: Scalars['Boolean']['output']
- /** This value determines if current Viewer has subscribed of not. */
subscribed: Scalars['Boolean']['output']
- /** Subscribers of this article. */
- subscribers: GQLUserConnection
/** A short summary for this article. */
summary: Scalars['String']['output']
/** This value determines if the summary is customized or not. */
@@ -388,14 +371,6 @@ export type GQLArticleResponsesArgs = {
input: GQLResponsesInput
}
-/**
- * This type contains metadata, content, hash and related data of an article. If you
- * want information about article's comments. Please check Comment type.
- */
-export type GQLArticleSubscribersArgs = {
- input: GQLConnectionArgs
-}
-
/**
* This type contains metadata, content, hash and related data of an article. If you
* want information about article's comments. Please check Comment type.
@@ -706,6 +681,20 @@ export type GQLCampaignApplication = {
export type GQLCampaignApplicationState = 'pending' | 'rejected' | 'succeeded'
+export type GQLCampaignArticleConnection = GQLConnection & {
+ __typename?: 'CampaignArticleConnection'
+ edges: Array
+ pageInfo: GQLPageInfo
+ totalCount: Scalars['Int']['output']
+}
+
+export type GQLCampaignArticleEdge = {
+ __typename?: 'CampaignArticleEdge'
+ cursor: Scalars['String']['output']
+ featured: Scalars['Boolean']['output']
+ node: GQLArticle
+}
+
export type GQLCampaignArticleNotice = GQLNotice & {
__typename?: 'CampaignArticleNotice'
/** List of notice actors. */
@@ -1319,11 +1308,6 @@ export type GQLDeleteAnnouncementsInput = {
ids?: InputMaybe>
}
-export type GQLDeleteArticlesTagsInput = {
- articles?: InputMaybe>
- id: Scalars['ID']['input']
-}
-
export type GQLDeleteCollectionArticlesInput = {
articles: Array
collection: Scalars['ID']['input']
@@ -1459,8 +1443,6 @@ export type GQLEditArticleInput = {
requestForDonation?: InputMaybe
sensitive?: InputMaybe
state?: InputMaybe
- /** deprecated, use pinned instead */
- sticky?: InputMaybe
summary?: InputMaybe
tags?: InputMaybe>
title?: InputMaybe
@@ -1714,11 +1696,6 @@ export type GQLLiker = {
civicLiker: Scalars['Boolean']['output']
/** Liker ID of LikeCoin */
likerId?: Maybe
- /**
- * Rate of LikeCoin/USD
- * @deprecated No longer in use
- */
- rateUSD?: Maybe
/** Total LIKE left in wallet. */
total: Scalars['Float']['output']
}
@@ -1816,8 +1793,6 @@ export type GQLMonthlyDatum = {
export type GQLMutation = {
__typename?: 'Mutation'
- /** Add one tag to articles. */
- addArticlesTags: GQLTag
/** Add blocked search keyword to blocked_search_word db */
addBlockedSearchKeyword: GQLBlockedSearchKeyword
/** Add articles to the begining of the collections. */
@@ -1831,11 +1806,6 @@ export type GQLMutation = {
applyCampaign: GQLCampaign
/** Appreciate an article. */
appreciateArticle: GQLArticle
- /**
- * Change user email.
- * @deprecated use 'setEmail' instead
- */
- changeEmail: GQLUser
/** Let Traveloggers owner claims a Logbook, returns transaction hash */
claimLogbooks: GQLClaimLogbooksResult
/** Clear read history for user. */
@@ -1847,8 +1817,6 @@ export type GQLMutation = {
/** Create Stripe Connect account for Payout */
connectStripeAccount: GQLConnectStripeAccountResult
deleteAnnouncements: Scalars['Boolean']['output']
- /** Delete one tag from articles */
- deleteArticlesTags: GQLTag
/** Delete blocked search keywords from search_history db */
deleteBlockedSearchKeywords?: Maybe
/** Remove articles from the collection. */
@@ -1863,12 +1831,8 @@ export type GQLMutation = {
directImageUpload: GQLAsset
/** Edit an article. */
editArticle: GQLArticle
+ /** Login user. */
emailLogin: GQLAuthResult
- /**
- * Generate or claim a Liker ID through LikeCoin
- * @deprecated No longer in use
- */
- generateLikerId: GQLUser
/** Get signing message. */
generateSigningMessage: GQLSigningMessageResult
/** Invite others to join circle */
@@ -1912,8 +1876,6 @@ export type GQLMutation = {
putRemark?: Maybe
putRestrictedUsers: Array
putSkippedListItem?: Maybe>
- /** Create or update tag. */
- putTag: GQLTag
putWritingChallenge: GQLWritingChallenge
/** Read an article. */
readArticle: GQLArticle
@@ -1930,11 +1892,6 @@ export type GQLMutation = {
resetLikerId: GQLUser
/** Reset user or payment password. */
resetPassword?: Maybe
- /**
- * Reset crypto wallet.
- * @deprecated use 'removeWalletLogin' instead
- */
- resetWallet: GQLUser
sendCampaignAnnouncement?: Maybe
/** Send verification code for email. */
sendVerificationCode?: Maybe
@@ -1960,21 +1917,28 @@ export type GQLMutation = {
toggleArticleRecommend: GQLArticle
/** Block or Unblock a given user. */
toggleBlockUser: GQLUser
+ toggleBookmarkArticle: GQLArticle
+ toggleBookmarkTag: GQLTag
/**
* Follow or unfollow a Circle.
* @deprecated No longer in use
*/
toggleFollowCircle: GQLCircle
- /** Follow or unfollow tag. */
+ /**
+ * Bookmark or unbookmark tag.
+ * @deprecated Use toggleBookmarkTag instead
+ */
toggleFollowTag: GQLTag
/** Follow or Unfollow current user. */
toggleFollowUser: GQLUser
/** Pin or Unpin a comment. */
togglePinComment: GQLComment
toggleSeedingUsers: Array>
- /** Subscribe or Unsubscribe article */
+ /**
+ * Bookmark or unbookmark article
+ * @deprecated Use toggleBookmarkArticle instead
+ */
toggleSubscribeArticle: GQLArticle
- toggleTagRecommend: GQLTag
toggleUsersBadge: Array>
toggleWritingChallengeFeaturedArticles: GQLCampaign
unbindLikerId: GQLUser
@@ -1988,15 +1952,11 @@ export type GQLMutation = {
unvoteComment: GQLComment
updateArticleSensitive: GQLArticle
updateArticleState: GQLArticle
- /** Update articles' tag. */
- updateArticlesTags: GQLTag
updateCampaignApplicationState: GQLCampaign
/** Update a comments' state. */
updateCommentsState: Array
/** Update user notification settings. */
updateNotificationSetting: GQLUser
- /** Update member, permission and othters of a tag. */
- updateTagSetting: GQLTag
/** Update referralCode of a user, used in OSS. */
updateUserExtra: GQLUser
/** Update user information. */
@@ -2005,18 +1965,8 @@ export type GQLMutation = {
updateUserRole: GQLUser
/** Update state of a user, used in OSS. */
updateUserState?: Maybe>
- /**
- * Login user.
- * @deprecated use 'emailLogin' instead
- */
- userLogin: GQLAuthResult
/** Logout user. */
userLogout: Scalars['Boolean']['output']
- /**
- * Register user, can only be used on matters.{town,news} website.
- * @deprecated use 'emailLogin' instead
- */
- userRegister: GQLAuthResult
/** Verify user email. */
verifyEmail: GQLAuthResult
/** Upvote or downvote a comment. */
@@ -2025,10 +1975,6 @@ export type GQLMutation = {
walletLogin: GQLAuthResult
}
-export type GQLMutationAddArticlesTagsArgs = {
- input: GQLAddArticlesTagsInput
-}
-
export type GQLMutationAddBlockedSearchKeywordArgs = {
input: GQLKeywordInput
}
@@ -2057,10 +2003,6 @@ export type GQLMutationAppreciateArticleArgs = {
input: GQLAppreciateArticleInput
}
-export type GQLMutationChangeEmailArgs = {
- input: GQLChangeEmailInput
-}
-
export type GQLMutationClaimLogbooksArgs = {
input: GQLClaimLogbooksInput
}
@@ -2081,10 +2023,6 @@ export type GQLMutationDeleteAnnouncementsArgs = {
input: GQLDeleteAnnouncementsInput
}
-export type GQLMutationDeleteArticlesTagsArgs = {
- input: GQLDeleteArticlesTagsInput
-}
-
export type GQLMutationDeleteBlockedSearchKeywordsArgs = {
input: GQLKeywordsInput
}
@@ -2221,10 +2159,6 @@ export type GQLMutationPutSkippedListItemArgs = {
input: GQLPutSkippedListItemInput
}
-export type GQLMutationPutTagArgs = {
- input: GQLPutTagInput
-}
-
export type GQLMutationPutWritingChallengeArgs = {
input: GQLPutWritingChallengeInput
}
@@ -2257,10 +2191,6 @@ export type GQLMutationResetPasswordArgs = {
input: GQLResetPasswordInput
}
-export type GQLMutationResetWalletArgs = {
- input: GQLResetWalletInput
-}
-
export type GQLMutationSendCampaignAnnouncementArgs = {
input: GQLSendCampaignAnnouncementInput
}
@@ -2321,6 +2251,14 @@ export type GQLMutationToggleBlockUserArgs = {
input: GQLToggleItemInput
}
+export type GQLMutationToggleBookmarkArticleArgs = {
+ input: GQLToggleItemInput
+}
+
+export type GQLMutationToggleBookmarkTagArgs = {
+ input: GQLToggleItemInput
+}
+
export type GQLMutationToggleFollowCircleArgs = {
input: GQLToggleItemInput
}
@@ -2345,10 +2283,6 @@ export type GQLMutationToggleSubscribeArticleArgs = {
input: GQLToggleItemInput
}
-export type GQLMutationToggleTagRecommendArgs = {
- input: GQLToggleRecommendInput
-}
-
export type GQLMutationToggleUsersBadgeArgs = {
input: GQLToggleUsersBadgeInput
}
@@ -2389,10 +2323,6 @@ export type GQLMutationUpdateArticleStateArgs = {
input: GQLUpdateArticleStateInput
}
-export type GQLMutationUpdateArticlesTagsArgs = {
- input: GQLUpdateArticlesTagsInput
-}
-
export type GQLMutationUpdateCampaignApplicationStateArgs = {
input: GQLUpdateCampaignApplicationStateInput
}
@@ -2405,10 +2335,6 @@ export type GQLMutationUpdateNotificationSettingArgs = {
input: GQLUpdateNotificationSettingInput
}
-export type GQLMutationUpdateTagSettingArgs = {
- input: GQLUpdateTagSettingInput
-}
-
export type GQLMutationUpdateUserExtraArgs = {
input: GQLUpdateUserExtraInput
}
@@ -2425,14 +2351,6 @@ export type GQLMutationUpdateUserStateArgs = {
input: GQLUpdateUserStateInput
}
-export type GQLMutationUserLoginArgs = {
- input: GQLUserLoginInput
-}
-
-export type GQLMutationUserRegisterArgs = {
- input: GQLUserRegisterInput
-}
-
export type GQLMutationVerifyEmailArgs = {
input: GQLVerifyEmailInput
}
@@ -2901,13 +2819,6 @@ export type GQLPutSkippedListItemInput = {
value?: InputMaybe
}
-export type GQLPutTagInput = {
- content?: InputMaybe
- cover?: InputMaybe
- description?: InputMaybe
- id?: InputMaybe
-}
-
export type GQLPutWritingChallengeInput = {
announcements?: InputMaybe>
applicationPeriod?: InputMaybe
@@ -3057,11 +2968,6 @@ export type GQLRecommendation = {
newest: GQLArticleConnection
/** Global circles sort by created time. */
newestCircles: GQLCircleConnection
- /**
- * Articles recommended based on recently read article tags.
- * @deprecated Merged into following
- */
- readTagsArticles: GQLArticleConnection
/** Selected tag list */
selectedTags: GQLTagConnection
/** Global tag list, sort by activities in recent 14 days. */
@@ -3100,10 +3006,6 @@ export type GQLRecommendationNewestCirclesArgs = {
input: GQLConnectionArgs
}
-export type GQLRecommendationReadTagsArticlesArgs = {
- input: GQLConnectionArgs
-}
-
export type GQLRecommendationSelectedTagsArgs = {
input: GQLRecommendInput
}
@@ -3495,38 +3397,22 @@ export type GQLTag = GQLNode & {
articles: GQLArticleConnection
/** Content of this tag. */
content: Scalars['String']['output']
- /** Tag's cover link. */
- cover?: Maybe
/** Time of this tag was created. */
createdAt: Scalars['DateTime']['output']
- /** Creator of this tag. */
- creator?: Maybe
deleted: Scalars['Boolean']['output']
- /** Description of this tag. */
- description?: Maybe
- /** Editors of this tag. */
- editors?: Maybe>
- /** Followers of this tag. */
- followers: GQLUserConnection
/** Unique id of this tag. */
id: Scalars['ID']['output']
/** This value determines if current viewer is following or not. */
isFollower?: Maybe
- /** This value determines if it is official. */
- isOfficial?: Maybe
/** Counts of this tag. */
numArticles: Scalars['Int']['output']
numAuthors: Scalars['Int']['output']
oss: GQLTagOss
- /** Owner of this tag. */
- owner?: Maybe
- /** Participants of this tag. */
- participants: GQLUserConnection
/** Tags recommended based on relations to current tag. */
recommended: GQLTagConnection
+ /** Authors recommended based on relations to current tag. */
+ recommendedAuthors: GQLUserConnection
remark?: Maybe
- /** This value determines if this article is selected by this tag or not. */
- selected: Scalars['Boolean']['output']
}
/** This type contains content, count and related data of an article tag. */
@@ -3534,36 +3420,20 @@ export type GQLTagArticlesArgs = {
input: GQLTagArticlesInput
}
-/** This type contains content, count and related data of an article tag. */
-export type GQLTagEditorsArgs = {
- input?: InputMaybe
-}
-
-/** This type contains content, count and related data of an article tag. */
-export type GQLTagFollowersArgs = {
- input: GQLConnectionArgs
-}
-
-/** This type contains content, count and related data of an article tag. */
-export type GQLTagParticipantsArgs = {
- input: GQLConnectionArgs
-}
-
/** This type contains content, count and related data of an article tag. */
export type GQLTagRecommendedArgs = {
input: GQLConnectionArgs
}
/** This type contains content, count and related data of an article tag. */
-export type GQLTagSelectedArgs = {
- input: GQLTagSelectedInput
+export type GQLTagRecommendedAuthorsArgs = {
+ input: GQLConnectionArgs
}
export type GQLTagArticlesInput = {
after?: InputMaybe
first?: InputMaybe
oss?: InputMaybe
- selected?: InputMaybe
sortBy?: InputMaybe
}
@@ -3582,21 +3452,10 @@ export type GQLTagEdge = {
node: GQLTag
}
-export type GQLTagEditorsInput = {
- excludeAdmin?: InputMaybe
- excludeOwner?: InputMaybe
-}
-
export type GQLTagOss = {
__typename?: 'TagOSS'
boost: Scalars['Float']['output']
score: Scalars['Float']['output']
- selected: Scalars['Boolean']['output']
-}
-
-export type GQLTagSelectedInput = {
- id?: InputMaybe
- mediaHash?: InputMaybe
}
export type GQLTagsInput = {
@@ -3827,12 +3686,6 @@ export type GQLUpdateArticleStateInput = {
state: GQLArticleState
}
-export type GQLUpdateArticlesTagsInput = {
- articles?: InputMaybe>
- id: Scalars['ID']['input']
- isSelected: Scalars['Boolean']['input']
-}
-
export type GQLUpdateCampaignApplicationStateInput = {
campaign: Scalars['ID']['input']
state: GQLCampaignApplicationState
@@ -3849,19 +3702,6 @@ export type GQLUpdateNotificationSettingInput = {
type: GQLNotificationSettingType
}
-export type GQLUpdateTagSettingInput = {
- editors?: InputMaybe>
- id: Scalars['ID']['input']
- type: GQLUpdateTagSettingType
-}
-
-export type GQLUpdateTagSettingType =
- | 'add_editor'
- | 'adopt'
- | 'leave'
- | 'leave_editor'
- | 'remove_editor'
-
export type GQLUpdateUserExtraInput = {
id: Scalars['ID']['input']
referralCode?: InputMaybe
@@ -3877,8 +3717,6 @@ export type GQLUpdateUserInfoInput = {
paymentPointer?: InputMaybe
profileCover?: InputMaybe
referralCode?: InputMaybe
- /** @deprecated use 'setUserName' instead */
- userName?: InputMaybe
}
export type GQLUpdateUserRoleInput = {
@@ -4167,11 +4005,6 @@ export type GQLUserInput = {
export type GQLUserLanguage = 'en' | 'zh_hans' | 'zh_hant'
-export type GQLUserLoginInput = {
- email: Scalars['String']['input']
- password: Scalars['String']['input']
-}
-
export type GQLUserNotice = GQLNotice & {
__typename?: 'UserNotice'
/** List of notice actors. */
@@ -4289,10 +4122,7 @@ export type GQLUserStatus = {
export type GQLVerificationCodeType =
| 'email_otp'
- | 'email_reset'
- | 'email_reset_confirm'
| 'email_verify'
- | 'password_reset'
| 'payment_password_reset'
| 'register'
@@ -4326,16 +4156,6 @@ export type GQLWalletTransactionsArgs = {
}
export type GQLWalletLoginInput = {
- /**
- * email verification code, required for wallet register
- * @deprecated No longer in use
- */
- codeId?: InputMaybe
- /**
- * required for wallet register
- * @deprecated No longer in use
- */
- email?: InputMaybe
ethAddress: Scalars['String']['input']
/** used in register */
language?: InputMaybe
@@ -4356,7 +4176,7 @@ export type GQLWritingChallenge = GQLCampaign &
announcements: Array
application?: Maybe
applicationPeriod?: Maybe
- articles: GQLArticleConnection
+ articles: GQLCampaignArticleConnection
cover?: Maybe
description?: Maybe
id: Scalars['ID']['output']
@@ -4570,6 +4390,9 @@ export type GQLResolversInterfaceTypes<
| (Omit & {
edges: Array>
})
+ | (Omit & {
+ edges: Array
+ })
| (Omit & {
edges?: Maybe>
})
@@ -4659,7 +4482,6 @@ export type GQLResolversInterfaceTypes<
/** Mapping between all available schema types and the resolvers types */
export type GQLResolversTypes = ResolversObject<{
- AddArticlesTagsInput: GQLAddArticlesTagsInput
AddCollectionsArticlesInput: GQLAddCollectionsArticlesInput
AddCreditInput: GQLAddCreditInput
AddCreditResult: ResolverTypeWrapper<
@@ -4764,6 +4586,16 @@ export type GQLResolversTypes = ResolversObject<{
Campaign: ResolverTypeWrapper
CampaignApplication: ResolverTypeWrapper
CampaignApplicationState: GQLCampaignApplicationState
+ CampaignArticleConnection: ResolverTypeWrapper<
+ Omit & {
+ edges: Array
+ }
+ >
+ CampaignArticleEdge: ResolverTypeWrapper<
+ Omit & {
+ node: GQLResolversTypes['Article']
+ }
+ >
CampaignArticleNotice: ResolverTypeWrapper
CampaignArticleNoticeType: GQLCampaignArticleNoticeType
CampaignArticlesFilter: GQLCampaignArticlesFilter
@@ -4871,7 +4703,6 @@ export type GQLResolversTypes = ResolversObject<{
DatetimeRange: ResolverTypeWrapper
DatetimeRangeInput: GQLDatetimeRangeInput
DeleteAnnouncementsInput: GQLDeleteAnnouncementsInput
- DeleteArticlesTagsInput: GQLDeleteArticlesTagsInput
DeleteCollectionArticlesInput: GQLDeleteCollectionArticlesInput
DeleteCollectionsInput: GQLDeleteCollectionsInput
DeleteCommentInput: GQLDeleteCommentInput
@@ -5060,7 +4891,6 @@ export type GQLResolversTypes = ResolversObject<{
PutRemarkInput: GQLPutRemarkInput
PutRestrictedUsersInput: GQLPutRestrictedUsersInput
PutSkippedListItemInput: GQLPutSkippedListItemInput
- PutTagInput: GQLPutTagInput
PutWritingChallengeInput: GQLPutWritingChallengeInput
Query: ResolverTypeWrapper<{}>
QuoteCurrency: GQLQuoteCurrency
@@ -5166,9 +4996,7 @@ export type GQLResolversTypes = ResolversObject<{
TagEdge: ResolverTypeWrapper<
Omit & { node: GQLResolversTypes['Tag'] }
>
- TagEditorsInput: GQLTagEditorsInput
TagOSS: ResolverTypeWrapper
- TagSelectedInput: GQLTagSelectedInput
TagsInput: GQLTagsInput
TagsSort: GQLTagsSort
ToggleCircleMemberInput: GQLToggleCircleMemberInput
@@ -5221,12 +5049,9 @@ export type GQLResolversTypes = ResolversObject<{
UnvoteCommentInput: GQLUnvoteCommentInput
UpdateArticleSensitiveInput: GQLUpdateArticleSensitiveInput
UpdateArticleStateInput: GQLUpdateArticleStateInput
- UpdateArticlesTagsInput: GQLUpdateArticlesTagsInput
UpdateCampaignApplicationStateInput: GQLUpdateCampaignApplicationStateInput
UpdateCommentsStateInput: GQLUpdateCommentsStateInput
UpdateNotificationSettingInput: GQLUpdateNotificationSettingInput
- UpdateTagSettingInput: GQLUpdateTagSettingInput
- UpdateTagSettingType: GQLUpdateTagSettingType
UpdateUserExtraInput: GQLUpdateUserExtraInput
UpdateUserInfoInput: GQLUpdateUserInfoInput
UpdateUserRoleInput: GQLUpdateUserRoleInput
@@ -5271,7 +5096,6 @@ export type GQLResolversTypes = ResolversObject<{
UserInfoFields: GQLUserInfoFields
UserInput: GQLUserInput
UserLanguage: GQLUserLanguage
- UserLoginInput: GQLUserLoginInput
UserNotice: ResolverTypeWrapper
UserNoticeType: GQLUserNoticeType
UserOSS: ResolverTypeWrapper
@@ -5322,7 +5146,6 @@ export type GQLResolversTypes = ResolversObject<{
/** Mapping between all available schema types and the resolvers parents */
export type GQLResolversParentTypes = ResolversObject<{
- AddArticlesTagsInput: GQLAddArticlesTagsInput
AddCollectionsArticlesInput: GQLAddCollectionsArticlesInput
AddCreditInput: GQLAddCreditInput
AddCreditResult: Omit & {
@@ -5391,6 +5214,12 @@ export type GQLResolversParentTypes = ResolversObject<{
Boolean: Scalars['Boolean']['output']
Campaign: CampaignModel
CampaignApplication: GQLCampaignApplication
+ CampaignArticleConnection: Omit & {
+ edges: Array
+ }
+ CampaignArticleEdge: Omit & {
+ node: GQLResolversParentTypes['Article']
+ }
CampaignArticleNotice: NoticeItemModel
CampaignArticlesFilter: GQLCampaignArticlesFilter
CampaignArticlesInput: GQLCampaignArticlesInput
@@ -5472,7 +5301,6 @@ export type GQLResolversParentTypes = ResolversObject<{
DatetimeRange: GQLDatetimeRange
DatetimeRangeInput: GQLDatetimeRangeInput
DeleteAnnouncementsInput: GQLDeleteAnnouncementsInput
- DeleteArticlesTagsInput: GQLDeleteArticlesTagsInput
DeleteCollectionArticlesInput: GQLDeleteCollectionArticlesInput
DeleteCollectionsInput: GQLDeleteCollectionsInput
DeleteCommentInput: GQLDeleteCommentInput
@@ -5621,7 +5449,6 @@ export type GQLResolversParentTypes = ResolversObject<{
PutRemarkInput: GQLPutRemarkInput
PutRestrictedUsersInput: GQLPutRestrictedUsersInput
PutSkippedListItemInput: GQLPutSkippedListItemInput
- PutTagInput: GQLPutTagInput
PutWritingChallengeInput: GQLPutWritingChallengeInput
Query: {}
ReadArticleInput: GQLReadArticleInput
@@ -5697,9 +5524,7 @@ export type GQLResolversParentTypes = ResolversObject<{
edges?: Maybe>
}
TagEdge: Omit & { node: GQLResolversParentTypes['Tag'] }
- TagEditorsInput: GQLTagEditorsInput
TagOSS: TagModel
- TagSelectedInput: GQLTagSelectedInput
TagsInput: GQLTagsInput
ToggleCircleMemberInput: GQLToggleCircleMemberInput
ToggleItemInput: GQLToggleItemInput
@@ -5741,11 +5566,9 @@ export type GQLResolversParentTypes = ResolversObject<{
UnvoteCommentInput: GQLUnvoteCommentInput
UpdateArticleSensitiveInput: GQLUpdateArticleSensitiveInput
UpdateArticleStateInput: GQLUpdateArticleStateInput
- UpdateArticlesTagsInput: GQLUpdateArticlesTagsInput
UpdateCampaignApplicationStateInput: GQLUpdateCampaignApplicationStateInput
UpdateCommentsStateInput: GQLUpdateCommentsStateInput
UpdateNotificationSettingInput: GQLUpdateNotificationSettingInput
- UpdateTagSettingInput: GQLUpdateTagSettingInput
UpdateUserExtraInput: GQLUpdateUserExtraInput
UpdateUserInfoInput: GQLUpdateUserInfoInput
UpdateUserRoleInput: GQLUpdateUserRoleInput
@@ -5787,7 +5610,6 @@ export type GQLResolversParentTypes = ResolversObject<{
}
UserInfo: UserModel
UserInput: GQLUserInput
- UserLoginInput: GQLUserLoginInput
UserNotice: NoticeItemModel
UserOSS: UserModel
UserPostMomentActivity: Omit<
@@ -6066,6 +5888,7 @@ export type GQLArticleResolvers<
ParentType,
ContextType
>
+ bookmarked?: Resolver
campaigns?: Resolver<
Array,
ParentType,
@@ -6109,11 +5932,6 @@ export type GQLArticleResolvers<
ContextType,
RequireFields
>
- drafts?: Resolver<
- Maybe>,
- ParentType,
- ContextType
- >
featuredComments?: Resolver<
GQLResolversTypes['CommentConnection'],
ParentType,
@@ -6143,16 +5961,6 @@ export type GQLArticleResolvers<
ContextType
>
mediaHash?: Resolver
- newestPublishedDraft?: Resolver<
- GQLResolversTypes['Draft'],
- ParentType,
- ContextType
- >
- newestUnpublishedDraft?: Resolver<
- Maybe,
- ParentType,
- ContextType
- >
oss?: Resolver
pinCommentLeft?: Resolver
pinCommentLimit?: Resolver
@@ -6213,14 +6021,7 @@ export type GQLArticleResolvers<
shortHash?: Resolver
slug?: Resolver
state?: Resolver
- sticky?: Resolver
subscribed?: Resolver
- subscribers?: Resolver<
- GQLResolversTypes['UserConnection'],
- ParentType,
- ContextType,
- RequireFields
- >
summary?: Resolver
summaryCustomized?: Resolver<
GQLResolversTypes['Boolean'],
@@ -6607,6 +6408,30 @@ export type GQLCampaignApplicationResolvers<
__isTypeOf?: IsTypeOfResolverFn
}>
+export type GQLCampaignArticleConnectionResolvers<
+ ContextType = Context,
+ ParentType extends GQLResolversParentTypes['CampaignArticleConnection'] = GQLResolversParentTypes['CampaignArticleConnection']
+> = ResolversObject<{
+ edges?: Resolver<
+ Array,
+ ParentType,
+ ContextType
+ >
+ pageInfo?: Resolver
+ totalCount?: Resolver
+ __isTypeOf?: IsTypeOfResolverFn
+}>
+
+export type GQLCampaignArticleEdgeResolvers<
+ ContextType = Context,
+ ParentType extends GQLResolversParentTypes['CampaignArticleEdge'] = GQLResolversParentTypes['CampaignArticleEdge']
+> = ResolversObject<{
+ cursor?: Resolver
+ featured?: Resolver
+ node?: Resolver
+ __isTypeOf?: IsTypeOfResolverFn
+}>
+
export type GQLCampaignArticleNoticeResolvers<
ContextType = Context,
ParentType extends GQLResolversParentTypes['CampaignArticleNotice'] = GQLResolversParentTypes['CampaignArticleNotice']
@@ -7180,6 +7005,7 @@ export type GQLConnectionResolvers<
| 'AppreciationConnection'
| 'ArticleConnection'
| 'ArticleVersionsConnection'
+ | 'CampaignArticleConnection'
| 'CampaignConnection'
| 'CampaignParticipantConnection'
| 'CircleConnection'
@@ -7598,7 +7424,6 @@ export type GQLLikerResolvers<
ParentType,
ContextType
>
- rateUSD?: Resolver, ParentType, ContextType>
total?: Resolver
__isTypeOf?: IsTypeOfResolverFn
}>
@@ -7701,12 +7526,6 @@ export type GQLMutationResolvers<
ContextType = Context,
ParentType extends GQLResolversParentTypes['Mutation'] = GQLResolversParentTypes['Mutation']
> = ResolversObject<{
- addArticlesTags?: Resolver<
- GQLResolversTypes['Tag'],
- ParentType,
- ContextType,
- RequireFields
- >
addBlockedSearchKeyword?: Resolver<
GQLResolversTypes['BlockedSearchKeyword'],
ParentType,
@@ -7749,12 +7568,6 @@ export type GQLMutationResolvers<
ContextType,
RequireFields
>
- changeEmail?: Resolver<
- GQLResolversTypes['User'],
- ParentType,
- ContextType,
- RequireFields
- >
claimLogbooks?: Resolver<
GQLResolversTypes['ClaimLogbooksResult'],
ParentType,
@@ -7790,12 +7603,6 @@ export type GQLMutationResolvers<
ContextType,
RequireFields
>
- deleteArticlesTags?: Resolver<
- GQLResolversTypes['Tag'],
- ParentType,
- ContextType,
- RequireFields
- >
deleteBlockedSearchKeywords?: Resolver<
Maybe,
ParentType,
@@ -7856,7 +7663,6 @@ export type GQLMutationResolvers<
ContextType,
RequireFields
>
- generateLikerId?: Resolver
generateSigningMessage?: Resolver<
GQLResolversTypes['SigningMessageResult'],
ParentType,
@@ -8006,12 +7812,6 @@ export type GQLMutationResolvers<
ContextType,
RequireFields
>
- putTag?: Resolver<
- GQLResolversTypes['Tag'],
- ParentType,
- ContextType,
- RequireFields
- >
putWritingChallenge?: Resolver<
GQLResolversTypes['WritingChallenge'],
ParentType,
@@ -8065,12 +7865,6 @@ export type GQLMutationResolvers<
ContextType,
RequireFields
>
- resetWallet?: Resolver<
- GQLResolversTypes['User'],
- ParentType,
- ContextType,
- RequireFields
- >
sendCampaignAnnouncement?: Resolver<
Maybe,
ParentType,
@@ -8161,6 +7955,18 @@ export type GQLMutationResolvers<
ContextType,
RequireFields
>
+ toggleBookmarkArticle?: Resolver<
+ GQLResolversTypes['Article'],
+ ParentType,
+ ContextType,
+ RequireFields
+ >
+ toggleBookmarkTag?: Resolver<
+ GQLResolversTypes['Tag'],
+ ParentType,
+ ContextType,
+ RequireFields
+ >
toggleFollowCircle?: Resolver<
GQLResolversTypes['Circle'],
ParentType,
@@ -8197,12 +8003,6 @@ export type GQLMutationResolvers<
ContextType,
RequireFields
>
- toggleTagRecommend?: Resolver<
- GQLResolversTypes['Tag'],
- ParentType,
- ContextType,
- RequireFields
- >
toggleUsersBadge?: Resolver<
Array>,
ParentType,
@@ -8266,12 +8066,6 @@ export type GQLMutationResolvers<
ContextType,
RequireFields
>
- updateArticlesTags?: Resolver<
- GQLResolversTypes['Tag'],
- ParentType,
- ContextType,
- RequireFields
- >
updateCampaignApplicationState?: Resolver<
GQLResolversTypes['Campaign'],
ParentType,
@@ -8290,12 +8084,6 @@ export type GQLMutationResolvers<
ContextType,
RequireFields
>
- updateTagSetting?: Resolver<
- GQLResolversTypes['Tag'],
- ParentType,
- ContextType,
- RequireFields
- >
updateUserExtra?: Resolver<
GQLResolversTypes['User'],
ParentType,
@@ -8320,19 +8108,7 @@ export type GQLMutationResolvers<
ContextType,
RequireFields
>
- userLogin?: Resolver<
- GQLResolversTypes['AuthResult'],
- ParentType,
- ContextType,
- RequireFields
- >
userLogout?: Resolver
- userRegister?: Resolver<
- GQLResolversTypes['AuthResult'],
- ParentType,
- ContextType,
- RequireFields
- >
verifyEmail?: Resolver<
GQLResolversTypes['AuthResult'],
ParentType,
@@ -8979,12 +8755,6 @@ export type GQLRecommendationResolvers<
ContextType,
RequireFields
>
- readTagsArticles?: Resolver<
- GQLResolversTypes['ArticleConnection'],
- ParentType,
- ContextType,
- RequireFields
- >
selectedTags?: Resolver<
GQLResolversTypes['TagConnection'],
ParentType,
@@ -9217,61 +8987,30 @@ export type GQLTagResolvers<
RequireFields
>
content?: Resolver
- cover?: Resolver, ParentType, ContextType>
createdAt?: Resolver
- creator?: Resolver, ParentType, ContextType>
deleted?: Resolver
- description?: Resolver<
- Maybe,
- ParentType,
- ContextType
- >
- editors?: Resolver<
- Maybe>,
- ParentType,
- ContextType,
- Partial
- >
- followers?: Resolver<
- GQLResolversTypes['UserConnection'],
- ParentType,
- ContextType,
- RequireFields
- >
id?: Resolver
isFollower?: Resolver<
Maybe,
ParentType,
ContextType
>
- isOfficial?: Resolver<
- Maybe,
- ParentType,
- ContextType
- >
numArticles?: Resolver
numAuthors?: Resolver
oss?: Resolver
- owner?: Resolver, ParentType, ContextType>
- participants?: Resolver<
- GQLResolversTypes['UserConnection'],
- ParentType,
- ContextType,
- RequireFields
- >
recommended?: Resolver<
GQLResolversTypes['TagConnection'],
ParentType,
ContextType,
RequireFields
>
- remark?: Resolver, ParentType, ContextType>
- selected?: Resolver<
- GQLResolversTypes['Boolean'],
+ recommendedAuthors?: Resolver<
+ GQLResolversTypes['UserConnection'],
ParentType,
ContextType,
- RequireFields
+ RequireFields
>
+ remark?: Resolver, ParentType, ContextType>
__isTypeOf?: IsTypeOfResolverFn
}>
@@ -9304,7 +9043,6 @@ export type GQLTagOssResolvers<
> = ResolversObject<{
boost?: Resolver
score?: Resolver
- selected?: Resolver
__isTypeOf?: IsTypeOfResolverFn
}>
@@ -10002,7 +9740,7 @@ export type GQLWritingChallengeResolvers<
ContextType
>
articles?: Resolver<
- GQLResolversTypes['ArticleConnection'],
+ GQLResolversTypes['CampaignArticleConnection'],
ParentType,
ContextType,
RequireFields
@@ -10100,6 +9838,8 @@ export type GQLResolvers = ResolversObject<{
BlockedSearchKeyword?: GQLBlockedSearchKeywordResolvers
Campaign?: GQLCampaignResolvers
CampaignApplication?: GQLCampaignApplicationResolvers
+ CampaignArticleConnection?: GQLCampaignArticleConnectionResolvers
+ CampaignArticleEdge?: GQLCampaignArticleEdgeResolvers
CampaignArticleNotice?: GQLCampaignArticleNoticeResolvers
CampaignConnection?: GQLCampaignConnectionResolvers
CampaignEdge?: GQLCampaignEdgeResolvers
diff --git a/src/gql/fragments/article/detail.gql b/src/gql/fragments/article/detail.gql
index 4c44fdc2..b7ee37b8 100644
--- a/src/gql/fragments/article/detail.gql
+++ b/src/gql/fragments/article/detail.gql
@@ -29,17 +29,8 @@ fragment ArticleDetail on Article {
}
}
}
- subscribed
hasAppreciate
remark
- subscribers(input: { first: null }) {
- ...ConnectionInfo
- edges {
- node {
- ...UserDigest
- }
- }
- }
comments(input: { first: null }) {
edges {
node {
diff --git a/src/gql/fragments/tag/detail.gql b/src/gql/fragments/tag/detail.gql
index 8dd6d5cd..9c9f8b42 100644
--- a/src/gql/fragments/tag/detail.gql
+++ b/src/gql/fragments/tag/detail.gql
@@ -5,7 +5,6 @@ fragment TagDetail on Tag {
id
content
createdAt
- description
articles(input: { first: 20 }) {
...ConnectionInfo
edges {
@@ -17,18 +16,7 @@ fragment TagDetail on Tag {
oss {
boost
score
- selected
}
remark
deleted
- creator {
- id
- userName
- displayName
- }
- editors {
- id
- userName
- displayName
- }
}
diff --git a/src/gql/fragments/tag/digest.gql b/src/gql/fragments/tag/digest.gql
index dff53653..35ab28f2 100644
--- a/src/gql/fragments/tag/digest.gql
+++ b/src/gql/fragments/tag/digest.gql
@@ -7,7 +7,4 @@ fragment TagDigest on Tag {
articles(input: { first: 0 }) {
...ConnectionInfo
}
- oss {
- selected
- }
}
diff --git a/src/gql/mutations/emailLogin.gql b/src/gql/mutations/emailLogin.gql
new file mode 100644
index 00000000..6199f2c5
--- /dev/null
+++ b/src/gql/mutations/emailLogin.gql
@@ -0,0 +1,6 @@
+mutation OSSEmailLogin($input: EmailLoginInput!) {
+ emailLogin(input: $input) {
+ auth
+ token
+ }
+}
diff --git a/src/gql/mutations/userLogin.gql b/src/gql/mutations/userLogin.gql
deleted file mode 100644
index 350c81af..00000000
--- a/src/gql/mutations/userLogin.gql
+++ /dev/null
@@ -1,6 +0,0 @@
-mutation OSSUserLogin($input: UserLoginInput!) {
- userLogin(input: $input) {
- auth
- token
- }
-}
diff --git a/src/gql/queries/tagList.gql b/src/gql/queries/tagList.gql
index 5442eee0..3c80d1b1 100644
--- a/src/gql/queries/tagList.gql
+++ b/src/gql/queries/tagList.gql
@@ -8,7 +8,6 @@ query OSSTagList($input: TagsInput!) {
edges {
node {
...TagDigest
- description
deleted
}
}
diff --git a/src/pages/Login/index.tsx b/src/pages/Login/index.tsx
index 1f468a91..286d82c0 100644
--- a/src/pages/Login/index.tsx
+++ b/src/pages/Login/index.tsx
@@ -5,9 +5,9 @@ import queryString from 'query-string'
import _get from 'lodash/get'
import { GraphQLError } from 'graphql'
-import withUserLogin, { ChildProps } from './withUserLogin'
+import withEmailLogin, { ChildProps } from './withEmailLogin'
-import { STORE_JWT_TOKEN, ERROR_CODE } from '../../constants'
+import { ERROR_CODE } from '../../constants'
import LOGO_URL from '../../assets/logo.svg'
import './style.less'
@@ -87,11 +87,11 @@ class Login extends React.Component {
variables: {
input: {
email,
- password,
+ passwordOrCode: password,
},
},
})
- const token = _get(result, 'data.userLogin.token')
+ const token = _get(result, 'data.emailLogin.token')
if (token) {
window.location.replace((next as string) || '/')
} else {
@@ -173,4 +173,4 @@ class Login extends React.Component {
}
}
-export default compose(withUserLogin, Form.create())(Login)
+export default compose(withEmailLogin, Form.create())(Login)
diff --git a/src/pages/Login/withUserLogin.tsx b/src/pages/Login/withEmailLogin.tsx
similarity index 59%
rename from src/pages/Login/withUserLogin.tsx
rename to src/pages/Login/withEmailLogin.tsx
index 24ea67cd..2d391357 100644
--- a/src/pages/Login/withUserLogin.tsx
+++ b/src/pages/Login/withEmailLogin.tsx
@@ -1,7 +1,7 @@
import { graphql, ChildMutateProps } from 'react-apollo'
import { FormComponentProps } from 'antd/lib/form'
-import MutationUserLogin from '../../gql/mutations/userLogin.gql'
+import MutationEmailLogin from '../../gql/mutations/emailLogin.gql'
type AuthResult = {
auth: boolean
@@ -9,7 +9,7 @@ type AuthResult = {
}
type Response = {
- userLogin: AuthResult
+ emailLogin: AuthResult
}
type InputProps = FormComponentProps
@@ -17,14 +17,14 @@ type InputProps = FormComponentProps
type Variables = {
input: {
email: string
- password: string
+ passwordOrCode: string
}
}
export type ChildProps = ChildMutateProps
-const withUserLogin = graphql(
- MutationUserLogin
+const withEmailLogin = graphql(
+ MutationEmailLogin
)
-export default withUserLogin
+export default withEmailLogin
diff --git a/src/pages/TagDetail/index.tsx b/src/pages/TagDetail/index.tsx
index 408da061..990f74e9 100644
--- a/src/pages/TagDetail/index.tsx
+++ b/src/pages/TagDetail/index.tsx
@@ -1,6 +1,5 @@
import * as React from 'react'
import { Col, Tag, Skeleton, Empty } from 'antd'
-import _get from 'lodash/get'
import ErrorMessage from '../../components/ErrorMessage'
import Divider from '../../components/Divider'
@@ -9,11 +8,9 @@ import Remark from '../../components/Remark'
import DescriptionList from '../../components/DescriptionList'
import ArticleDigestList from '../../components/Article/DigestList'
import TagStateTag from '../../components/Tag/StateTag'
-import ToggleSelected from '../../components/Tag/ToggleSelected'
-import UserLink from '../../components/User/Link'
import withTagDetail, { TagDetailChildProps } from './withTagDetail'
-import SetBoost from '../../components/SetBoost'
+// import SetBoost from '../../components/SetBoost'
import { SITE_DOMIAN } from '../../constants'
const { Description } = DescriptionList
@@ -42,7 +39,7 @@ class TagDetail extends React.Component {
{tag.content}
- {tag.description}
+ {/* {tag.description} */}
@@ -58,42 +55,14 @@ class TagDetail extends React.Component {
-
-
-
-
-
-
- {tag.editors.map((editor) => (
- -
-
-
- ))}
-
-
-
-
-
-
-
+ {/* */}
+ {/*
{tag.oss.score}
-
-
-
-
-
+ */}
diff --git a/src/pages/UserDetail/index.tsx b/src/pages/UserDetail/index.tsx
index 55ccfde0..81c74858 100644
--- a/src/pages/UserDetail/index.tsx
+++ b/src/pages/UserDetail/index.tsx
@@ -12,7 +12,6 @@ import UserStateTag from '../../components/User/StateTag'
import UserSetState from '../../components/User/SetState'
import UserRoleTag from '../../components/User/RoleTag'
import UserSetRole from '../../components/User/SetRole'
-import UserResetWallet from '../../components/User/ResetWallet'
import UserComments from './Comments'
import withUserDetail, { UserDetailChildProps } from './withUserDetail'
@@ -154,13 +153,6 @@ class UserDetail extends React.Component<
-
-
-
-