1
0
mirror of https://github.com/git-touch/git-touch synced 2025-01-22 20:19:57 +01:00

feat: hide issue entry if not enabled

This commit is contained in:
Rongjian Zhang 2019-09-23 16:01:55 +08:00
parent 2ccf697f19
commit 9c5ef59013

View File

@ -47,6 +47,7 @@ class RepoScreen extends StatelessWidget {
isFork isFork
description description
diskUsage diskUsage
hasIssuesEnabled
watchers { watchers {
totalCount totalCount
} }
@ -231,13 +232,15 @@ class RepoScreen extends StatelessWidget {
branch: payload['defaultBranchRef']['name'], // FIXME: null branch: payload['defaultBranchRef']['name'], // FIXME: null
), ),
), ),
TableViewItem( if (payload['hasIssuesEnabled'] as bool)
leftIconData: Octicons.issue_opened, TableViewItem(
text: Text('Issues'), leftIconData: Octicons.issue_opened,
rightWidget: Text( text: Text('Issues'),
numberFormat.format(payload['issues']['totalCount'])), rightWidget: Text(
screenBuilder: (_) => IssuesScreen(owner: owner, name: name), numberFormat.format(payload['issues']['totalCount'])),
), screenBuilder: (_) =>
IssuesScreen(owner: owner, name: name),
),
TableViewItem( TableViewItem(
leftIconData: Octicons.git_pull_request, leftIconData: Octicons.git_pull_request,
text: Text('Pull requests'), text: Text('Pull requests'),