1
0
mirror of https://github.com/git-touch/git-touch synced 2025-01-22 12:10:12 +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,12 +232,14 @@ class RepoScreen extends StatelessWidget {
branch: payload['defaultBranchRef']['name'], // FIXME: null branch: payload['defaultBranchRef']['name'], // FIXME: null
), ),
), ),
if (payload['hasIssuesEnabled'] as bool)
TableViewItem( TableViewItem(
leftIconData: Octicons.issue_opened, leftIconData: Octicons.issue_opened,
text: Text('Issues'), text: Text('Issues'),
rightWidget: Text( rightWidget: Text(
numberFormat.format(payload['issues']['totalCount'])), numberFormat.format(payload['issues']['totalCount'])),
screenBuilder: (_) => IssuesScreen(owner: owner, name: name), screenBuilder: (_) =>
IssuesScreen(owner: owner, name: name),
), ),
TableViewItem( TableViewItem(
leftIconData: Octicons.git_pull_request, leftIconData: Octicons.git_pull_request,