visions-vtt/kliento/src.backup/views/PlayerListView.tsx

25 lines
708 B
TypeScript
Raw Normal View History

import React, { useContext } from "react"
2021-12-29 02:13:49 +00:00
import ReactDOM from "react-dom"
import { Link, Route, Routes, useParams } from "react-router-dom"
2021-12-29 02:13:49 +00:00
import { AppContext } from "../appContext"
import PlayerCharacter from "./PlayerCharacter"
2021-12-29 02:13:49 +00:00
const PlayerListView = () => {
const params = useParams()
const { state } = useContext(AppContext)
const character = params.name ? state.playerCharacters[params.name] : null
2021-12-29 02:13:49 +00:00
return (<div>
<nav>
<Link to="priat">Priat</Link> |
<Link to="dorian">Dorian </Link> |
<Link to="ember">Ember</Link> |
<Link to="lise">Lise</Link>
</nav>
{character ? <PlayerCharacter {...character} /> : null }
2021-12-29 02:13:49 +00:00
</div>);
}
export default PlayerListView