feat: issue subscriptions and Actions workflow dispatch
- subscribe/unsubscribe to an issue from the detail screen - dispatch a workflow_dispatch run (workflow + ref) from Actions settings - i18n (en/nl)
This commit is contained in:
1 parent
eed9c91274
commit
207ac723af
8 files changed
+178
-2
No files matched your search
@@ -26,7 +26,9 @@ import {
|
||||
useIssueAttachments,
|
||||
useIssueComments,
|
||||
useIssueReactions,
|
||||
useIssueSubscription,
|
||||
useToggleIssueReaction,
|
||||
useToggleIssueSubscription,
|
||||
useUpdateIssue,
|
||||
useUpdateIssueComment,
|
||||
} from '@/features/issues/queries';
|
||||
@@ -66,6 +68,8 @@ export function IssueDetailScreen({ navigation, route }: Props) {
|
||||
const reactionsQuery = useIssueReactions(owner, name, index);
|
||||
const toggleReaction = useToggleIssueReaction(owner, name, index);
|
||||
const attachmentsQuery = useIssueAttachments(owner, name, index);
|
||||
const subscription = useIssueSubscription(owner, name, index, account?.login);
|
||||
const toggleSubscription = useToggleIssueSubscription(owner, name, index, account?.login);
|
||||
|
||||
if (query.isPending) return <LoadingView />;
|
||||
if (query.isError) {
|
||||
@@ -121,6 +125,16 @@ export function IssueDetailScreen({ navigation, route }: Props) {
|
||||
loading={updateIssue.isPending}
|
||||
onPress={toggleState}
|
||||
/>
|
||||
{account?.login ? (
|
||||
<Button
|
||||
label={subscription.data?.subscribed ? t('issues.unsubscribe') : t('issues.subscribe')}
|
||||
variant="secondary"
|
||||
size="md"
|
||||
iconLeft="bell"
|
||||
loading={toggleSubscription.isPending}
|
||||
onPress={() => toggleSubscription.mutate(subscription.data?.subscribed ?? false)}
|
||||
/>
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
<View style={styles.authorRow}>
|
||||
|
||||
Reference in new issue
Block a user