Skip to content

Commit 8c7b7ff

Browse files
committed
Fix TypeScript errors and remove unused props
1 parent d38567b commit 8c7b7ff

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from 'react'
2-
import PixelComparison from './components/PixelComparison'
3-
import ImageGallery from './components/ImageGallery'
42
import FocalLength from './components/FocalLength'
3+
import ImageGallery from './components/ImageGallery'
4+
import PixelComparison from './components/PixelComparison'
55

66
const App = () => {
77
const [selectedPixels, setSelectedPixels] = useState<number[]>([])
@@ -94,7 +94,7 @@ const App = () => {
9494
)}
9595

9696
{activeTab === 'focal' && (
97-
<FocalLength selectedPixels={selectedPixels} />
97+
<FocalLength />
9898
)}
9999

100100
{(activeTab !== 'focal' && selectedPixels.length === 0) && (

src/components/FocalLength.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import React, { useState, useRef, useEffect } from 'react';
1+
import React, { useEffect, useRef, useState } from 'react';
22

33
interface FocalLengthProps {
4-
selectedPixels: number[];
54
}
65

76
// Function to calculate field of view based on focal length
@@ -12,7 +11,7 @@ function focalLengthToFOV(focalLength: number, sensorWidth = 36) {
1211
return degrees;
1312
}
1413

15-
const FocalLength: React.FC<FocalLengthProps> = ({ selectedPixels }) => {
14+
const FocalLength: React.FC<FocalLengthProps> = () => {
1615
const [focalLength, setFocalLength] = useState(50); // Default 50mm focal length
1716
const [imageSize, setImageSize] = useState({ width: 0, height: 0 });
1817
const imageRef = useRef<HTMLImageElement>(null);

src/components/PixelComparison.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ const calculateDimensions = (megapixels: number): { width: number; height: numbe
1919
const dimensions = pixelDimensions[megapixels];
2020

2121
// Use a fixed scale factor for all resolutions to maintain the exact relative sizes
22-
// We'll base it on the largest dimension to ensure everything fits on screen
23-
const largestDimension = pixelDimensions[100].width; // 11648 is the largest width
2422
const scaleFactor = 0.05; // Adjust this to make blocks fit on screen
2523

2624
// Apply the same scale factor to all resolutions to maintain exact relative sizes

0 commit comments

Comments
 (0)