mirror of
https://github.com/git-touch/git-touch
synced 2024-12-16 18:28:51 +01:00
refactor: github palette
This commit is contained in:
parent
eac84184af
commit
ca75048f51
@ -72,9 +72,9 @@ class CommitsScreen extends StatelessWidget {
|
|||||||
var size = 18.0;
|
var size = 18.0;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case 'SUCCESS':
|
case 'SUCCESS':
|
||||||
return Icon(Octicons.check, color: PrimerColors.green500, size: size);
|
return Icon(Octicons.check, color: GithubPalette.open, size: size);
|
||||||
case 'FAILURE':
|
case 'FAILURE':
|
||||||
return Icon(Octicons.x, color: PrimerColors.red600, size: size);
|
return Icon(Octicons.x, color: GithubPalette.closed, size: size);
|
||||||
default:
|
default:
|
||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,9 @@ Tuple2<String, String> parseRepositoryFullName(String fullName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class GithubPalette {
|
class GithubPalette {
|
||||||
static const green = Color(0xff2cbe4e);
|
static const open = Color(0xff2cbe4e);
|
||||||
|
static const closed = PrimerColors.red600;
|
||||||
|
static const merged = PrimerColors.purple500;
|
||||||
}
|
}
|
||||||
|
|
||||||
// final pageSize = 5;
|
// final pageSize = 5;
|
||||||
|
@ -65,7 +65,7 @@ class IssueItem extends StatelessWidget {
|
|||||||
isPullRequest
|
isPullRequest
|
||||||
? Octicons.git_pull_request
|
? Octicons.git_pull_request
|
||||||
: Octicons.issue_opened,
|
: Octicons.issue_opened,
|
||||||
color: GithubPalette.green,
|
color: GithubPalette.open,
|
||||||
size: 18),
|
size: 18),
|
||||||
SizedBox(width: 6),
|
SizedBox(width: 6),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
@ -37,9 +37,9 @@ class _NotificationItemState extends State<NotificationItem> {
|
|||||||
case 'Issue':
|
case 'Issue':
|
||||||
switch (payload.state) {
|
switch (payload.state) {
|
||||||
case 'OPEN':
|
case 'OPEN':
|
||||||
return _buildIcon(Octicons.issue_opened, GithubPalette.green);
|
return _buildIcon(Octicons.issue_opened, GithubPalette.open);
|
||||||
case 'CLOSED':
|
case 'CLOSED':
|
||||||
return _buildIcon(Octicons.issue_closed, PrimerColors.red600);
|
return _buildIcon(Octicons.issue_closed, GithubPalette.closed);
|
||||||
default:
|
default:
|
||||||
return _buildIcon(Octicons.person);
|
return _buildIcon(Octicons.person);
|
||||||
}
|
}
|
||||||
@ -47,11 +47,11 @@ class _NotificationItemState extends State<NotificationItem> {
|
|||||||
case 'PullRequest':
|
case 'PullRequest':
|
||||||
switch (payload.state) {
|
switch (payload.state) {
|
||||||
case 'OPEN':
|
case 'OPEN':
|
||||||
return _buildIcon(Octicons.git_pull_request, GithubPalette.green);
|
return _buildIcon(Octicons.git_pull_request, GithubPalette.open);
|
||||||
case 'CLOSED':
|
case 'CLOSED':
|
||||||
return _buildIcon(Octicons.git_pull_request, PrimerColors.red600);
|
return _buildIcon(Octicons.git_pull_request, GithubPalette.closed);
|
||||||
case 'MERGED':
|
case 'MERGED':
|
||||||
return _buildIcon(Octicons.git_merge, PrimerColors.purple500);
|
return _buildIcon(Octicons.git_merge, GithubPalette.merged);
|
||||||
default:
|
default:
|
||||||
return _buildIcon(Octicons.person);
|
return _buildIcon(Octicons.person);
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ class TimelineItem extends StatelessWidget {
|
|||||||
return TimelineEventItem(
|
return TimelineEventItem(
|
||||||
actor: payload['actor']['login'],
|
actor: payload['actor']['login'],
|
||||||
iconData: Octicons.primitive_dot,
|
iconData: Octicons.primitive_dot,
|
||||||
iconColor: GithubPalette.green,
|
iconColor: GithubPalette.open,
|
||||||
textSpan: TextSpan(
|
textSpan: TextSpan(
|
||||||
text: ' referenced this on #' +
|
text: ' referenced this on #' +
|
||||||
payload['source']['number'].toString()),
|
payload['source']['number'].toString()),
|
||||||
@ -123,7 +123,7 @@ class TimelineItem extends StatelessWidget {
|
|||||||
return TimelineEventItem(
|
return TimelineEventItem(
|
||||||
actor: payload['actor']['login'],
|
actor: payload['actor']['login'],
|
||||||
iconData: Octicons.circle_slash,
|
iconData: Octicons.circle_slash,
|
||||||
iconColor: PrimerColors.red600,
|
iconColor: GithubPalette.closed,
|
||||||
textSpan: TextSpan(text: ' closed this '),
|
textSpan: TextSpan(text: ' closed this '),
|
||||||
item: payload,
|
item: payload,
|
||||||
);
|
);
|
||||||
@ -132,7 +132,7 @@ class TimelineItem extends StatelessWidget {
|
|||||||
return TimelineEventItem(
|
return TimelineEventItem(
|
||||||
actor: payload['actor']['login'],
|
actor: payload['actor']['login'],
|
||||||
iconData: Octicons.primitive_dot,
|
iconData: Octicons.primitive_dot,
|
||||||
iconColor: GithubPalette.green,
|
iconColor: GithubPalette.open,
|
||||||
textSpan: TextSpan(text: ' reopened this '),
|
textSpan: TextSpan(text: ' reopened this '),
|
||||||
item: payload,
|
item: payload,
|
||||||
);
|
);
|
||||||
@ -246,7 +246,7 @@ class TimelineItem extends StatelessWidget {
|
|||||||
case 'PullRequestReview':
|
case 'PullRequestReview':
|
||||||
return TimelineEventItem(
|
return TimelineEventItem(
|
||||||
actor: payload['author']['login'],
|
actor: payload['author']['login'],
|
||||||
iconColor: PrimerColors.green500,
|
iconColor: GithubPalette.open,
|
||||||
iconData: Octicons.check,
|
iconData: Octicons.check,
|
||||||
textSpan: _buildReviewText(context, payload),
|
textSpan: _buildReviewText(context, payload),
|
||||||
item: payload,
|
item: payload,
|
||||||
@ -258,7 +258,7 @@ class TimelineItem extends StatelessWidget {
|
|||||||
return TimelineEventItem(
|
return TimelineEventItem(
|
||||||
actor: payload['actor']['login'],
|
actor: payload['actor']['login'],
|
||||||
iconData: Octicons.git_merge,
|
iconData: Octicons.git_merge,
|
||||||
iconColor: PrimerColors.purple500,
|
iconColor: GithubPalette.merged,
|
||||||
textSpan: TextSpan(children: [
|
textSpan: TextSpan(children: [
|
||||||
TextSpan(text: ' merged commit '),
|
TextSpan(text: ' merged commit '),
|
||||||
TextSpan(text: payload['commit']['oid'].substring(0, 8)),
|
TextSpan(text: payload['commit']['oid'].substring(0, 8)),
|
||||||
|
Loading…
Reference in New Issue
Block a user