Skip to content

Commit

Permalink
feat: bookmark button in feed item footer (#516)
Browse files Browse the repository at this point in the history
## Description
This PR introduces a bookmark button inside the feed item footer

## Type of Change
- [ ] Bug fix
- [x] New feature
- [ ] Breaking change
- [ ] Refactoring
- [ ] Documentation
- [ ] Chore

## Screenshots (if applicable)
<img width="180" alt="Screenshot 2025-01-07 at 20 23 50"
src="https://github.com/user-attachments/assets/13f26e64-50cb-460c-b3bd-802bca5209de"
/>
<img width="180" alt="Screenshot 2025-01-07 at 20 24 03"
src="https://github.com/user-attachments/assets/d29574b1-00b5-453b-8d3e-d9204c1fd4c5"
/>
  • Loading branch information
ice-hector authored Jan 8, 2025
1 parent 5d1ab6e commit 1849d97
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 49 deletions.
38 changes: 19 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.1001.0)
aws-sdk-core (3.211.0)
aws-partitions (1.1032.0)
aws-sdk-core (3.214.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.95.0)
aws-sdk-kms (1.96.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.169.0)
aws-sdk-s3 (1.177.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
Expand Down Expand Up @@ -58,17 +58,17 @@ GEM
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-multipart (1.1.0)
multipart-post (~> 2.0)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.1)
faraday (~> 1.0)
fastimage (2.3.1)
fastlane (2.225.0)
fastimage (2.4.0)
fastlane (2.226.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -108,7 +108,7 @@ GEM
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty (~> 0.4.0)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-firebase_app_distribution (0.9.1)
google-apis-firebaseappdistribution_v1 (~> 0.3.0)
Expand Down Expand Up @@ -157,12 +157,12 @@ GEM
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.7)
http-cookie (1.0.8)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.2)
json (2.7.6)
jwt (2.9.3)
json (2.9.1)
jwt (2.10.1)
base64
mini_magick (4.13.2)
mini_mime (1.1.5)
Expand All @@ -171,20 +171,20 @@ GEM
nanaimo (0.4.0)
naturally (2.2.1)
nkf (0.2.0)
optparse (0.5.0)
optparse (0.6.0)
os (1.1.4)
plist (3.7.1)
plist (3.7.2)
public_suffix (6.0.1)
rake (13.2.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.3.9)
rouge (2.0.7)
rexml (3.4.0)
rouge (3.28.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
rubyzip (2.4.1)
security (0.1.5)
signet (0.19.0)
addressable (~> 2.8)
Expand Down Expand Up @@ -213,8 +213,8 @@ GEM
colored2 (~> 3.1)
nanaimo (~> 0.4.0)
rexml (>= 3.3.6, < 4.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty (0.4.0)
rouge (~> 3.28.0)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)

Expand Down
56 changes: 28 additions & 28 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/video_player_avfoundation/darwin"

SPEC CHECKSUMS:
audio_waveforms: a6dde7fe7c0ea05f06ffbdb0f7c1b2b2ba6cedcf
audio_waveforms: cd736909ebc6b6a164eb74701d8c705ce3241e1c
BanubaARCloudSDK: 40da62afeea642301ca8092600c9bb9cf67fe30e
BanubaAudioBrowserSDK: 3a92807e60daa70dcaa1e76920abab97e7a73bf4
BanubaLicenseServicingSDK: f2b51a4288d6b9796063855f5db6dc227819de22
Expand All @@ -374,46 +374,46 @@ SPEC CHECKSUMS:
BNBSdkApi: f773621958cf0f7776e18f90b96ace13b29d84e2
BNBSdkCore: cc7711127dbcaf392d0a25f4a858d98ffc5c9213
BNBSkin: 3a741bbba57a2a860fe4a69dbd597d7d9aea5793
camera_avfoundation: 04b44aeb14070126c6529e5ab82cc7c9fca107cf
device_info_plus: 71ffc6ab7634ade6267c7a93088ed7e4f74e5896
camera_avfoundation: dd002b0330f4981e1bbcb46ae9b62829237459a4
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
ffmpeg-kit-ios-full-gpl: 80adc341962e55ef709e36baa8ed9a70cf4ea62b
ffmpeg_kit_flutter_full_gpl: ce18b888487c05c46ed252cd2e7956812f2e3bd1
file_picker: 9b3292d7c8bc68c8a7bf8eb78f730e49c8efc517
file_saver: 6cdbcddd690cb02b0c1a0c225b37cd805c2bf8b6
ffmpeg_kit_flutter_full_gpl: 8d15c14c0c3aba616fac04fe44b3d27d02e3c330
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
file_saver: 503e386464dbe118f630e17b4c2e1190fa0cf808
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99
flutter_keyboard_visibility: 4625131e43015dbbe759d9b20daaf77e0e3f6619
flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13
image_cropper: 5f162dcf988100dc1513f9c6b7eb42cd6fbf9156
image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a
ion_screenshot_detector: 6981b7ec0add023ce57337882e28dc4b80caad4b
local_auth_darwin: 553ce4f9b16d3fdfeafce9cf042e7c9f77c1c391
flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
ion_screenshot_detector: bd85296e1347b5bf5acf71407a6d9b7933bfe604
local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
package_info_plus: 566e1b7a2f3900e4b0020914ad3fc051dcc95596
passkeys_ios: 939d7d44f825048c8dffd4644f52444164c80ecd
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
photo_manager: d2fbcc0f2d82458700ee6256a15018210a81d413
qr_code_scanner: d77f94ecc9abf96d9b9b8fc04ef13f611e5a147a
quill_native_bridge: fd2819cf6da02fb6cbf9de37835f96e798e145eb
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
passkeys_ios: fdae8c06e2178a9fcb9261a6cb21fb9a06a81d53
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
photo_manager: ff695c7a1dd5bc379974953a2b5c0a293f7c4c8a
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
quill_native_bridge: e5afa7d49c08cf68c52a5e23bc272eba6925c622
SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
sqflite: c35dad70033b8862124f8337cc994a809fcd9fa3
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
sqlite3: 7559e33dae4c78538df563795af3a86fc887ee71
sqlite3_flutter_libs: f0b59f6bb2a18597d0796558725007e5a7428397
sqlite3_flutter_libs: 1b4e98da20ebd4e9b1240269b78cdcf492dbe9f3
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
ua_client_hints: ef4ddde0e2b2be5f0731a31721c4cbbb889b1aa4
url_launcher_ios: 694010445543906933d732453a59da0a173ae33d
ve_sdk_flutter: e23c4a6f1b84eeacee1daf2a81ba0f0694ed76f1
ua_client_hints: 3b617011e47bea4b1ea65647efa12860b7280ad5
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
ve_sdk_flutter: c90ec3fc424953a7b82cd1edd5143bc756899e92
VEEffectsSDK: 40dca6a76aeff8630ce1b49ef7643d2a2655dd0f
VEExportSDK: 32e97cf98ecbf86aed563fbd4c9131d7bbddbe92
VEPlaybackSDK: 65bb7377c9c8524557d7b5d6723e321fc16fc4a1
video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
VideoEditor: b3e55fe6a6589e715365da822172f54b6fea8169

PODFILE CHECKSUM: f19afb20048b05a04dbc809ad7d199f1df053e9a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import 'package:ion/app/components/counter_items_footer/likes_counter_button.dar
import 'package:ion/app/components/counter_items_footer/replies_counter_button.dart';
import 'package:ion/app/components/counter_items_footer/reposts_counter_button.dart';
import 'package:ion/app/components/counter_items_footer/share_button.dart';
import 'package:ion/app/extensions/num.dart';
import 'package:ion/app/extensions/extensions.dart';
import 'package:ion/app/features/components/entities_list/components/bookmark_button/bookmark_button.dart';
import 'package:ion/app/features/nostr/model/event_reference.c.dart';

class CounterItemsFooter extends HookConsumerWidget {
Expand Down Expand Up @@ -49,6 +50,12 @@ class CounterItemsFooter extends HookConsumerWidget {
color: color,
),
),
BookmarkButton(
eventReference: eventReference,
iconSize: 16.0.s,
colorFilter:
ColorFilter.mode(context.theme.appColors.onTertararyBackground, BlendMode.srcIn),
),
ShareButton(
eventReference: eventReference,
color: color,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ import 'package:ion/app/features/nostr/model/event_reference.c.dart';
import 'package:ion/generated/assets.gen.dart';

class BookmarkButton extends ConsumerWidget {
const BookmarkButton({required this.eventReference, super.key});
const BookmarkButton({
required this.eventReference,
this.iconSize,
this.colorFilter,
super.key,
});

final EventReference? eventReference;
final double? iconSize;
final ColorFilter? colorFilter;

@override
Widget build(BuildContext context, WidgetRef ref) {
Expand All @@ -19,9 +26,13 @@ class BookmarkButton extends ConsumerWidget {
}

final isBookmarked = ref.watch(isBookmarkedProvider(eventReference!)).value ?? false;

return IconButton(
icon: SvgPicture.asset(
isBookmarked ? Assets.svg.iconBookmarksOn : Assets.svg.iconBookmarks,
width: iconSize,
height: iconSize,
colorFilter: isBookmarked ? null : colorFilter,
),
onPressed: () => ref.read(bookmarksNotifierProvider.notifier).toggleBookmark(
eventReference!,
Expand Down

0 comments on commit 1849d97

Please sign in to comment.