mirror of
https://github.com/bubblecup-12/VogelSocialMedia.git
synced 2025-07-09 10:48:48 +00:00
Very basic feed of basic layout posts
This commit is contained in:
parent
d4d10596b2
commit
5657173b6f
5 changed files with 32 additions and 46 deletions
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue