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:
@@ -17,6 +17,7 @@ import { StatusBadge } from "./StatusBadge";
|
||||
interface PostCardProps {
|
||||
post: PostizPost;
|
||||
onDelete: (id: string) => Promise<void>;
|
||||
onLongPress: (post: PostizPost) => void;
|
||||
}
|
||||
|
||||
function formatDate(dateStr: string): string {
|
||||
@@ -43,7 +44,7 @@ function getNetworkIcon(type?: string): React.ComponentProps<typeof Feather>["na
|
||||
return "globe";
|
||||
}
|
||||
|
||||
export function PostCard({ post, onDelete }: PostCardProps) {
|
||||
export function PostCard({ post, onDelete, onLongPress }: PostCardProps) {
|
||||
const colors = useColors();
|
||||
const swipeRef = useRef<Swipeable>(null);
|
||||
|
||||
@@ -100,7 +101,10 @@ export function PostCard({ post, onDelete }: PostCardProps) {
|
||||
rightThreshold={40}
|
||||
friction={2}
|
||||
>
|
||||
<View
|
||||
<TouchableOpacity
|
||||
activeOpacity={0.85}
|
||||
onLongPress={() => onLongPress(post)}
|
||||
delayLongPress={400}
|
||||
style={[
|
||||
styles.card,
|
||||
{ backgroundColor: colors.card, borderBottomColor: colors.border },
|
||||
@@ -140,7 +144,7 @@ export function PostCard({ post, onDelete }: PostCardProps) {
|
||||
{formatDate(post.publishDate)}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</Swipeable>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user