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

Discussions Update #351

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions koduyorum-web/src/PostPreview.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
font-size: 13px;
color: #555;
margin-bottom: 10px;
overflow: hidden; /* Hide overflowing content */
text-overflow: ellipsis; /* Add '...' at the end */
display: -webkit-box;
-webkit-line-clamp: 3; /* Limit to 3 lines */
-webkit-box-orient: vertical;
}

.post-footer {
Expand All @@ -103,12 +108,6 @@
color: #888;
}

.vote-count {
font-size: 16px; /* Bigger text for the counter */
color: #555;
margin: 0 8px; /* Add some spacing around the number */
}


.vote-group {
display: flex;
Expand Down
12 changes: 8 additions & 4 deletions koduyorum-web/src/PostPreview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {useEffect, useState} from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { useNavigate } from 'react-router-dom';
import {faThumbsUp, faCommentDots, faThumbsDown, faBookmark} from '@fortawesome/free-solid-svg-icons';
import {faThumbsUp, faCommentDots, faThumbsDown, faBookmark, faCheck} from '@fortawesome/free-solid-svg-icons';
import './PostPreview.css';
import { showNotification } from './NotificationCenter';

Expand Down Expand Up @@ -260,16 +260,20 @@ const PostPreview = ({ post, currentUser, onClick }) => {

<div className="post-footer">
<div className="vote-group">
<div
className='footer-item'>
<FontAwesomeIcon icon={faCheck} size="sm" />
<h4 className="footer-text">Votes: {upvote}</h4>
</div>

<div
className={`footer-item ${animateUpvote ? 'upvote-animate' : ''} ${isUpvoted ? 'upvoted' : ''}`}
onClick={handleUpvote}
>
<FontAwesomeIcon icon={faThumbsUp} size="sm" />
<span className="footer-text">Upvote</span>
</div>

<span className="vote-count">{upvotes}</span>


<div
className={`footer-item ${animateDownvote ? 'downvote-animate' : ''} ${isDownvoted ? 'downvoted' : ''}`}
onClick={handleDownvote}
Expand Down