2021-12-29 05:28:02 +00:00
|
|
|
import React, { useContext } from "react"
|
2021-12-29 02:13:49 +00:00
|
|
|
import ReactDOM from "react-dom"
|
2021-12-29 05:28:02 +00:00
|
|
|
import { Link, Route, Routes, useParams } from "react-router-dom"
|
2021-12-29 02:13:49 +00:00
|
|
|
|
2021-12-29 05:28:02 +00:00
|
|
|
import { AppContext } from "../appContext"
|
|
|
|
import PlayerCharacter from "./PlayerCharacter"
|
2021-12-29 02:13:49 +00:00
|
|
|
|
|
|
|
const PlayerListView = () => {
|
2021-12-29 05:28:02 +00:00
|
|
|
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>
|
2021-12-29 05:28:02 +00:00
|
|
|
{character ? <PlayerCharacter {...character} /> : null }
|
2021-12-29 02:13:49 +00:00
|
|
|
</div>);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PlayerListView
|