Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import ResultSheet from '../components/ResultSheet';
import AnswerKeyboardSheet from '../components/AnswerKeyboardSheet';
import BottomActionBar from '../components/BottomActionBar';
import { buildDocumentInit } from '../transforms/contentRendererTransforms';
import { DrawingCanvas, type DrawingCanvasRef } from '../../scrap/utils/skia';
import { DrawingCanvas, type DrawingCanvasRef } from '@repo/pointer-native-drawing';
import { useDrawingState } from '../../scrap/hooks/useDrawingState';
import { ProblemDrawingToolbar } from '../components/ProblemDrawingToolbar';
import { ConfirmationModal } from '../../scrap/components/Dialog';
Expand Down Expand Up @@ -538,7 +538,7 @@ const ProblemScreen = ({ navigation }: ProblemScreenProps) => {
strokeWidth={2}
eraserMode={drawingState.isEraserMode}
eraserSize={12}
onHistoryChange={drawingState.setHistoryState}
onUndoStateChange={drawingState.setHistoryState}
/>
</View>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function useDrawingState() {
dispatch({ type: 'SET_ERASER_SIZE', size });
}, []);

const setHistoryState = useCallback((canUndo: boolean, canRedo: boolean) => {
const setHistoryState = useCallback(({ canUndo, canRedo }: { canUndo: boolean; canRedo: boolean }) => {
dispatch({ type: 'SET_HISTORY_STATE', canUndo, canRedo });
}, []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Alert, AppState, type AppStateStatus } from 'react-native';

import { useGetHandwriting, useUpdateHandwriting } from '@/apis';

import { type DrawingCanvasRef } from '../utils/skia/drawing';
import { type DrawingCanvasRef } from '@repo/pointer-native-drawing';
import { encodeHandwritingData, decodeHandwritingData } from '../utils/handwritingEncoder';

export interface UseHandwritingManagerProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
import { type StudentRootStackParamList } from '@/navigation/student/types';

import { toAlphabetSequence } from '../utils/formatters/toAlphabetSequence';
import DrawingCanvas, { type DrawingCanvasRef } from '../utils/skia/drawing';
import { DrawingCanvas, type DrawingCanvasRef } from '@repo/pointer-native-drawing';
import { ScrapDetailHeader } from '../components/Header/ScrapDetailHeader';
import { TabNavigator } from '../components/scrap/TabNavigator';
import { FilterBar } from '../components/scrap/FilterBar';
Expand Down Expand Up @@ -639,10 +639,9 @@ const ScrapDetailScreen = () => {
ref={canvasRef}
strokeColor='#1E1E21'
strokeWidth={drawingState.strokeWidth}
textMode={drawingState.isTextMode}
eraserMode={drawingState.isEraserMode}
activeTool={drawingState.isTextMode ? 'textbox' : drawingState.isEraserMode ? 'eraser' : 'pen'}
eraserSize={drawingState.eraserSize}
onHistoryChange={drawingState.setHistoryState}
onUndoStateChange={drawingState.setHistoryState}
/>
</View>
</KeyboardAvoidingView>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Stroke, type TextItem } from './skia/drawing';
import { type Stroke, type TextItem } from '@repo/pointer-native-drawing';

export interface HandwritingData {
strokes: Stroke[];
Expand Down
Loading
Loading