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

+5 -45
View File
@@ -1,10 +1,10 @@
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
const st = await fetch(`${baseUrl}/characters/collateral/stats.json`)
.then(r => r.json());
@@ -12,25 +12,6 @@ const sk = await
fetch(`${baseUrl}/characters/collateral/skills.json`)
.then(r => r.json());
function BaseVal({ skillRank, stat }) {
if (skillRank === "---") {
return <td>---</td>
} else {
return (<td>{skillRank + stat}</td>)
}
}
function SkillRow({ skillName, skillRank, stat }) {
return (
<tr>
<td>{skillName}</td>
<td>{skillRank}</td>
<td>{stat}</td>
<BaseVal skillRank={skillRank} stat={stat} />
</tr>
);
}
function EducationTopSkills({ stats, skills }) {
return (<>
<SkillRow skillName="ACCOUNTING" skillRank={skills.accounting} stat={stats.int} />
@@ -54,7 +35,7 @@ function EducationBottomSkills({ stats, skills }) {
<SkillRow skillName="-- SPANISH" skillRank={skills.lang_spanish} stat={stats.int} />
<SkillRow skillName="LIBRARY SEARCH" skillRank={skills.librarysearch} stat={stats.int} />
<SkillRow skillName="LOCAL EXPERT:" skillRank="---" stat="---" />
<SkillRow skillName="-- OLD COMBAT ZONE" skillRank={skills.localex_ocz} stat={stats.int} />
<SkillRow skillName="-- THE OCZ" skillRank={skills.localex_ocz} stat={stats.int} />
<SkillRow skillName="-- HOT ZONE" skillRank={skills.localex_hotzone} stat={stats.int} />
<SkillRow skillName="--" skillRank="---" stat="---" />
<SkillRow skillName="SCIENCE:" skillRank="---" stat="---" />
@@ -72,14 +53,7 @@ export function EducationTop() {
return (
<main>
<table className="cyber-table">
<thead>
<tr>
<th style={{ width: "70%" }}>EDUCATION SKILLS</th>
<th style={{ width: "10%" }}>RANKS</th>
<th style={{ width: "10%" }}>STAT</th>
<th style={{ width: "10%" }}>BASE</th>
</tr>
</thead>
<SkillHeader skillGroup="EDUCATION SKILLS" />
<tbody>
<EducationTopSkills stats={stats} skills={skills} />
</tbody>
@@ -95,14 +69,7 @@ export function EducationBottom() {
return (
<main>
<table className="cyber-table">
<thead>
<tr>
<th style={{ width: "70%" }}>EDUCATION SKILLS</th>
<th style={{ width: "10%" }}>RANKS</th>
<th style={{ width: "10%" }}>STAT</th>
<th style={{ width: "10%" }}>BASE</th>
</tr>
</thead>
<SkillHeader skillGroup="EDUCATION SKILLS" />
<tbody>
<EducationBottomSkills stats={stats} skills={skills} />
</tbody>
@@ -119,14 +86,7 @@ export function Education() {
return (
<main>
<table className="cyber-table">
<thead>
<tr>
<th style={{ width: "70%" }}>EDUCATION SKILLS</th>
<th style={{ width: "10%" }}>RANKS</th>
<th style={{ width: "10%" }}>STAT</th>
<th style={{ width: "10%" }}>BASE</th>
</tr>
</thead>
<SkillHeader skillGroup="EDUCATION SKILLS" />
<tbody>
<EducationTopSkills stats={stats} skills={skills} />
<EducationBottomSkills stats={stats} skills={skills} />