Skip to content

Commit

Permalink
[mob][photos] send link button changed
Browse files Browse the repository at this point in the history
  • Loading branch information
AmanRajSinghMourya committed Jun 3, 2024
1 parent ebf83b7 commit 39d50d2
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 53 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:math' as math;

import "package:flutter/material.dart";
import "package:photos/theme/ente_theme.dart";

Expand Down Expand Up @@ -89,11 +91,47 @@ class __BodyState extends State<_Body> {
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Icon(
widget.icon,
size: 24,
color: getEnteColorScheme(context).textMuted,
),
if (widget.icon == Icons.navigation_rounded)
Transform.rotate(
angle: math.pi / 2,
child: Icon(
widget.icon,
size: 24,
color: getEnteColorScheme(context).primary300,
shadows: const [
BoxShadow(
color: Color.fromARGB(30, 0, 179, 60),
offset: Offset(0, 2.51),
blurRadius: 5.02,
spreadRadius: 0,
),
BoxShadow(
color: Color.fromARGB(61, 0, 179, 60),
offset: Offset(0, 1.25),
blurRadius: 3.76,
spreadRadius: 0,
),
BoxShadow(
color: Color.fromARGB(61, 0, 179, 60),
offset: Offset(0, 0.63),
blurRadius: 1.88,
spreadRadius: 0,
),
BoxShadow(
color: Color.fromARGB(61, 255, 255, 255),
offset: Offset(0.63, 0.63),
blurRadius: 1.25,
spreadRadius: 0,
),
],
),
)
else
Icon(
widget.icon,
size: 24,
color: getEnteColorScheme(context).textMuted,
),
const SizedBox(height: 4),
Text(
widget.labelText,
Expand Down
97 changes: 49 additions & 48 deletions mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import 'package:photos/ui/components/action_sheet_widget.dart';
import "package:photos/ui/components/bottom_action_bar/selection_action_button_widget.dart";
import 'package:photos/ui/components/buttons/button_widget.dart';
import 'package:photos/ui/components/models/button_type.dart';
import 'package:photos/ui/sharing/manage_links_widget.dart';
// import 'package:photos/ui/sharing/manage_links_widget.dart';
import "package:photos/ui/sharing/show_images_prevew.dart";
import "package:photos/ui/tools/collage/collage_creator_page.dart";
import "package:photos/ui/viewer/location/update_location_data_widget.dart";
Expand Down Expand Up @@ -168,7 +168,7 @@ class _FileSelectionActionsWidgetState
} else {
items.add(
SelectionActionButton(
icon: Icons.link_outlined,
icon: Icons.navigation_rounded,
labelText: S.of(context).shareLink,
onTap: anyUploadedFiles ? _onCreateLinkTapped : null,
shouldShow: ownedFilesCount > 0,
Expand Down Expand Up @@ -655,52 +655,53 @@ class _FileSelectionActionsWidgetState
.createSharedCollectionLink(context, split.ownedByCurrentUser);

final List<EnteFile> ownedSelectedFiles = split.ownedByCurrentUser;

final actionResult = await showActionSheet(
context: context,
buttons: [
ButtonWidget(
labelText: S.of(context).shareLink,
buttonType: ButtonType.neutral,
buttonSize: ButtonSize.large,
shouldStickToDarkTheme: true,
buttonAction: ButtonAction.first,
isInAlert: true,
),
ButtonWidget(
labelText: S.of(context).manageLink,
buttonType: ButtonType.secondary,
buttonSize: ButtonSize.large,
buttonAction: ButtonAction.second,
shouldStickToDarkTheme: true,
isInAlert: true,
),
ButtonWidget(
labelText: S.of(context).done,
buttonType: ButtonType.secondary,
buttonSize: ButtonSize.large,
buttonAction: ButtonAction.third,
shouldStickToDarkTheme: true,
isInAlert: true,
),
],
title: S.of(context).publicLinkCreated,
body: S.of(context).youCanManageYourLinksInTheShareTab,
actionSheetType: ActionSheetType.defaultActionSheet,
);
if (actionResult?.action != null) {
if (actionResult!.action == ButtonAction.first) {
placeholderPath =
await _selectedFilesPlaceholderPath(ownedSelectedFiles);
await _sendLink();
}
if (actionResult.action == ButtonAction.second) {
await routeToPage(
context,
ManageSharedLinkWidget(collection: _cachedCollectionForSharedLink),
);
}
}
placeholderPath = await _selectedFilesPlaceholderPath(ownedSelectedFiles);
await _sendLink();
// final actionResult = await showActionSheet(
// context: context,
// buttons: [
// ButtonWidget(
// labelText: S.of(context).shareLink,
// buttonType: ButtonType.neutral,
// buttonSize: ButtonSize.large,
// shouldStickToDarkTheme: true,
// buttonAction: ButtonAction.first,
// isInAlert: true,
// ),
// ButtonWidget(
// labelText: S.of(context).manageLink,
// buttonType: ButtonType.secondary,
// buttonSize: ButtonSize.large,
// buttonAction: ButtonAction.second,
// shouldStickToDarkTheme: true,
// isInAlert: true,
// ),
// ButtonWidget(
// labelText: S.of(context).done,
// buttonType: ButtonType.secondary,
// buttonSize: ButtonSize.large,
// buttonAction: ButtonAction.third,
// shouldStickToDarkTheme: true,
// isInAlert: true,
// ),
// ],
// title: S.of(context).publicLinkCreated,
// body: S.of(context).youCanManageYourLinksInTheShareTab,
// actionSheetType: ActionSheetType.defaultActionSheet,
// );
// if (actionResult?.action != null) {
// if (actionResult!.action == ButtonAction.first) {
// placeholderPath =
// await _selectedFilesPlaceholderPath(ownedSelectedFiles);
// await _sendLink();
// }
// if (actionResult.action == ButtonAction.second) {
// await routeToPage(
// context,
// ManageSharedLinkWidget(collection: _cachedCollectionForSharedLink),
// );
// }
// }
widget.selectedFiles.clearAll();
if (mounted) {
setState(() => {});
Expand Down

0 comments on commit 39d50d2

Please sign in to comment.