cleanup TS type imports, remove programmatic version info

This commit is contained in:
Lucas Jensen
2024-12-01 19:29:03 -08:00
parent 925b334e4c
commit 12f5b4ff0f
5 changed files with 18 additions and 35 deletions

View File

@@ -1,10 +1,10 @@
import axios from "axios";
import { MeganJohns } from "./types/MeganJohns";
import { Artwork } from "./types/Artwork";
import { Quote } from "./types/Quote";
import { Video } from "./types/Video";
import { Album } from "./types/Album";
import { Bio, ProfessionalService } from "./types/Bio";
import type { MeganJohns } from "./types/MeganJohns";
import type { Artwork } from "./types/Artwork";
import type { Quote } from "./types/Quote";
import type { Video } from "./types/Video";
import type { Album } from "./types/Album";
import type { Bio, ProfessionalService } from "./types/Bio";
const baseURL = import.meta.env.VITE_API_URL as string;
@@ -19,7 +19,6 @@ export const getMeganJohns = async (): Promise<MeganJohns> => {
const bio = response.data.bio as Bio;
const professional_services = response.data
.professional_services as ProfessionalService[];
const version = response.data.version as string;
return {
artwork,
videos,
@@ -27,6 +26,5 @@ export const getMeganJohns = async (): Promise<MeganJohns> => {
quotes,
bio,
professional_services,
version,
} as MeganJohns;
};

View File

@@ -1,11 +1,11 @@
import { useEffect, useState } from "react";
import { getMeganJohns } from "./Api";
import { MeganJohns } from "./types/MeganJohns";
import { Album } from "./types/Album";
import { Artwork } from "./types/Artwork";
import { Quote } from "./types/Quote";
import { Video } from "./types/Video";
import { Bio, ProfessionalService } from "./types/Bio";
import type { MeganJohns } from "./types/MeganJohns";
import type { Album } from "./types/Album";
import type { Artwork } from "./types/Artwork";
import type { Quote } from "./types/Quote";
import type { Video } from "./types/Video";
import type { Bio, ProfessionalService } from "./types/Bio";
import MjSection from "./MjSection";
import Header from "./Header/Header";
import About from "./About/Homepage";
@@ -29,7 +29,7 @@ function App() {
},
(error) => {
console.error(error);
},
}
);
}, []);
@@ -56,7 +56,6 @@ function App() {
<MjSection sectionTitle="artwork" works={artwork} />
<Videos videos={videos} />
<About bio={bio} quotes={quotes} services={services} />
<p>{mj.version}</p>
</Container>
</Container>
);

View File

@@ -1,8 +1,8 @@
import { Album } from "./Album";
import { Artwork } from "./Artwork";
import { Bio, ProfessionalService } from "./Bio";
import { Quote } from "./Quote";
import { Video } from "./Video";
import type { Album } from "./Album";
import type { Artwork } from "./Artwork";
import type { Bio, ProfessionalService } from "./Bio";
import type { Quote } from "./Quote";
import type { Video } from "./Video";
export interface MeganJohns {
artwork: Artwork[];
@@ -11,5 +11,4 @@ export interface MeganJohns {
quotes: Quote[];
bio: Bio;
professional_services: ProfessionalService[];
version: string;
}