Skip to content
Snippets Groups Projects
Commit 361a350a authored by Matt Kirby's avatar Matt Kirby
Browse files

Added icons to post Icon

parent 47d7f2e2
No related branches found
No related tags found
1 merge request!7Resolve "Adding basic post component"
......@@ -3,6 +3,9 @@ import { FC, PropsWithChildren } from "react";
import styles from '../../styles/Post.module.css'
import PostAction from "./PostAction";
import { generateRandomLinearGradient } from "./Utils";
import { SlBubble, SlShare } from 'react-icons/sl'
import { AiOutlineHeart } from 'react-icons/ai'
import Avatar from "../profile/avatar";
type PostProps = {
User: User,
......@@ -22,18 +25,7 @@ const Post: FC<PropsWithChildren<PostProps>> = ({
return (
<div className={styles.post}>
<div className={styles.header}>
<div className={styles.avatar} style={{backgroundImage: generateRandomLinearGradient(User.Colors, true)}}>
{User.Avatar &&
<div>
</div>
}
{!User.Avatar &&
<div>
<p>{User.Username[0]}</p>
</div>
}
</div>
<Avatar User={User}/>
<div className={styles.headerInfo}>
<div className={styles.headerUserInfo}>
<p className={styles.name} >{User.FirstName} {User.LastName}</p>
......@@ -48,9 +40,9 @@ const Post: FC<PropsWithChildren<PostProps>> = ({
<p className={styles.postContent}>{Post}</p>
<div className={styles.postActions}>
<PostAction />
<PostAction />
<PostAction />
<PostAction label="7" icon={<SlBubble />} onClick={null}/>
<PostAction label="0" icon={<AiOutlineHeart />} />
<PostAction icon={<SlShare />}/>
</div>
</div>
</div>
......
import { FC, PropsWithChildren } from 'react'
import styles from '../../styles/PostAction.module.css'
const PostAction = () => {
type PostActionProps ={
label?: string;
icon: any
onClick: () => any;
}
const PostAction: FC<PropsWithChildren<PostActionProps>> = ({
label,
icon,
onClick
}) => {
return (
<div className={styles.container}>
<button>Action</button>
<button className={styles.button} onClick={onClick}>
{icon}
{label &&
<span className={styles.label}>{label}</span>
}
</button>
</div>
)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment