Ajout du pseudo
This commit is contained in:
parent
c861510956
commit
e0316b9979
4 changed files with 20 additions and 6 deletions
|
|
@ -7,13 +7,17 @@ interface AboutProps {
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
scrollPosition: number;
|
scrollPosition: number;
|
||||||
|
userSpecs: {
|
||||||
|
userName?: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const age = new Date().getFullYear() - 2004 - (new Date().getMonth() > 10 ? 0 : 1);
|
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 =
|
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}` +
|
` I'm passionate about technology and I love to learn new things.${newLine}` +
|
||||||
` ${newLine}` +
|
` ${newLine}` +
|
||||||
` Welcome to my ssh portfolio! Here you can navigate through my projects and contact me.${newLine}` +
|
` Welcome to my ssh portfolio! Here you can navigate through my projects and contact me.${newLine}` +
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,15 @@ interface TabRouterProps {
|
||||||
height: number;
|
height: number;
|
||||||
selectedTab: "About" | "Projects" | "Contact";
|
selectedTab: "About" | "Projects" | "Contact";
|
||||||
scrollPosition: number;
|
scrollPosition: number;
|
||||||
|
userSpecs: {
|
||||||
|
userName?: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const TabRouter = async ({ width, height, selectedTab, scrollPosition }: TabRouterProps) => {
|
const TabRouter = async ({ width, height, selectedTab, scrollPosition, userSpecs }: TabRouterProps) => {
|
||||||
switch (selectedTab) {
|
switch (selectedTab) {
|
||||||
case "About":
|
case "About":
|
||||||
return About({ width, height, scrollPosition });
|
return About({ width, height, scrollPosition, userSpecs });
|
||||||
case "Projects":
|
case "Projects":
|
||||||
return await Projects({ width, height, scrollPosition });
|
return await Projects({ width, height, scrollPosition });
|
||||||
case "Contact":
|
case "Contact":
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@ interface FrontProps {
|
||||||
rows: number;
|
rows: number;
|
||||||
selectedTab: "About" | "Projects" | "Contact";
|
selectedTab: "About" | "Projects" | "Contact";
|
||||||
scrollPosition: number;
|
scrollPosition: number;
|
||||||
|
userSpecs: {
|
||||||
|
userName?: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const minimumWidth = 90;
|
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) {
|
if (columns < minimumWidth || rows < minimumHeight) {
|
||||||
return terminalTooSmall(columns, rows);
|
return terminalTooSmall(columns, rows);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
`${Header({ width: columns, height: 3 })}${newLine}` +
|
`${Header({ width: columns, height: 3 })}${newLine}` +
|
||||||
`${Categories({ width: columns, height: 3, selectedTab })}${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 })}`
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
4
index.ts
4
index.ts
|
|
@ -62,6 +62,9 @@ const server = new Server(
|
||||||
selectedTab: "About" | "Projects" | "Contact";
|
selectedTab: "About" | "Projects" | "Contact";
|
||||||
scrollPosition: number;
|
scrollPosition: number;
|
||||||
stream: ServerChannel | null;
|
stream: ServerChannel | null;
|
||||||
|
userSpecs: {
|
||||||
|
userName?: string;
|
||||||
|
};
|
||||||
contactFormData: {
|
contactFormData: {
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
|
@ -74,6 +77,7 @@ const server = new Server(
|
||||||
selectedTab: "About",
|
selectedTab: "About",
|
||||||
scrollPosition: 0,
|
scrollPosition: 0,
|
||||||
stream: null,
|
stream: null,
|
||||||
|
userSpecs,
|
||||||
contactFormData: {
|
contactFormData: {
|
||||||
name: "",
|
name: "",
|
||||||
email: "",
|
email: "",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue