diff --git a/lib/screens/bb_commits.dart b/lib/screens/bb_commits.dart index 9c4730d..d8bb874 100644 --- a/lib/screens/bb_commits.dart +++ b/lib/screens/bb_commits.dart @@ -37,6 +37,7 @@ class BbCommitsScreen extends StatelessWidget { return CommitItem( url: '${auth.activeAccount.domain}/$owner/$name/commits/${v.hash}', avatarUrl: v.author.user?.avatarUrl, + avatarLink: null, author: v.author.raw.replaceFirst(RegExp(r' <.*>'), ''), createdAt: v.date, message: v.message, diff --git a/lib/screens/gh_commits.dart b/lib/screens/gh_commits.dart index 16d976a..41d2fba 100644 --- a/lib/screens/gh_commits.dart +++ b/lib/screens/gh_commits.dart @@ -51,11 +51,13 @@ class GhCommitsScreen extends StatelessWidget { onRefresh: () => _query(context), onLoadMore: (cursor) => _query(context, cursor), itemBuilder: (payload) { + final login = payload.author?.user?.login; return CommitItem( url: payload.url, avatarUrl: payload.author?.avatarUrl, + avatarLink: login == null ? null : '/$login', message: payload.messageHeadline, - author: payload.author?.user?.login ?? payload.author.name, + author: login ?? payload.author.name, createdAt: payload.committedDate, widgets: payload.status == null ? null diff --git a/lib/screens/gl_commits.dart b/lib/screens/gl_commits.dart index 0f90327..b9914db 100644 --- a/lib/screens/gl_commits.dart +++ b/lib/screens/gl_commits.dart @@ -34,9 +34,11 @@ class GlCommitsScreen extends StatelessWidget { return CommitItem( author: c.authorName, avatarUrl: null, + avatarLink: null, createdAt: c.createdAt, message: c.message, url: '$prefix/commit/${c.id}', // TODO: + // url: '/gitlab/projects/$id/commit/${c.id}', // TODO: ); }, ); diff --git a/lib/screens/gt_commits.dart b/lib/screens/gt_commits.dart index 9c117b3..17f928d 100644 --- a/lib/screens/gt_commits.dart +++ b/lib/screens/gt_commits.dart @@ -34,6 +34,7 @@ class GtCommitsScreen extends StatelessWidget { return CommitItem( author: c.author?.login ?? c.commit.author.name, avatarUrl: null, + avatarLink: null, createdAt: c.commit.author.date, message: c.commit.message, url: c.htmlUrl, diff --git a/lib/widgets/commit_item.dart b/lib/widgets/commit_item.dart index 86b2d08..9909669 100644 --- a/lib/widgets/commit_item.dart +++ b/lib/widgets/commit_item.dart @@ -9,6 +9,7 @@ import 'package:timeago/timeago.dart' as timeago; class CommitItem extends StatelessWidget { final String url; final String avatarUrl; + final String avatarLink; final String message; final String author; final DateTime createdAt; @@ -16,6 +17,7 @@ class CommitItem extends StatelessWidget { CommitItem({ @required this.url, @required this.avatarUrl, + @required this.avatarLink, @required this.message, @required this.author, @required this.createdAt, @@ -31,7 +33,7 @@ class CommitItem extends StatelessWidget { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Avatar(url: avatarUrl), + Avatar(url: avatarUrl, linkUrl: avatarLink), SizedBox(width: 10), Expanded( child: Column(