Ajout du pseudo

This commit is contained in:
Feror 2025-03-24 09:50:58 +01:00
parent c861510956
commit e0316b9979
4 changed files with 20 additions and 6 deletions

View file

@ -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}` +

View file

@ -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":

View file

@ -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 })}`
);
};

View file

@ -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: "",