diff --git a/src/App.tsx b/src/App.tsx index 6e8521e..8e6998a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,9 +2,9 @@ import "./App.css"; import { BrowserRouter, Route, Routes } from "react-router-dom"; import Navigation from "./component/Navigation/Navigation"; import Dashboard from "./pages/Dashboard"; -import Practicals from "./pages/Practicals"; +import Immersions from "./pages/Immersions"; import Instances from "./pages/Instances"; -import Practical from "./pages/Practical"; +import Immersion from "./pages/Immersion"; import LoginPage from "./pages/Login"; import PageTest from "./pages/PageTest"; import CreateTp from "./pages/admin/CreateTp"; @@ -21,8 +21,8 @@ function App() { } /> - } /> - } /> + } /> + } /> } /> } /> } /> diff --git a/src/component/Navigation/Navigation.tsx b/src/component/Navigation/Navigation.tsx index 6487e90..d7f4b01 100644 --- a/src/component/Navigation/Navigation.tsx +++ b/src/component/Navigation/Navigation.tsx @@ -183,8 +183,8 @@ const Navigation: React.FC = ({
  • - - TPs + + Immersions
  • diff --git a/src/pages/Practical.tsx b/src/pages/Immersion.tsx similarity index 85% rename from src/pages/Practical.tsx rename to src/pages/Immersion.tsx index aad2fc1..5e71f50 100644 --- a/src/pages/Practical.tsx +++ b/src/pages/Immersion.tsx @@ -3,11 +3,11 @@ import axios from "axios"; import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import { toast } from "react-toastify"; -import { Tp } from "../type/TpType"; +import { Ji } from "../type/JiType"; -function Practical() { +function Immersion() { const { id } = useParams(); - const [tp, setTp] = useState(); + const [ji, setJi] = useState(); const copyText = (copy: string) => { navigator.clipboard.writeText(copy); @@ -18,24 +18,24 @@ function Practical() { }; useEffect(() => { - axios.get(`/api/tps/${id}`).then((res) => { - setTp(res.data); + axios.get(`/api/ji/${id}`).then((res) => { + setJi(res.data); }); }, [id]); return ( <> - {tp && ( + {ji && ( <> -

    {tp.name}

    +

    {ji.name}

    @@ -46,7 +46,7 @@ function Practical() { Information
      -
    • {tp.description}
    • +
    • {ji.description}
    • Duration: 2 hours @@ -74,9 +74,9 @@ function Practical() { SSH:
      copyText(tp.ssh)} + onClick={() => copyText(ji.ssh)} > - {tp.ssh} + {ji.ssh}
      @@ -86,9 +86,9 @@ function Practical() { Port:
      copyText(tp.port)} + onClick={() => copyText(ji.port)} > - {tp.port} + {ji.port}
      @@ -98,9 +98,9 @@ function Practical() { Password:
      copyText(tp.pwd)} + onClick={() => copyText(ji.pwd)} > - {tp.pwd} + {ji.pwd}
      @@ -109,7 +109,7 @@ function Practical() {
    @@ -132,4 +132,4 @@ function Practical() { ); } -export default Practical; +export default Immersion; diff --git a/src/pages/Practicals.tsx b/src/pages/Immersions.tsx similarity index 52% rename from src/pages/Practicals.tsx rename to src/pages/Immersions.tsx index 70a18e6..9de9644 100644 --- a/src/pages/Practicals.tsx +++ b/src/pages/Immersions.tsx @@ -1,32 +1,32 @@ import { useEffect, useState } from "react"; import axios from "axios"; import { Link } from "react-router-dom"; -import { Tp } from "../type/TpType"; +import { Ji } from "../type/JiType"; -function Practicals() { - const [tps, setTps] = useState([]); +function Immersions() { + const [jis, setJis] = useState([]); useEffect(() => { - axios.get("/api/tps").then((res) => { - setTps(res.data); + axios.get("/api/ji/listall").then((res) => { + setJis(res.data); }); }, []); return (
    -

    Your TPs

    +

    Journees d immersion - Activities

    - {tps.map((practical: Tp) => ( + {jis.map((ji: Ji) => (
    -

    {practical.name}

    -

    {practical.description}

    +

    {ji.name}

    +

    {ji.description}

    - - Learn More + + Open activity
    @@ -37,4 +37,4 @@ function Practicals() { ); } -export default Practicals; +export default Immersions;