Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[auth] Rename pin/unpin to fav/unfav

Neeraj Gupta94b09acaaac3
diff --git a/auth/lib/l10n/arb/app_en.arb b/auth/lib/l10n/arb/app_en.arb
index a1f3dd61d2..b5f7121ff6 100644
--- a/auth/lib/l10n/arb/app_en.arb
+++ b/auth/lib/l10n/arb/app_en.arb
@@ -447,8 +447,10 @@
"customEndpoint": "Connected to {endpoint}",
"pinText": "Pin",
"unpinText": "Unpin",
- "pinnedCodeMessage": "{code} has been pinned",
- "unpinnedCodeMessage": "{code} has been unpinned",
+ "fav": "Favorite",
+ "unfav": "Unfavorite",
+ "favoritedCodeMessage": "{code} has been added to favorites",
+ "unfavoritedCodeMessage": "{code} has been removed from favorites",
"tags": "Tags",
"createNewTag": "Create New Tag",
"tag": "Tag",
diff --git a/auth/lib/ui/code_widget.dart b/auth/lib/ui/code_widget.dart
index 5ebbb86d2b..d0ee8a7872 100644
--- a/auth/lib/ui/code_widget.dart
+++ b/auth/lib/ui/code_widget.dart
@@ -113,20 +113,27 @@ class _CodeWidgetState extends State<CodeWidget> {
final l10n = context.l10n;
Widget getCardContents(AppLocalizations l10n) {
+ // final bool isFavorite = widget.code.isPinned;
return Stack(
children: [
- if (widget.code.isPinned)
- Align(
- alignment: Alignment.topRight,
- child: CustomPaint(
- painter: PinBgPainter(
- color: colorScheme.pinnedBgColor,
- ),
- size: widget.isCompactMode
- ? const Size(24, 24)
- : const Size(39, 39),
- ),
- ),
+ // if (isFavorite)
+ // Align(
+ // alignment: Alignment.topRight,
+ // child: Icon(
+ // Icons.star,
+ // color: colorScheme.pinnedBgColor,
+ // size: widget.isCompactMode ? 16 : 24,
+ // ),
+ // //
+ // // child: CustomPaint(
+ // // painter: PinBgPainter(
+ // // color: colorScheme.pinnedBgColor,
+ // // ),
+ // // size: widget.isCompactMode
+ // // ? const Size(24, 24)
+ // // : const Size(39, 39),
+ // // ),
+ // ),
if (widget.code.isTrashed && kDebugMode)
Align(
alignment: Alignment.topLeft,
@@ -172,15 +179,10 @@ class _CodeWidgetState extends State<CodeWidget> {
if (widget.code.isPinned) ...[
Align(
alignment: Alignment.topRight,
- child: Padding(
- padding: widget.isCompactMode
- ? const EdgeInsets.only(right: 4, top: 4)
- : const EdgeInsets.only(right: 6, top: 6),
- child: SvgPicture.asset(
- "assets/svg/pin-card.svg",
- width: widget.isCompactMode ? 8 : null,
- height: widget.isCompactMode ? 8 : null,
- ),
+ child: Icon(
+ Icons.star,
+ color: colorScheme.primary700.withOpacity(0.4),
+ size: widget.isCompactMode ? 16 : 24,
),
),
],
@@ -272,11 +274,10 @@ class _CodeWidgetState extends State<CodeWidget> {
),
if (!widget.code.isTrashed)
MenuItem(
- label:
- widget.code.isPinned ? l10n.unpinText : l10n.pinText,
+ label: widget.code.isPinned ? l10n.unfav : l10n.fav,
icon: widget.code.isPinned
- ? Icons.push_pin
- : Icons.push_pin_outlined,
+ ? Icons.star_border
+ : Icons.star_border_outlined,
onSelected: () => _onPinPressed(null),
),
if (!widget.code.isTrashed)
@@ -579,8 +580,8 @@ class _CodeWidgetState extends State<CodeWidget> {
(value) => showToast(
context,
!currentlyPinned
- ? context.l10n.pinnedCodeMessage(widget.code.issuer)
- : context.l10n.unpinnedCodeMessage(widget.code.issuer),
+ ? context.l10n.favoritedCodeMessage(widget.code.issuer)
+ : context.l10n.unfavoritedCodeMessage(widget.code.issuer),
),
),
);
diff --git a/auth/lib/ui/components/code_selection_actions_widget.dart b/auth/lib/ui/components/code_selection_actions_widget.dart
index 9cf514f7c2..676fa3b801 100644
--- a/auth/lib/ui/components/code_selection_actions_widget.dart
+++ b/auth/lib/ui/components/code_selection_actions_widget.dart
@@ -58,9 +58,9 @@ class _CodeSelectionActionsWidgetState
items.add(
SelectionActionButton(
labelText: widget.code.isPinned
- ? context.l10n.unpinText
- : context.l10n.pinText,
- icon: widget.code.isPinned ? Icons.push_pin : Icons.push_pin_outlined,
+ ? context.l10n.unfav
+ : context.l10n.fav,
+ icon: widget.code.isPinned ? Icons.star_outline : Icons.star,
onTap: widget.onPin,
),
);