Skip to content

Commit

Permalink
Adding Name to Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
UniqueClone committed Jan 11, 2024
1 parent aee8bd8 commit 8d72182
Show file tree
Hide file tree
Showing 3 changed files with 453 additions and 398 deletions.
52 changes: 33 additions & 19 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Generator } from "./pdf-generator/Generator";
import { getDefaultGoals } from "./pdf-generator/GeneratorUtils";

function App() {
const [nameInput, setNameInput] = useState<string>("");
const [goals, setGoals] = useState<string[]>(getDefaultGoals());

const updateGoals = (event: any, goalIndex: number) => {
Expand All @@ -20,9 +21,21 @@ function App() {
<h2>What are your goals for this year?</h2>

<div className="goals-form">
<div className="input-container">
<div className="input-label" id="namelabel">
Name:
</div>
<input
aria-labelledby="namelabel"
id="name"
placeholder="Name"
type="text"
onChange={(e) => setNameInput(e.target.value)}
/>
</div>
<div className="input-container">
<div className="input-label" id="goal1label">
Goal 1:{" "}
Goal 1:
</div>
<input
aria-labelledby="goal1label"
Expand All @@ -34,7 +47,7 @@ function App() {
</div>
<div className="input-container">
<div className="input-label" id="goal2label">
Goal 2:{" "}
Goal 2:
</div>
<input
aria-labelledby="goal2label"
Expand All @@ -48,7 +61,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal3label">
Goal 3:{" "}
Goal 3:
</div>
<input
aria-labelledby="goal3label"
Expand All @@ -61,7 +74,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal4label">
Goal 4:{" "}
Goal 4:
</div>
<input
aria-labelledby="goal4label"
Expand All @@ -74,7 +87,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal5label">
Goal 5:{" "}
Goal 5:
</div>
<input
aria-labelledby="goal5label"
Expand All @@ -87,7 +100,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal6label">
Goal 6:{" "}
Goal 6:
</div>
<input
aria-labelledby="goal6label"
Expand All @@ -100,7 +113,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal7label">
Goal 7:{" "}
Goal 7:
</div>
<input
aria-labelledby="goal7label"
Expand All @@ -113,7 +126,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal8label">
Goal 8:{" "}
Goal 8:
</div>
<input
aria-labelledby="goal8label"
Expand All @@ -126,7 +139,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal9label">
Goal 9:{" "}
Goal 9:
</div>
<input
aria-labelledby="goal9label"
Expand All @@ -139,7 +152,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal10label">
Goal 10:{" "}
Goal 10:
</div>
<input
aria-labelledby="goal10label"
Expand All @@ -152,7 +165,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal11label">
Goal 11:{" "}
Goal 11:
</div>
<input
aria-labelledby="goal11label"
Expand All @@ -165,7 +178,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal12label">
Goal 12:{" "}
Goal 12:
</div>
<input
aria-labelledby="goal12label"
Expand All @@ -178,7 +191,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal13label">
Goal 13:{" "}
Goal 13:
</div>
<input
aria-labelledby="goal13label"
Expand All @@ -191,7 +204,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal14label">
Goal 14:{" "}
Goal 14:
</div>
<input
aria-labelledby="goal14label"
Expand All @@ -204,7 +217,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal15label">
Goal 15:{" "}
Goal 15:
</div>
<input
aria-labelledby="goal15label"
Expand All @@ -217,7 +230,7 @@ function App() {

<div className="input-container">
<div className="input-label" id="goal16label">
Goal 16:{" "}
Goal 16:
</div>
<input
aria-labelledby="goal16label"
Expand All @@ -230,19 +243,20 @@ function App() {
<button
title="Generate PDF"
type="submit"
onClick={() => generatePDF(goals)}
onClick={() => generatePDF(nameInput, goals)}
>
Generate PDF
</button>
</div>
<div id="container" />
</body>
</div>
);
}

const generatePDF = (goals: string[]) => {
const generatePDF = (name: string, goals: string[]) => {
console.log("Generating PDF");
Generator(goals);
Generator(name, goals);
};

export default App;
Loading

0 comments on commit 8d72182

Please sign in to comment.