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