Skip to content

Commit

Permalink
fix: remove hardcoded visibility settings value for the story preview…
Browse files Browse the repository at this point in the history
… and "verified accounts" option (#520)

## Description
<!-- Briefly explain the purpose of this PR and what it accomplishes.
-->
- remove hardcoded visibility settings value for the story preview 
- remove "verified accounts" option

## Additional Notes
<!-- Add any extra context or relevant information here. -->

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

## Screenshots (if applicable)
<!-- Include screenshots to demonstrate any UI changes. -->
<!-- <img width="180" alt="image" src="image_url_here"> -->

---------

Co-authored-by: ice-ajax <190340101+ice-ajax@users.noreply.github.com>
  • Loading branch information
ice-alcides and ice-ajax authored Jan 9, 2025
1 parent e102ec0 commit 918405c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import 'package:ion/generated/assets.gen.dart';
enum WhoCanReplySettingsOption {
everyone(null),
followedAccounts('following'),
// TODO: Add support for verified accounts setting when API is ready
verifiedAccounts(null),
mentionedAccounts('mentioned');

const WhoCanReplySettingsOption(this.tagValue);
Expand All @@ -24,8 +22,6 @@ enum WhoCanReplySettingsOption {
WhoCanReplySettingsOption.everyone => context.i18n.visibility_settings_everyone,
WhoCanReplySettingsOption.followedAccounts =>
context.i18n.visibility_settings_followed_accounts,
WhoCanReplySettingsOption.verifiedAccounts =>
context.i18n.visibility_settings_verified_accounts,
WhoCanReplySettingsOption.mentionedAccounts =>
context.i18n.visibility_settings_mentioned_accounts,
};
Expand All @@ -35,7 +31,6 @@ enum WhoCanReplySettingsOption {
final icon = switch (this) {
WhoCanReplySettingsOption.everyone => Assets.svg.iconPostEveryone,
WhoCanReplySettingsOption.followedAccounts => Assets.svg.iconSearchFollow,
WhoCanReplySettingsOption.verifiedAccounts => Assets.svg.iconPostVerifyaccount,
WhoCanReplySettingsOption.mentionedAccounts => Assets.svg.iconFieldNickname,
};

Expand Down

This file was deleted.

33 changes: 22 additions & 11 deletions lib/app/features/feed/stories/views/pages/story_preview_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:ion/app/components/list_item/list_item.dart';
import 'package:ion/app/components/progress_bar/centered_loading_indicator.dart';
import 'package:ion/app/components/screen_offset/screen_bottom_offset.dart';
import 'package:ion/app/extensions/extensions.dart';
Expand All @@ -12,12 +13,12 @@ import 'package:ion/app/features/feed/providers/selected_who_can_reply_option_pr
import 'package:ion/app/features/feed/stories/views/components/story_preview/actions/story_share_button.dart';
import 'package:ion/app/features/feed/stories/views/components/story_preview/media/story_image_preview.dart';
import 'package:ion/app/features/feed/stories/views/components/story_preview/media/story_video_preview.dart';
import 'package:ion/app/features/feed/stories/views/components/story_preview/user/verified_account_list_item.dart';
import 'package:ion/app/features/feed/views/pages/who_can_reply_settings_modal/who_can_reply_settings_modal.dart';
import 'package:ion/app/router/app_routes.c.dart';
import 'package:ion/app/router/components/navigation_app_bar/navigation_app_bar.dart';
import 'package:ion/app/router/utils/show_simple_bottom_sheet.dart';
import 'package:ion/app/services/media_service/media_service.c.dart';
import 'package:ion/generated/assets.gen.dart';

class StoryPreviewPage extends ConsumerWidget {
const StoryPreviewPage({
Expand Down Expand Up @@ -59,16 +60,26 @@ class StoryPreviewPage extends ConsumerWidget {
},
),
SizedBox(height: 8.0.s),
GestureDetector(
onTap: () async {
await showSimpleBottomSheet<bool>(
context: context,
child: WhoCanReplySettingsModal(
title: context.i18n.story_settings_title,
),
);
},
child: const VerifiedAccountListItem(),
ListItem(
title: Text(
whoCanReply.getTitle(context),
style: context.theme.appTextThemes.caption.copyWith(
color: context.theme.appColors.primaryAccent,
),
),
contentPadding: EdgeInsets.zero,
backgroundColor: context.theme.appColors.secondaryBackground,
leading: whoCanReply.getIcon(context),
trailing: Assets.svg.iconArrowRight.icon(
color: context.theme.appColors.primaryAccent,
),
constraints: BoxConstraints(minHeight: 40.0.s),
onTap: () => showSimpleBottomSheet<void>(
context: context,
child: WhoCanReplySettingsModal(
title: context.i18n.story_settings_title,
),
),
),
],
),
Expand Down
5 changes: 2 additions & 3 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,10 @@
"gallery_all_media_title": "All media",
"gallery_albums_select_title": "Select album",
"camera": "Camera",
"visibility_settings_title_video": "Who can view this video",
"visibility_settings_title_story": "Who can view this story",
"visibility_settings_title_video": "Who can reply to this video",
"visibility_settings_title_story": "Who can reply to this story",
"visibility_settings_everyone": "Everyone",
"visibility_settings_followed_accounts": "Accounts you follow",
"visibility_settings_verified_accounts": "Verified accounts",
"visibility_settings_mentioned_accounts": "Only accounts you mention",
"schedule_modal_nav_title": "Set date and time",
"cancel_creation_post_title": "Cancel post?",
Expand Down

0 comments on commit 918405c

Please sign in to comment.