Backend (Fastify + TS): FluentForms webhook -> NocoDB row + QR + MailerSend email; PIN auth; scan/lookup/redeem with per-code serialization; reusable QR codes with count-based check-in; admin search. App (Expo, one codebase): Android APK + iPhone PWA. Login, camera scanner (native + web barcode-detector split), green/red overlay with sound + haptics, admin lookup/redeem. Session token persisted per device. Ops: multi-stage Dockerfile serving API + PWA same-origin, compose bound to 127.0.0.1; Forgejo Actions runner + tag-triggered signed APK build for Obtainium. Docs in README.md and INSTALL.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
32 lines
859 B
TypeScript
32 lines
859 B
TypeScript
import { ReactNode } from "react";
|
|
import { StyleSheet, View, Pressable } from "react-native";
|
|
import { theme } from "../lib/theme";
|
|
|
|
export type OverlayStatus = "success" | "error" | "neutral";
|
|
|
|
const BG: Record<OverlayStatus, string> = {
|
|
success: theme.success,
|
|
error: theme.danger,
|
|
neutral: theme.card,
|
|
};
|
|
|
|
export default function ResultOverlay({
|
|
status,
|
|
onDismiss,
|
|
children,
|
|
}: {
|
|
status: OverlayStatus;
|
|
onDismiss?: () => void;
|
|
children: ReactNode;
|
|
}) {
|
|
return (
|
|
<Pressable style={[styles.fill, { backgroundColor: BG[status] }]} onPress={onDismiss}>
|
|
<View style={styles.inner}>{children}</View>
|
|
</Pressable>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
fill: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, zIndex: 10 },
|
|
inner: { flex: 1, alignItems: "center", justifyContent: "center", padding: 24 },
|
|
});
|