Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HeaderComponent #27

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tschanomis
Copy link
Contributor

@tschanomis tschanomis commented Jan 23, 2025

Move the page header into a new HeaderComponent.

Comment on lines +3 to +6

import Status from "../statusComponent/StatusComponent";

import { StatusProps } from "../statusComponent/type";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import Status from "../statusComponent/StatusComponent";
import { StatusProps } from "../statusComponent/type";
import Status from "../statusComponent/StatusComponent";
import { StatusProps } from "../statusComponent/type";

@@ -2,12 +2,11 @@

import { useState } from "react";
import useWebSocket from "react-use-websocket";

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines -45 to -48
<div className="flex flex-row justify-center">
<div className="pt-10 pb-20 px-10">
<div className="flex flex-row min-w-fit justify-center flex-nowrap text-nowrap">
<div className="basis-1/4 flex flex-col justify-center items-center">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's some magic in there which broke the page center alignment when being removed.

@TheoBrigitte TheoBrigitte changed the title feat HeaderComponent Add HeaderComponent Jan 24, 2025
server: Server;
}

// Define the color and icon the status column
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Define the color and icon the status column
// Define color and icon of the status column


useEffect(() => {
if (!dataEquality) {
console.log("change detected");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log("change detected");


return (
servers.map((server) => (
<tr ref={React.createRef()} key={category + server.planCode} className={`${changedRows.has(server.planCode) ? 'bg-yellow-200' : 'transition duration-1000 delay-150 even:bg-blue-300 odd:bg-blue-100'} font-mono`}>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the odd/even colors.

lastMessage,
}: StatusProps) {
return (
<div className="HeaderComponent flex justify-evenly w-full">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this HeaderComponent class used for ?

const ordered: CategoryOrder = { ...categoryOrder, ...serversByCategory };

return (
<table className="text-nowrap border-separate border-spacing-x-0 border-spacing-y-4">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for vertical spacing, this table is already quite big.

<td>{server.storage}</td>
<td>{server.bandwidth}</td>
<td>{`${server.price} ${server.currencyCode}`}</td>
<td className="flex justify-end py-6">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this py-6 here instead of the tr ? This should also be reduced to reduce vertical space used.

const serversByCategory = Object.groupBy(data, (server: Server) => server.category);

// Merge the server and respect the categories order
const ordered: CategoryOrder = { ...categoryOrder, ...serversByCategory };
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to filter out categories with no servers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants