Remove guest v2 switch camera action
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { YStack, XStack } from '@tamagui/stacks';
|
||||
import { SizableText as Text } from '@tamagui/text';
|
||||
import { Button } from '@tamagui/button';
|
||||
import { Camera, FlipHorizontal, Image, ListVideo, RefreshCcw, Sparkles, UploadCloud, X } from 'lucide-react';
|
||||
import { Camera, FlipHorizontal, Image, ListVideo, Sparkles, UploadCloud, X } from 'lucide-react';
|
||||
import AppShell from '../components/AppShell';
|
||||
import { useEventData } from '../context/EventDataContext';
|
||||
import { useOptionalGuestIdentity } from '../context/GuestIdentityContext';
|
||||
@@ -281,12 +281,6 @@ export default function UploadScreen() {
|
||||
[facingMode]
|
||||
);
|
||||
|
||||
const handleSwitchCamera = React.useCallback(async () => {
|
||||
const nextMode = facingMode === 'user' ? 'environment' : 'user';
|
||||
stopCamera();
|
||||
await startCamera(nextMode);
|
||||
}, [facingMode, startCamera, stopCamera]);
|
||||
|
||||
const handleCapture = React.useCallback(async () => {
|
||||
const video = videoRef.current;
|
||||
if (!video) return;
|
||||
@@ -580,36 +574,18 @@ export default function UploadScreen() {
|
||||
{t('uploadV2.galleryCta', 'Upload from gallery')}
|
||||
</Text>
|
||||
</Button>
|
||||
<XStack gap="$2">
|
||||
<XStack alignItems="center" gap="$2">
|
||||
<Button
|
||||
size="$3"
|
||||
circular
|
||||
backgroundColor={mutedButton}
|
||||
borderWidth={1}
|
||||
borderColor={mutedButtonBorder}
|
||||
onPress={handleSwitchCamera}
|
||||
disabled={cameraState === 'unsupported' || cameraState === 'blocked'}
|
||||
>
|
||||
<RefreshCcw size={16} color={iconColor} />
|
||||
</Button>
|
||||
<Text fontSize="$2" color="$color" opacity={0.7}>
|
||||
{t('upload.controls.switchCamera', 'Switch camera')}
|
||||
</Text>
|
||||
</XStack>
|
||||
{facingMode === 'user' ? (
|
||||
<Button
|
||||
size="$3"
|
||||
circular
|
||||
backgroundColor={mirror ? '$primary' : mutedButton}
|
||||
borderWidth={1}
|
||||
borderColor={mutedButtonBorder}
|
||||
onPress={() => setMirror((prev) => !prev)}
|
||||
>
|
||||
<FlipHorizontal size={16} color={mirror ? '#FFFFFF' : iconColor} />
|
||||
</Button>
|
||||
) : null}
|
||||
</XStack>
|
||||
{facingMode === 'user' ? (
|
||||
<Button
|
||||
size="$3"
|
||||
circular
|
||||
backgroundColor={mirror ? '$primary' : mutedButton}
|
||||
borderWidth={1}
|
||||
borderColor={mutedButtonBorder}
|
||||
onPress={() => setMirror((prev) => !prev)}
|
||||
>
|
||||
<FlipHorizontal size={16} color={mirror ? '#FFFFFF' : iconColor} />
|
||||
</Button>
|
||||
) : null}
|
||||
</>
|
||||
)}
|
||||
</XStack>
|
||||
|
||||
Reference in New Issue
Block a user