mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
initial likes implementation
This adds the initial likes implementation. We take an approach of just toggling the like in the database rather than adding a loading mechanic and waiting on the UI.
This commit is contained in:
1 parent
7e690d0e92
commit
bb23413533
6 files changed
+149
-12
No files matched your search
@@ -12,6 +12,7 @@ import MoreIcon from "@material-ui/icons/MoreVert";
|
||||
|
||||
import { ListItem } from "../../../../ui/components/ListItem";
|
||||
import { secondsToHumanReadable } from "../../utils/time";
|
||||
import LikeButton from "../buttons/LikeButton";
|
||||
import ReplyButton from "../buttons/ReplyButton";
|
||||
import ImageDisplay from "../images/ImageDisplay";
|
||||
import Avatar from "../Avatar";
|
||||
@@ -63,11 +64,13 @@ const useStyles = makeStyles(() => ({
|
||||
|
||||
export const Tweet = (tweet) => {
|
||||
const {
|
||||
id,
|
||||
message,
|
||||
images,
|
||||
avatar_url,
|
||||
profile_name,
|
||||
seconds_since_tweet,
|
||||
isLiked,
|
||||
} = tweet;
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
@@ -110,9 +113,7 @@ export const Tweet = (tweet) => {
|
||||
{enableImages && <ImageDisplay visible images={images} small />}
|
||||
<div className={classes.buttonContainer}>
|
||||
<ReplyButton profile_name={profile_name} />
|
||||
<Button>
|
||||
<FavoriteBorderIcon />
|
||||
</Button>
|
||||
<LikeButton tweetId={id} isLiked={isLiked} />
|
||||
<QuoteButton message={message} />
|
||||
<Button>
|
||||
<MoreIcon />
|
||||
|
||||
Reference in new issue
Block a user