diff --git a/front/Tabs/About.ts b/front/Tabs/About.ts index cf1db53..7645b13 100644 --- a/front/Tabs/About.ts +++ b/front/Tabs/About.ts @@ -7,13 +7,17 @@ interface AboutProps { width: number; height: number; scrollPosition: number; + userSpecs: { + userName?: string; + }; } const age = new Date().getFullYear() - 2004 - (new Date().getMonth() > 10 ? 0 : 1); -const About = ({ width, height, scrollPosition }: AboutProps) => { +const About = ({ width, height, scrollPosition, userSpecs }: AboutProps) => { const content = - ` Hi there! My name is Jokin Suares, and I'm a software engineer.${newLine}` + + ` Hi there, ${userSpecs.userName}!${newLine}` + + ` My name is Jokin Suares, and I'm a software engineer.${newLine}` + ` I'm passionate about technology and I love to learn new things.${newLine}` + ` ${newLine}` + ` Welcome to my ssh portfolio! Here you can navigate through my projects and contact me.${newLine}` + diff --git a/front/Tabs/TabRouter.ts b/front/Tabs/TabRouter.ts index 8c3d2cf..d47b354 100644 --- a/front/Tabs/TabRouter.ts +++ b/front/Tabs/TabRouter.ts @@ -7,12 +7,15 @@ interface TabRouterProps { height: number; selectedTab: "About" | "Projects" | "Contact"; scrollPosition: number; + userSpecs: { + userName?: string; + }; } -const TabRouter = async ({ width, height, selectedTab, scrollPosition }: TabRouterProps) => { +const TabRouter = async ({ width, height, selectedTab, scrollPosition, userSpecs }: TabRouterProps) => { switch (selectedTab) { case "About": - return About({ width, height, scrollPosition }); + return About({ width, height, scrollPosition, userSpecs }); case "Projects": return await Projects({ width, height, scrollPosition }); case "Contact": diff --git a/front/index.ts b/front/index.ts index f376c5d..d4cea36 100644 --- a/front/index.ts +++ b/front/index.ts @@ -7,6 +7,9 @@ interface FrontProps { rows: number; selectedTab: "About" | "Projects" | "Contact"; scrollPosition: number; + userSpecs: { + userName?: string; + }; } const minimumWidth = 90; @@ -22,14 +25,14 @@ const terminalTooSmall = (width: number, height: number) => { ); }; -const Front = async ({ columns, rows, selectedTab, scrollPosition }: FrontProps) => { +const Front = async ({ columns, rows, selectedTab, scrollPosition, userSpecs }: FrontProps) => { if (columns < minimumWidth || rows < minimumHeight) { return terminalTooSmall(columns, rows); } return ( `${Header({ width: columns, height: 3 })}${newLine}` + `${Categories({ width: columns, height: 3, selectedTab })}${newLine}` + - `${await TabRouter({ width: columns, height: rows - 6, selectedTab, scrollPosition })}` + `${await TabRouter({ width: columns, height: rows - 6, selectedTab, scrollPosition, userSpecs })}` ); }; diff --git a/index.ts b/index.ts index d59673c..8d00e71 100644 --- a/index.ts +++ b/index.ts @@ -62,6 +62,9 @@ const server = new Server( selectedTab: "About" | "Projects" | "Contact"; scrollPosition: number; stream: ServerChannel | null; + userSpecs: { + userName?: string; + }; contactFormData: { name: string; email: string; @@ -74,6 +77,7 @@ const server = new Server( selectedTab: "About", scrollPosition: 0, stream: null, + userSpecs, contactFormData: { name: "", email: "",