Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

チャンネルページでisArchivedを明確に表示するように #671

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/l10n/app_ja.arb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
}
}
},
"thisChannelIsArchived": "このチャンネルはアーカイブされています",
"favorited": "お気に入り中",
"willFavorite": "お気に入りに入れるで",
"willFollow": "フォローするで",
Expand Down
11 changes: 10 additions & 1 deletion lib/view/channels_page/channel_detail_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,15 @@ class ChannelDetailArea extends ConsumerWidget {
),
),
),
const Padding(padding: EdgeInsets.only(top: 10)),
const Padding(padding: EdgeInsets.only(top: 5)),
if (channel.isArchived)
Card(
child: Padding(
padding: const EdgeInsets.all(10),
child: Text(S.of(context).thisChannelIsArchived),
),
),
const Padding(padding: EdgeInsets.only(top: 5)),
Wrap(
spacing: 5,
alignment: WrapAlignment.end,
Expand Down Expand Up @@ -217,6 +225,7 @@ class ChannelDetailArea extends ConsumerWidget {
MfmText(mfmText: channel.description ?? ""),
for (final pinnedNote in channel.pinnedNotes ?? [])
MisskeyNote(note: pinnedNote),
const Padding(padding: EdgeInsets.only(bottom: 80)),
],
);
}
Expand Down
27 changes: 15 additions & 12 deletions lib/view/channels_page/channel_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,21 @@ class ChannelDetailFloatingActionButton extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final channelDetail = ref.watch(channelDetailProvider(channelId));
return switch (channelDetail) {
AsyncData(:final value) => FloatingActionButton(
child: const Icon(Icons.edit),
onPressed: () async {
if (!context.mounted) return;
await context.pushRoute(
NoteCreateRoute(
initialAccount: ref.read(accountContextProvider).postAccount,
channel: value.channel,
),
);
},
),
AsyncData(:final value) => (value.channel.isArchived)
? const SizedBox.shrink()
: FloatingActionButton(
child: const Icon(Icons.edit),
onPressed: () async {
if (!context.mounted) return;
await context.pushRoute(
NoteCreateRoute(
initialAccount:
ref.read(accountContextProvider).postAccount,
channel: value.channel,
),
);
},
),
_ => const SizedBox.shrink(),
};
}
Expand Down