Skip to content

Commit

Permalink
add types to Portfolio.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
HalynaRiabokonenko committed Feb 11, 2024
1 parent 6c0f881 commit 4437e66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 57 deletions.
53 changes: 0 additions & 53 deletions my-app/src/Components/Portfolio/Portfolio.jsx

This file was deleted.

6 changes: 3 additions & 3 deletions my-app/src/Components/Portfolio/Portfolio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import styles from "./Portfolio.module.css";
import { useContext, useEffect, useState } from "react";
import { Link } from "react-router-dom";
import { ThemeContext } from "../../providers/theme.tsx";
import { PortfolioInterface } from "./Portfolio.types";
import { PortfolioDataInterface } from "./Portfolio.types";


export const Portfolio = () => {
const [setImageId] = useState(null);
const [_, setImageId] = useState<number | null>(null);
const { theme } = useContext(ThemeContext);

const [portfolioData, setPortfolioData] = useState<PortfolioInterface | null>(null);
const [portfolioData, setPortfolioData] = useState<PortfolioDataInterface | null>(null);

useEffect(() => {
fetch("/photos.json")
Expand Down
6 changes: 5 additions & 1 deletion my-app/src/Components/Portfolio/Portfolio.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ export interface PortfolioInterface {
price: number;
url: string;
width: number;
}
}

export interface PortfolioDataInterface {
photos: Array<PortfolioInterface>;
}

0 comments on commit 4437e66

Please sign in to comment.