From b8182f3041b863e9a080c9b4768fc49e3d1332bc Mon Sep 17 00:00:00 2001 From: cp-mayank-v Date: Mon, 1 Jul 2024 15:43:44 +0530 Subject: [PATCH] Minor changes --- khelo/assets/locales/app_en.arb | 2 ++ .../components/team_detail_match_content.dart | 5 ++++- .../components/team_detail_member_content.dart | 17 +++++++++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/khelo/assets/locales/app_en.arb b/khelo/assets/locales/app_en.arb index 2b523e03..3fd97276 100644 --- a/khelo/assets/locales/app_en.arb +++ b/khelo/assets/locales/app_en.arb @@ -237,8 +237,10 @@ "team_detail_member_tab_title": "Member", "team_detail_empty_matches_title": "No matches scheduled yet!", "team_detail_empty_matches_description_text": "Get your cricket game on! Schedule your cricket match with ease!", + "team_detail_visitor_empty_matches_description_text": "Until now, the team has not competed.", "team_detail_empty_member_title": "You haven't any member!", "team_detail_empty_member_description_text": "Invite your friends to build your dream team and start tracking matches together.", + "team_detail_visitor_empty_member_description_text": "No member has been added to the team.", "team_detail_empty_stat_title": "No stats available yet!", "team_detail_empty_stat_description_text": "The players are warming up! Stay tuned for exciting stats as the team progresses.", "team_detail_add_member_title": "Add member", diff --git a/khelo/lib/ui/flow/team/detail/components/team_detail_match_content.dart b/khelo/lib/ui/flow/team/detail/components/team_detail_match_content.dart index c8c8ae74..ac79fc9c 100644 --- a/khelo/lib/ui/flow/team/detail/components/team_detail_match_content.dart +++ b/khelo/lib/ui/flow/team/detail/components/team_detail_match_content.dart @@ -46,7 +46,10 @@ class TeamDetailMatchContent extends ConsumerWidget { } else { return EmptyScreen( title: context.l10n.team_detail_empty_matches_title, - description: context.l10n.team_detail_empty_matches_description_text, + description: (state.team?.created_by == state.currentUserId) + ? context.l10n.team_detail_empty_matches_description_text + : context.l10n.team_detail_visitor_empty_matches_description_text, + isShowButton: state.team?.created_by == state.currentUserId, buttonTitle: context.l10n.add_match_screen_title, onTap: () async { bool? isUpdated = await AppRoute.addMatch( diff --git a/khelo/lib/ui/flow/team/detail/components/team_detail_member_content.dart b/khelo/lib/ui/flow/team/detail/components/team_detail_member_content.dart index 1481dc47..b5675b7b 100644 --- a/khelo/lib/ui/flow/team/detail/components/team_detail_member_content.dart +++ b/khelo/lib/ui/flow/team/detail/components/team_detail_member_content.dart @@ -22,11 +22,13 @@ class TeamDetailMemberContent extends ConsumerWidget { state.team?.players?.isNotEmpty == true) { return Column( children: [ - _addMemberButton( - context, - onTap: () => - AppRoute.addTeamMember(team: state.team!).push(context), - ), + if (state.team!.created_by == state.currentUserId) ...[ + _addMemberButton( + context, + onTap: () => + AppRoute.addTeamMember(team: state.team!).push(context), + ), + ], Expanded( child: ListView.separated( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), @@ -46,7 +48,10 @@ class TeamDetailMemberContent extends ConsumerWidget { } else { return EmptyScreen( title: context.l10n.team_detail_empty_member_title, - description: context.l10n.team_detail_empty_member_description_text, + description: state.team!.created_by == state.currentUserId + ? context.l10n.team_detail_empty_member_description_text + : context.l10n.team_detail_visitor_empty_member_description_text, + isShowButton: state.team!.created_by == state.currentUserId, buttonTitle: context.l10n.team_list_add_members_title, onTap: () => AppRoute.addTeamMember(team: state.team!).push(context), );