generated from lucien/actix-react-template
nouveau fichier : front/src/components/ClickableLink.tsx
nouveau fichier : front/src/components/LogoButton.tsx nouveau fichier : front/src/components/NavBar.tsx modifié : front/src/main.tsx modifié : front/src/pages/MainPage.tsx
This commit is contained in:
parent
ebf4620640
commit
265157bbe1
5 changed files with 28 additions and 5 deletions
5
front/src/components/ClickableLink.tsx
Normal file
5
front/src/components/ClickableLink.tsx
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
export default function ClickableLink(){
|
||||||
|
<div>
|
||||||
|
prout
|
||||||
|
</div>
|
||||||
|
}
|
11
front/src/components/LogoButton.tsx
Normal file
11
front/src/components/LogoButton.tsx
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
function Logo({logo}){
|
||||||
|
return (
|
||||||
|
<img src={logo} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function LogoButton ({url, logo}) {
|
||||||
|
return (
|
||||||
|
<a href={url}><Logo logo={logo}/></a>
|
||||||
|
)
|
||||||
|
}
|
7
front/src/components/NavBar.tsx
Normal file
7
front/src/components/NavBar.tsx
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import LogoButton from '../components/LogoButton.tsx'
|
||||||
|
|
||||||
|
export default function NavBar(){
|
||||||
|
return (<div>
|
||||||
|
<LogoButton url="https://archlinux.org" logo ="https://archlinux.org/static/hetzner_logo.41114a37d25f.png" />
|
||||||
|
</div>);
|
||||||
|
}
|
|
@ -1,10 +1,11 @@
|
||||||
import { StrictMode } from 'react'
|
import { StrictMode } from 'react'
|
||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client'
|
||||||
import './index.css'
|
import './index.css'
|
||||||
import App from './App.tsx'
|
// import App from './App.tsx'
|
||||||
|
import MainPage from './pages/MainPage'
|
||||||
|
|
||||||
createRoot(document.getElementById('root')!).render(
|
createRoot(document.getElementById('root')!).render(
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
<App />
|
<MainPage />
|
||||||
</StrictMode>,
|
</StrictMode>,
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
|
import NavBar from '../components/NavBar.tsx'
|
||||||
|
|
||||||
|
|
||||||
export default function MainPage() {
|
export default function MainPage() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1>Main Page</h1>
|
<NavBar />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue