Przeglądaj źródła

Only show 'invite your friends to ente' when incoming shared albums are empty

ashilkn 2 lat temu
rodzic
commit
6762a8b1e4
1 zmienionych plików z 14 dodań i 13 usunięć
  1. 14 13
      lib/ui/tabs/shared_collections_tab.dart

+ 14 - 13
lib/ui/tabs/shared_collections_tab.dart

@@ -229,19 +229,20 @@ class _SharedCollectionsTabState extends State<SharedCollectionsTab>
                     ),
                   )
                 : const SizedBox.shrink(),
-            const SizedBox(height: 24),
-            Padding(
-              padding: const EdgeInsets.symmetric(horizontal: 24.0),
-              child: ButtonWidget(
-                buttonType: ButtonType.trailingIcon,
-                labelText: S.of(context).inviteYourFriends,
-                icon: Icons.ios_share_outlined,
-                onTap: () async {
-                  shareText(S.of(context).shareTextRecommendUsingEnte);
-                },
-              ),
-            ),
-            const SizedBox(height: 44),
+            const SizedBox(height: 32),
+            collections.incoming.isNotEmpty
+                ? Padding(
+                    padding: const EdgeInsets.fromLTRB(24, 0, 24, 44),
+                    child: ButtonWidget(
+                      buttonType: ButtonType.trailingIconPrimary,
+                      labelText: S.of(context).inviteYourFriends,
+                      icon: Icons.ios_share_outlined,
+                      onTap: () async {
+                        shareText(S.of(context).shareTextRecommendUsingEnte);
+                      },
+                    ),
+                  )
+                : const SizedBox.shrink(),
           ],
         ),
       ),