Skip to content

"Add Popover component and support for adding reactions to comments" #60

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

Conversation

guillermoscript
Copy link
Owner

This pull request includes several commits that add new features and improvements to the codebase. The main changes are:

  • Added a new component, Popover, which allows for the creation of UI elements with interactive content. This component utilizes the @radix-ui/react-popover library for implementation.

  • Added support for adding reactions to comments in the student dashboard. Users can now react to comments with different types of reactions, and the functionality handles updating and deleting reactions based on user selection.

  • Updated the CommentsSections component with improved UI and functionality. The changes include removing unused imports, simplifying the code structure, and adding support for lazy loading of images. These updates enhance the performance and visual appeal of the comments section in the dashboard.

  • Updated the CommentEditor component to support editing existing comments. Students can now edit their comments without having to delete and recreate them.

These changes enhance the user experience by providing versatile and customizable popover functionality, interactive comment reactions, and improved UI and functionality for comments in the student dashboard.

This commit adds a new component, Popover, to the components/ui/popover.tsx file. The Popover component is used to create a UI element with interactive content. It utilizes the @radix-ui/react-popover library for the implementation. This refactor enhances the user experience by providing a versatile and customizable popover functionality for various use cases.
This commit adds the functionality to add reactions to comments in the student dashboard. It introduces a new function, addReactionToComment, which allows users to react to comments with different types of reactions. The function handles updating and deleting reactions based on the user's selection. This enhancement improves the user experience by providing an interactive way for students to engage with comments in the dashboard.
…tionality

This commit updates the CommentsSections component in the components/dashboards/Common/CommentsSections.tsx file. The changes include refactoring the component to improve its UI and functionality. It removes unused imports, simplifies the code structure, and adds support for lazy loading of images. These updates enhance the user experience by improving the performance and visual appeal of the comments section in the dashboard.
…tionality, this allow the user to reply and react to comments in a simple UI
…comments

This commit updates the CommentEditor component in the components/dashboards/student/course/lessons/CommentEditor.tsx file. The changes include adding support for editing existing comments by passing a comment_id prop to the component. When the comment_id prop is provided, the component updates the comment instead of creating a new one. This enhancement improves the user experience by allowing students to edit their comments without having to delete and recreate them.
Copy link

vercel bot commented Jun 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lms-front ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2024 3:21pm

@guillermoscript
Copy link
Owner Author

Comments now:

Screenshot 2024-06-16 at 8 08 01 PM

…ality

This commit updates the CreateCourse component in the components/dashboards/teacher/course/CreateCourse.tsx file. The changes include refactoring the component to improve its UI and functionality. It removes unused imports, simplifies the code structure, and updates the validation schema for the form fields. These updates enhance the user experience by improving the performance, usability, and reliability of the CreateCourse feature.
Repository owner deleted a comment from keylita-dev Jun 17, 2024
Repository owner deleted a comment from keylita-dev Jun 17, 2024
Copy link
Collaborator

@angel-afonso angel-afonso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very nice, please check the comments

@@ -18,7 +18,7 @@ export async function POST (req: Request) {
const supabase = createClient()

const result = await streamText({
model: google('models/gemini-1.5-flash-latest'),
model: google('models/gemini-1.5-pro-latest'),
Copy link
Collaborator

@angel-afonso angel-afonso Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why using the pro model instead of the flash one?

Comment on lines 59 to 68
const reactionTypes: Array<{
type: Tables<'comment_reactions'>['reaction_type']
icon: any
color: string
}> = [
{ type: 'like', icon: ThumbsUp, color: 'text-blue-500' },
{ type: 'funny', icon: Smile, color: 'text-yellow-500' },
{ type: 'boring', icon: Meh, color: '' },
{ type: 'dislike', icon: ThumbsDown, color: 'text-red-500' }
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually is a constant array, move it outside the component

This commit updates the const.ts file in the utils directory. It adds new imports for the Meh, Smile, ThumbsDown, and ThumbsUp icons from the lucide-react library. Additionally, it adds a new array of reaction types with their corresponding icons and colors. These changes enhance the functionality and visual appeal of the code by providing support for comment reactions and improving the user experience.
…add support for comment reactions

This commit updates the CommentsCard component in the components/dashboards/Common/comments/CommentsCard.tsx file. The changes include removing unused imports for the Meh, Smile, ThumbsDown, and ThumbsUp icons from the lucide-react library. Additionally, it adds support for comment reactions by importing the necessary constants from the utils/const.ts file. These updates improve the code by removing unnecessary dependencies and enhancing the functionality of the CommentsCard component.
@guillermoscript guillermoscript merged commit 8c59ecb into master Jun 22, 2024
2 of 3 checks passed
@guillermoscript guillermoscript deleted the 59-enhance-comment-section-with-editing-replying-and-reactions-modernize-ui branch June 22, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance Comment Section with Editing, Replying, and Reactions; Modernize UI
2 participants