Skip to content

Commit

Permalink
feat(discussion): add reply form to discussion page
Browse files Browse the repository at this point in the history
  • Loading branch information
undrcrxwn committed Feb 1, 2024
1 parent 2ab0602 commit 85f84ba
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/features/reply-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import cls from './index.module.scss';
// @ts-ignore
export interface ReplyFormProps extends FormHTMLAttributes<HTMLFormElement> {
postId: string;
maxLength?: number;
maxLength: number;
onSubmit?: (payload: {postId: string; value: string}) => void;
}

Expand Down
1 change: 0 additions & 1 deletion src/pages/discussion/page.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.head {
display: flex;
flex-direction: column;
margin-bottom: 50px;
}
10 changes: 9 additions & 1 deletion src/pages/discussion/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import {useList, useUnit} from 'effector-react';

import {Post} from '~/widgets/post';

import {ReplyForm} from '~/features/reply-form';

import {Container, ContainerSize, Page, Text, TextSize} from '~/shared/ui';
import {Card, CardSize} from '~/shared/ui/card';

Expand Down Expand Up @@ -50,7 +52,13 @@ export const DiscussionPage = () => {
</Card>
</Container>

<Container size={ContainerSize.M}>{comments}</Container>
<Container size={ContainerSize.M} style={{marginTop: 50, marginBottom: 20}}>
{comments}
</Container>

<Container size={ContainerSize.M}>
<ReplyForm postId={discussion.id!} maxLength={500}></ReplyForm>
</Container>
</Page>
);
};
5 changes: 3 additions & 2 deletions src/shared/ui/text-area/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
width: 100%;
height: auto;
min-height: 80px;
padding: 20px;
padding: 15px;
border-radius: 10px;
background-color: var(--color-gray-dark);
background-color: var(--color-black);
color: var(--color-gray-lightest);
font: var(--font-s);
border: 1px solid rgba(255 255 255 / 7%);
}
4 changes: 4 additions & 0 deletions src/shared/ui/text-area/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export const TextArea = (props: TextAreaProps) => {
<textarea
className={classNames(cls.autoresize, cls.textarea, className)}
onInput={onTextareaInput}
autoComplete={'off'}
autoCorrect={'off'}
autoCapitalize={'off'}
spellCheck={false}
{...otherProps}
/>
);
Expand Down

0 comments on commit 85f84ba

Please sign in to comment.