Merge pull request #1441 from GetStream/fix/emptyAttachmentsLabel

fix(ui,localization): change label displayed when there is no photo or videos to attach
This commit is contained in:
Rafal Adasiewicz
2023-01-26 15:45:20 +01:00
committed by GitHub
16 changed files with 51 additions and 4 deletions
@@ -9,6 +9,9 @@
- Fixed a bug where the `AttachmentPickerBottomSheet` was not able to identify the mobile browser.
- Fixed uploading files on Windows - fixed temp file path.
✅ Added
- New `noPhotoOrVideoLabel` displayed when there is no files to choose.
## 5.2.0
✅ Added
@@ -18,6 +18,9 @@ abstract class Translations {
/// The label for showing no users
String get noUsersLabel;
/// The label for showing no photo or video
String get noPhotoOrVideoLabel;
/// The text for showing user is online
String get userOnlineText;
@@ -373,6 +376,9 @@ class DefaultTranslations implements Translations {
@override
String get noUsersLabel => 'There are no users currently';
@override
String get noPhotoOrVideoLabel => 'There is no photo or video';
@override
String get retryLabel => 'Retry';
@@ -366,7 +366,7 @@ class StreamPhotoGallery extends StatelessWidget {
color: chatThemeData.colorTheme.disabled,
),
emptyTitle: Text(
context.translations.noUsersLabel,
context.translations.noPhotoOrVideoLabel,
style: chatThemeData.textTheme.headline,
),
),
@@ -377,7 +377,7 @@ class StreamPhotoGallery extends StatelessWidget {
return StreamScrollViewLoadMoreError.grid(
onTap: controller.retry,
error: Text(
context.translations.loadingUsersError,
context.translations.genericErrorText,
textAlign: TextAlign.center,
),
);
@@ -400,7 +400,7 @@ class StreamPhotoGallery extends StatelessWidget {
return errorBuilder?.call(context, error) ??
Center(
child: StreamScrollViewErrorWidget(
errorTitle: Text(context.translations.loadingUsersError),
errorTitle: Text(context.translations.genericErrorText),
onRetryPressed: controller.refresh,
),
);