Skip to content

Commit

Permalink
[RSN-84] - Implemented UI for adding a comment (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
wzarek authored Jun 23, 2024
1 parent 40dd22b commit ab4ab0f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Client/reasn-client/apps/web/app/events/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { MOCK_IMG_URL } from "@reasn/ui/src/components/shared/Card";
import { ButtonBase } from "@reasn/ui/src/components/shared/form";
import { Comment } from "@reasn/ui/src/components/shared/Comment";
import { Comment, NewComment } from "@reasn/ui/src/components/shared/Comment";
import { useEffect, useRef, useState } from "react";
import {
ArrowLeft,
Expand Down Expand Up @@ -271,6 +271,7 @@ const EventPage = ({ params }: { params: { slug: string } }) => {
<div className="relative">
<h3 className="font-semibold">Komentarze:</h3>
<div className="flex flex-col gap-2">
<NewComment />
<Comment />
<Comment />
<Comment />
Expand Down
18 changes: 16 additions & 2 deletions Client/reasn-client/packages/ui/src/components/shared/Comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import {
CommentDto,
CommentDtoMapper,
} from "@reasn/common/src/schemas/CommentDto";
import { ButtonBase, FloatingTextarea } from "./form";

interface CommentProps {
comment: CommentDto;
comment?: CommentDto;
}

export const Comment = () => {
export const Comment = (props: CommentProps) => {
const comment = CommentDtoMapper.fromObject({
EventId: 1,
Content:
Expand Down Expand Up @@ -36,3 +37,16 @@ export const Comment = () => {
</div>
);
};

export const NewComment = () => {
return (
<div className="mb-8 flex flex-col gap-4 rounded-md bg-[#4b4e526d] p-2">
<FloatingTextarea
label="Treść komentarza"
name="newComment"
className="mt-8 h-32"
/>
<ButtonBase className="ml-auto" text="Dodaj" />
</div>
);
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import React, { useEffect, useRef, useState } from "react";
import { FloatingInput } from "./Input";
import clsx from "clsx";
Expand Down Expand Up @@ -47,7 +49,7 @@ export const SearchMultiDropdown = (props: MultiDropdownProps) => {
label={label}
className="w-full rounded-b-none"
defaultValue={search}
onChange={setSearch}
onChange={(e) => setSearch(e.target.value)}
/>
<div className="flex h-16 flex-wrap justify-start gap-2 overflow-auto rounded-b-lg bg-[#232327] p-2 text-xs">
{selectedOptions.concat(filteredOptions).map((option) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ export { Card, CardVariant } from "./Card";
export { Navbar } from "./Navbar";
export { Footer } from "./Footer";
export { Interest } from "./Interest";
export { Comment } from "./Comment";
export { Comment, NewComment } from "./Comment";
export { Toast } from "./Toast";

0 comments on commit ab4ab0f

Please sign in to comment.