From 0875b893210a094c81d0358f0b70e2c0cd388a6e Mon Sep 17 00:00:00 2001 From: ASproson Date: Sun, 4 Aug 2024 18:24:52 +0100 Subject: [PATCH] Initial layout --- index.html | 4 ++-- src/App.tsx | 58 +++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index e4b78ea..08f261a 100644 --- a/index.html +++ b/index.html @@ -1,10 +1,10 @@ - + - Vite + React + TS + Final Fantasy Battle Screen :icon:
diff --git a/src/App.tsx b/src/App.tsx index 2163d11..404a388 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,14 +1,64 @@ +export const characterList = [ + { + name: 'AAAA', + hp: 30, + }, + { + name: 'BBBB', + hp: 25, + }, + { + name: 'CCCC', + hp: 28, + }, + { + name: 'DDDD', + hp: 33, + }, +]; + function App() { + const characters = characterList.map(({ name, hp }, idx) => { + return ; + }); + return ( -
-
+
+
-
enemies
-
characters
+
+
enemy1
+
enemy2
+
enemy3
+
+
+
char1
+
char2
+
char3
+
char4
+
+
+
{characters}
+
); } export default App; + +interface Character { + name: string; + hp: number; +} + +export const CharacterSheet = ({ name, hp }: Character) => { + return ( +
+

{name}

+

hp

+

{hp}

+
+ ); +};