create skill tsx and update skill groups to use it. make things scrollable.

This commit is contained in:
iamBadgers committed 2026-10-23 22:32:29 -07:00
1 parent 824ee6e1e8
commit 18298c35d4
13 files changed
+164 -437

No files matched your search

+53 -39
View File
@@ -1,5 +1,5 @@
import { useState, useEffect } from 'react'
import { SkillHeader, SkillRow } from './skill'
const baseUrl = typeof window !== 'undefined'
? window.location.origin
: process.env.VITE_VERCEL_URL || 'http://localhost:5173' // Fallback for your server env
@@ -11,6 +11,55 @@ const sk = await
fetch(`${baseUrl}/characters/collateral/skills.json`)
.then(r => r.json());
function RangedTopSkills({ stats, skills }) {
return (
<>
<SkillRow skillName="ARCHERY" skillRank={skills.archery} stat={stats.ref} />
<SkillRow skillName="AUTOFIRE" skillRank={skills.autofire} stat={stats.ref} />
<SkillRow skillName="HANDGUNS" skillRank={skills.handgun} stat={stats.ref} />
</>)
}
function RangedBottomSkills({ stats, skills }) {
return (
<>
<SkillRow skillName="HEAVY WEP" skillRank={skills.archery} stat={stats.ref} />
<SkillRow skillName="SHOULDER ARMS" skillRank={skills.autofire} stat={stats.ref} />
</>)
}
export function RangedTop() {
const [stats] = useState(st)
const [skills] = useState(sk)
return (
<main>
<table className="cyber-table">
<SkillHeader skillGroup="RANGED SKILLS" />
<tbody>
<RangedTopSkills stats={stats} skills={skills} />
</tbody>
</table>
</main>
)
}
export function RangedBottom() {
const [stats] = useState(st)
const [skills] = useState(sk)
return (
<main>
<table className="cyber-table">
<SkillHeader skillGroup="RANGED SKILLS" />
<tbody>
<RangedBottomSkills stats={stats} skills={skills} />
</tbody>
</table>
</main>
)
}
export function Ranged() {
const [stats, setStats] = useState(st)
@@ -19,45 +68,10 @@ export function Ranged() {
return (
<main>
<table className="cyber-table">
<thead>
<tr>
<th style={{ width: "70%" }}>RANGE SKILLS</th>
<th style={{ width: "10%" }}>RANKS</th>
<th style={{ width: "10%" }}>STAT</th>
<th style={{ width: "10%" }}>BASE</th>
</tr>
</thead>
<SkillHeader skillGroup="RANGED SKILLS" />
<tbody>
<tr>
<td>ARCHERY</td>
<td>{skills.archery}</td>
<td>{stats.ref}</td>
<td>{stats.ref + skills.archery}</td>
</tr>
<tr>
<td>AUTOFIRE</td>
<td>{skills.autofire}</td>
<td>{stats.ref}</td>
<td>{stats.ref + skills.autofire}</td>
</tr>
<tr>
<td>HANDGUN</td>
<td>{skills.handgun}</td>
<td>{stats.ref}</td>
<td>{stats.ref + skills.handgun}</td>
</tr>
<tr>
<td>HEAVY WEAPONS</td>
<td>{skills.heavyweapons}</td>
<td>{stats.dex}</td>
<td>{stats.dex + skills.meleeweapons}</td>
</tr>
<tr>
<td>SHOULDER ARMS</td>
<td>{skills.heavyweapons}</td>
<td>{stats.ref}</td>
<td>{stats.ref + skills.meleeweapons}</td>
</tr>
<RangedTopSkills stats={stats} skills={skills} />
<RangedBottomSkills stats={stats} skills={skills} />
</tbody>
</table>
</main>