REFACTOR(repo): simplify project structure
- Move services/nextjs/ to nextjs/ - Move Dockerfile.prod to Dockerfile at root - Remove deploy/ folder (K8s manifests moved to K3S-HOME/web-apps) - Remove .gitea/ workflows - Update GitHub Actions for new structure - Remove develop branch triggers
This commit is contained in:
5
nextjs/app/(movies)/movies/[id]/error.tsx
Normal file
5
nextjs/app/(movies)/movies/[id]/error.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
"use client"
|
||||
|
||||
export default function Error(){
|
||||
return <h1>Something broke...</h1>
|
||||
}
|
||||
3
nextjs/app/(movies)/movies/[id]/loading.tsx
Normal file
3
nextjs/app/(movies)/movies/[id]/loading.tsx
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function Loading() {
|
||||
return <h2>Loading a movie :id</h2>;
|
||||
}
|
||||
26
nextjs/app/(movies)/movies/[id]/page.tsx
Normal file
26
nextjs/app/(movies)/movies/[id]/page.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { Suspense } from "react";
|
||||
import MovieInfo from "@/components/movie-info";
|
||||
import VideosInfo from "@/components/movie-videos";
|
||||
import { getMovie } from "@/components/movie-info";
|
||||
|
||||
interface Iparams {
|
||||
params: { id: string };
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params: { id } }: Iparams) {
|
||||
const movie = await getMovie(id);
|
||||
return { title: movie.title };
|
||||
}
|
||||
|
||||
export default async function MovieDetail({ params: { id } }: Iparams) {
|
||||
return (
|
||||
<div>
|
||||
<Suspense fallback={<h1>Loading movie info</h1>}>
|
||||
<MovieInfo id={id} />
|
||||
</Suspense>
|
||||
<Suspense fallback={<h1>Loading videos info</h1>}>
|
||||
<VideosInfo id={id} />
|
||||
</Suspense>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
3
nextjs/app/about-us/page.tsx
Normal file
3
nextjs/app/about-us/page.tsx
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function AboutUs(){
|
||||
return <div>Practice app for K8s/argoCD/Grafana</div>
|
||||
}
|
||||
BIN
nextjs/app/favicon.ico
Normal file
BIN
nextjs/app/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
18
nextjs/app/layout.tsx
Normal file
18
nextjs/app/layout.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import "../styles/global.css";
|
||||
import React from "react";
|
||||
import Navigation from "@/components/navigation";
|
||||
|
||||
export const metadata = {
|
||||
title: "movieClone",
|
||||
};
|
||||
|
||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>
|
||||
<Navigation></Navigation>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
30
nextjs/app/page.tsx
Normal file
30
nextjs/app/page.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import styles from "../styles/home.module.css";
|
||||
import Movie from "@/components/movie";
|
||||
|
||||
const URL = "https://nomad-movies.nomadcoders.workers.dev/movies";
|
||||
|
||||
export const metadata = {
|
||||
title: "Jovies",
|
||||
};
|
||||
|
||||
async function getMovies() {
|
||||
const response = await fetch(URL);
|
||||
const json = await response.json();
|
||||
return json;
|
||||
}
|
||||
|
||||
export default async function HomePage() {
|
||||
const movies = await getMovies();
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
{movies.map((movie: any) => (
|
||||
<Movie
|
||||
key={movie.id}
|
||||
id={movie.id}
|
||||
poster_path={movie.poster_path}
|
||||
title={movie.title}
|
||||
></Movie>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user