Very basic feed of basic layout posts

This commit is contained in:
MisbehavedNinjaRadiator 2025-06-20 16:49:25 +02:00
parent d4d10596b2
commit 5657173b6f
5 changed files with 32 additions and 46 deletions

View file

@ -1,30 +0,0 @@
import React, { useMemo } from "react";
import "./testPost.css";
interface TestPostProps {
postId: number;
}
const getRandomColor = () => {
const letters = "0123456789ABCDEF";
let color = "#";
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
};
const TestPost: React.FC<TestPostProps> = ({ postId }) => {
const bgColor = useMemo(() => getRandomColor(), []);
return (
<div
className="testPostCard"
style={{ backgroundColor: bgColor }}
>
<span className="testPostNumber">{postId}</span>
</div>
);
};
export default TestPost;