From 647045d5b181b03b781caba62535b5ac5b02b901 Mon Sep 17 00:00:00 2001 From: Hailey Date: Tue, 13 Feb 2024 23:11:47 -0800 Subject: [PATCH] remove unused web canvas --- .../PlaceholderCanvasDontNeed.web.tsx | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 src/screens/Onboarding/StepProfile/PlaceholderCanvasDontNeed.web.tsx diff --git a/src/screens/Onboarding/StepProfile/PlaceholderCanvasDontNeed.web.tsx b/src/screens/Onboarding/StepProfile/PlaceholderCanvasDontNeed.web.tsx deleted file mode 100644 index 36ed073401..0000000000 --- a/src/screens/Onboarding/StepProfile/PlaceholderCanvasDontNeed.web.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import React from 'react' -import {useAvatar} from '#/screens/Onboarding/StepProfile/index' -import {StyleSheet, View} from 'react-native' - -const CANVAS_HEIGHT = 24 * 20 -const CANVAS_OFFSET = 24 * 3 - -export interface PlaceholderCanvasRef { - capture: () => string -} - -export const PlaceholderCanvas = React.forwardRef(function PlaceholderCanvas( - {}, - ref, -) { - const avatar = useAvatar() - const canvasRef = React.useRef(null) - - const capture = React.useCallback(() => { - return canvasRef.current?.toDataURL('image/jpeg') - }, []) - - React.useImperativeHandle(ref, () => ({ - capture, - })) - - React.useEffect(() => { - // @ts-ignore web only - const path = new Path2D(avatar.placeholder.path) - // @ts-ignore web only - const ctx = canvasRef.current?.getContext('2d') - ctx?.reset() - ctx.fillStyle = avatar.backgroundColor - ctx?.moveTo(0, 0) - ctx?.fillRect(0, 0, CANVAS_HEIGHT, CANVAS_HEIGHT) - ctx.fillStyle = '#fff' - ctx.lineWidth = 0.1 - ctx?.translate(CANVAS_OFFSET, CANVAS_OFFSET) - ctx?.scale(14, 14) - ctx?.fill(path) - }, [avatar.backgroundColor, avatar.placeholder.path]) - - return ( - - - - ) -}) - -const styles = StyleSheet.create({ - container: { - top: -2000, - position: 'absolute', - }, -})