feat: add long-press contextual actions on post cards
Long press any post card to open a context menu with state-aware actions: - Copy text (all states) - ERROR: Retry now, Edit & retry, View error message - QUEUE: Edit, Reschedule (native DateTimePicker → PUT /posts/:id) - PUBLISHED: Repost - DRAFT: Edit & schedule Compose screen now accepts prefillContent/prefillIntegrationIds router params to pre-fill content and channel selection when editing or reposting. Adds expo-clipboard for clipboard support. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,8 @@ import * as Haptics from "expo-haptics";
|
||||
import { Image } from "expo-image";
|
||||
import * as ImagePicker from "expo-image-picker";
|
||||
import { fetch as expoFetch } from "expo/fetch";
|
||||
import React, { useState } from "react";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import {
|
||||
ActivityIndicator,
|
||||
Alert,
|
||||
@@ -29,6 +30,10 @@ export default function ComposeScreen() {
|
||||
const insets = useSafeAreaInsets();
|
||||
const { client, isConfigured, apiKey, baseUrl } = usePostiz();
|
||||
const queryClient = useQueryClient();
|
||||
const { prefillContent, prefillIntegrationIds } = useLocalSearchParams<{
|
||||
prefillContent?: string;
|
||||
prefillIntegrationIds?: string;
|
||||
}>();
|
||||
const [content, setContent] = useState("");
|
||||
const [selectedChannels, setSelectedChannels] = useState<string[]>([]);
|
||||
const [postNow, setPostNow] = useState(false);
|
||||
@@ -41,6 +46,13 @@ export default function ComposeScreen() {
|
||||
const [uploading, setUploading] = useState(false);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (prefillContent) setContent(String(prefillContent));
|
||||
if (prefillIntegrationIds) {
|
||||
setSelectedChannels(String(prefillIntegrationIds).split(",").filter(Boolean));
|
||||
}
|
||||
}, [prefillContent, prefillIntegrationIds]);
|
||||
|
||||
const { data: integrations, isLoading: loadingIntegrations } =
|
||||
useQuery<PostizIntegration[]>({
|
||||
queryKey: ["integrations", !!client],
|
||||
|
||||
Reference in New Issue
Block a user