diff --git a/src/App.tsx b/src/App.tsx index 8230f8d..0872740 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,6 +3,7 @@ import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; import CheckENVRoute from "./CheckENVRoute"; import Home from "./components/home/Home"; import Login from "./components/Login"; +import NotFound from "./components/NotFound"; import RepositoryInfo from "./components/repositoryInfo/RepositoryInfo"; import ProtectedRoute from "./ProtectedRoute"; @@ -15,6 +16,7 @@ const App: React.FC = () => { }> } /> } /> + } /> diff --git a/src/components/ErrorENV.tsx b/src/components/ErrorENV.tsx index a4250d6..7a477d3 100644 --- a/src/components/ErrorENV.tsx +++ b/src/components/ErrorENV.tsx @@ -1,9 +1,9 @@ import React from "react"; -const Home: React.FC = () => { +const ErrorENV: React.FC = () => { return(

Environment variable REGISTRY_URL not set!

); }; -export default Home; \ No newline at end of file +export default ErrorENV; \ No newline at end of file diff --git a/src/components/NotFound.tsx b/src/components/NotFound.tsx new file mode 100644 index 0000000..3985297 --- /dev/null +++ b/src/components/NotFound.tsx @@ -0,0 +1,9 @@ +import React from "react"; + +const NotFound: React.FC = () => { + return( +

404 Not Found!

+ ); +}; + +export default NotFound; \ No newline at end of file diff --git a/src/components/home/RepositoryEntry.tsx b/src/components/home/RepositoryEntry.tsx index 44f717f..9193c16 100644 --- a/src/components/home/RepositoryEntry.tsx +++ b/src/components/home/RepositoryEntry.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { Link } from "react-router-dom"; import { ListItemButton, Grid, ListItemText } from "@mui/material"; import Tag from "../../interfaces/Tag"; import Repository from "../../interfaces/Repositoriy"; @@ -12,7 +13,8 @@ const RepositoryItem: React.FC = (props: Props) => { return ( {/* */} diff --git a/src/components/navbar/NavBar.tsx b/src/components/navbar/NavBar.tsx index 0edf113..9f4b6ab 100644 --- a/src/components/navbar/NavBar.tsx +++ b/src/components/navbar/NavBar.tsx @@ -1,5 +1,6 @@ import React from "react"; import { useEffect } from "react"; +import { NavLink } from "react-router-dom"; import { AppBar, Container, Toolbar, Typography, Box, IconButton, Menu, MenuItem , Tooltip, Avatar, Snackbar, Alert} from "@mui/material"; import axios from "../../api/axios"; import useAuth from "../../hooks/useAuth"; @@ -152,10 +153,12 @@ const NavBar: React.FC = () => { Docker Registry diff --git a/src/components/repositoryInfo/RepositoryInfo.tsx b/src/components/repositoryInfo/RepositoryInfo.tsx index a31cdd8..9dfcca5 100644 --- a/src/components/repositoryInfo/RepositoryInfo.tsx +++ b/src/components/repositoryInfo/RepositoryInfo.tsx @@ -1,15 +1,22 @@ import React from "react"; import { useLocation } from "react-router-dom"; import { ListItemButton, Box, Typography, Grid, ListItemText } from "@mui/material"; +import useRepositories from "../../hooks/useRepositories"; import Tag from "../../interfaces/Tag"; import Repository from "../../interfaces/Repositoriy"; +import NotFound from "../NotFound"; const RepositoryInfo: React.FC = () => { - const location = useLocation() + const location = useLocation(); + const path = location.pathname; + const { repositories } = useRepositories(); + const repository = repositories.find((element) => (element.name === path.slice(12,path.length))); - return ( -

{location.pathname.slice(12,location.pathname.length)}

- ); + return (repository ? ( +

{repository?.tags.map((tag) => (tag.label)).join(" ")}

+ ) : ( + + )); } export default RepositoryInfo; \ No newline at end of file diff --git a/src/style/layouts/_header.sass b/src/style/layouts/_header.sass index 1dcd5e2..176bec5 100644 --- a/src/style/layouts/_header.sass +++ b/src/style/layouts/_header.sass @@ -1,5 +1,7 @@ .navbar margin: 0 + .homeLink + color: white .centerText text-align: center width: 90% \ No newline at end of file diff --git a/src/style/style.css b/src/style/style.css index be2d42e..2e4792f 100644 --- a/src/style/style.css +++ b/src/style/style.css @@ -10,6 +10,10 @@ a { margin: 0; } +.navbar .homeLink { + color: white; +} + .navbar .centerText { text-align: center; width: 90%; diff --git a/src/style/style.css.map b/src/style/style.css.map index 8d4b21a..13adb72 100644 --- a/src/style/style.css.map +++ b/src/style/style.css.map @@ -1,6 +1,6 @@ { "version": 3, - "mappings": "AG8CA,AAAA,WAAW,CAAC;EACR,KAAK,EAAE,IAAI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