Skip to content

Commit

Permalink
[Profile] Removes sort in Comment tab
Browse files Browse the repository at this point in the history
Because there is no other way to sort
  • Loading branch information
MrOrz committed Oct 10, 2022
1 parent f401bf7 commit 757035a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
18 changes: 2 additions & 16 deletions components/ProfilePage/CommentTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,14 @@ import { useRouter } from 'next/router';
import Link from 'next/link';
import { t, ngettext, msgid } from 'ttag';
import { makeStyles } from '@material-ui/core/styles';
import {
Tools,
TimeRange,
SortInput,
LoadMore,
} from 'components/ListPageControls';
import { Tools, TimeRange, LoadMore } from 'components/ListPageControls';
import { CardHeader, CardContent } from 'components/Card';
import Infos from 'components/Infos';
import TimeInfo from 'components/Infos/TimeInfo';
import ExpandableText from 'components/ExpandableText';
import ReplyRequestReason from 'components/ReplyRequestReason';
import Thumbnail from 'components/Thumbnail';

const COMMENTS_ORDER = [
{
value: 'createdAt',
label: t`Commented at`,
},
];
const DEFAULT_ORDER = COMMENTS_ORDER[0].value;

const LOAD_USER_COMMENTS = gql`
query LoadUserComments(
$filter: ListReplyRequestFilter!
Expand Down Expand Up @@ -124,7 +111,7 @@ function CommentTab({ userId }) {

const listQueryVars = {
filter: urlQuery2Filter(query, userId),
orderBy: [{ [SortInput.getValue(query) || DEFAULT_ORDER]: 'DESC' }],
orderBy: [{ createdAt: 'DESC' }],
};

const {
Expand Down Expand Up @@ -159,7 +146,6 @@ function CommentTab({ userId }) {
<>
<Tools className={classes.tools}>
<TimeRange />
<SortInput defaultOrderBy={DEFAULT_ORDER} options={COMMENTS_ORDER} />
</Tools>
{loading && !totalCount ? (
<CardContent>{t`Loading...`}</CardContent>
Expand Down
16 changes: 6 additions & 10 deletions i18n/zh_TW.po
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ msgid "Why do you think it is not useful?"
msgstr "您認為沒有幫助的理由是什麼呢?"

#: components/LandingPage/SectionArticles.js:153
#: components/ProfilePage/CommentTab.js:165
#: components/ProfilePage/CommentTab.js:151
#: components/ProfilePage/RepliedArticleTab.js:251
#: pages/articles.js:181
#: pages/hoax-for-you.js:133
Expand Down Expand Up @@ -702,7 +702,7 @@ msgid "Total Visit: ${ totalVisits }"
msgstr "${ totalVisits } 次瀏覽"

#: components/ListPageDisplays/ReplySearchItem.js:103
#: components/ProfilePage/CommentTab.js:183
#: components/ProfilePage/CommentTab.js:169
#: components/ProfilePage/RepliedArticleTab.js:269
#: pages/replies.js:256
#, javascript-format
Expand Down Expand Up @@ -2297,7 +2297,7 @@ msgstr "目前已經存有4萬5千筆以上查證過的資訊,透過投入資

#: components/ListPageDisplays/ArticleCard.js:111
#: components/ListPageDisplays/ReplySearchItem.js:112
#: components/ProfilePage/CommentTab.js:192
#: components/ProfilePage/CommentTab.js:178
#: components/ProfilePage/RepliedArticleTab.js:278
#: pages/article/[id].js:370
#: pages/replies.js:263
Expand Down Expand Up @@ -2443,17 +2443,13 @@ msgstr "語音訊息"
msgid "Format"
msgstr "格式"

#: components/ProfilePage/CommentTab.js:23
msgid "Commented at"
msgstr "補充於"

#: components/ProfilePage/CommentTab.js:169
#: components/ProfilePage/CommentTab.js:155
msgid ""
"This user does not provide comments to any message in the specified date "
"range."
msgstr "這名使用者在指定日期範圍內沒有提供任何回報補充"

#: components/ProfilePage/CommentTab.js:173
#: components/ProfilePage/CommentTab.js:159
#, javascript-format
msgid "${ totalCount } comment matching criteria"
msgid_plural "${ totalCount } comments matching criteria"
Expand All @@ -2467,7 +2463,7 @@ msgstr "回報補充"
msgid "comments"
msgstr "回報補充"

#: components/ProfilePage/CommentTab.js:198
#: components/ProfilePage/CommentTab.js:184
msgid "${ article.replyCount } reply"
msgid_plural "${ article.replyCount } replies"
msgstr[0] "${ article.replyCount } 則回應"
Expand Down

0 comments on commit 757035a

Please sign in to comment.