mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-06 18:16:41 +07:00
added nextjs and fixed problems for it
This commit is contained in:
parent
37e0923bb1
commit
58fa40dd5c
10 changed files with 1083 additions and 103 deletions
src
components
containers/node/NodeBottomBlock
hooks/dom
layouts/BorisLayout
|
@ -1,8 +1,8 @@
|
|||
import React, { FC, useCallback, useEffect } from "react";
|
||||
import { ButtonGroup } from "~/components/input/ButtonGroup";
|
||||
import { Button } from "~/components/input/Button";
|
||||
import { useFormatWrapper, wrapTextInsideInput } from "~/hooks/dom/useFormatWrapper";
|
||||
import styles from "./styles.module.scss";
|
||||
import React, { FC, useCallback, useEffect } from 'react';
|
||||
import { ButtonGroup } from '~/components/input/ButtonGroup';
|
||||
import { Button } from '~/components/input/Button';
|
||||
import { useFormatWrapper, wrapTextInsideInput } from '~/hooks/dom/useFormatWrapper';
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
interface IProps {
|
||||
element: HTMLTextAreaElement;
|
||||
|
@ -10,10 +10,12 @@ interface IProps {
|
|||
}
|
||||
|
||||
const CommentFormFormatButtons: FC<IProps> = ({ element, handler }) => {
|
||||
const wrap = useCallback(
|
||||
(prefix = '', suffix = '') => useFormatWrapper(element, handler, prefix, suffix),
|
||||
[element, handler]
|
||||
);
|
||||
const wrapper = useFormatWrapper(handler);
|
||||
|
||||
const wrap = useCallback((prefix = '', suffix = '') => wrapper(element, prefix, suffix), [
|
||||
element,
|
||||
wrapper,
|
||||
]);
|
||||
|
||||
const wrapBold = useCallback(
|
||||
event => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { DetailsHTMLAttributes, FC } from "react";
|
||||
import StickyBox from "react-sticky-box/dist/esnext";
|
||||
import React, { DetailsHTMLAttributes, FC } from 'react';
|
||||
import StickyBox from 'react-sticky-box';
|
||||
|
||||
interface IProps extends DetailsHTMLAttributes<HTMLDivElement> {
|
||||
offsetTop?: number;
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
import React, { FC } from "react";
|
||||
import { NodeDeletedBadge } from "~/components/node/NodeDeletedBadge";
|
||||
import { Group } from "~/components/containers/Group";
|
||||
import { Padder } from "~/components/containers/Padder";
|
||||
import { NodeCommentForm } from "~/components/node/NodeCommentForm";
|
||||
import { NodeRelatedBlock } from "~/components/node/NodeRelatedBlock";
|
||||
import { useNodeBlocks } from "~/hooks/node/useNodeBlocks";
|
||||
import { NodeTagsBlock } from "~/components/node/NodeTagsBlock";
|
||||
import StickyBox from "react-sticky-box/dist/esnext";
|
||||
import styles from "./styles.module.scss";
|
||||
import { NodeAuthorBlock } from "~/components/node/NodeAuthorBlock";
|
||||
import { useNodeContext } from "~/utils/context/NodeContextProvider";
|
||||
import { useCommentContext } from "~/utils/context/CommentContextProvider";
|
||||
import { NodeNoComments } from "~/components/node/NodeNoComments";
|
||||
import { NodeComments } from "~/containers/node/NodeComments";
|
||||
import { useUserContext } from "~/utils/context/UserContextProvider";
|
||||
import { useNodeRelatedContext } from "~/utils/context/NodeRelatedContextProvider";
|
||||
import React, { FC } from 'react';
|
||||
import { NodeDeletedBadge } from '~/components/node/NodeDeletedBadge';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { Padder } from '~/components/containers/Padder';
|
||||
import { NodeCommentForm } from '~/components/node/NodeCommentForm';
|
||||
import { NodeRelatedBlock } from '~/components/node/NodeRelatedBlock';
|
||||
import { useNodeBlocks } from '~/hooks/node/useNodeBlocks';
|
||||
import { NodeTagsBlock } from '~/components/node/NodeTagsBlock';
|
||||
import StickyBox from 'react-sticky-box';
|
||||
import styles from './styles.module.scss';
|
||||
import { NodeAuthorBlock } from '~/components/node/NodeAuthorBlock';
|
||||
import { useNodeContext } from '~/utils/context/NodeContextProvider';
|
||||
import { useCommentContext } from '~/utils/context/CommentContextProvider';
|
||||
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
||||
import { NodeComments } from '~/containers/node/NodeComments';
|
||||
import { useUserContext } from '~/utils/context/UserContextProvider';
|
||||
import { useNodeRelatedContext } from '~/utils/context/NodeRelatedContextProvider';
|
||||
|
||||
interface IProps {
|
||||
commentsOrder: 'ASC' | 'DESC';
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import { useCallback } from "react";
|
||||
import { useCallback } from 'react';
|
||||
|
||||
/** wraps text inside textarea with tags */
|
||||
export const useFormatWrapper = (
|
||||
target: HTMLTextAreaElement,
|
||||
onChange: (val: string) => void,
|
||||
prefix = '',
|
||||
suffix = ''
|
||||
) => {
|
||||
export const useFormatWrapper = (onChange: (val: string) => void) => {
|
||||
return useCallback(
|
||||
event => {
|
||||
(
|
||||
target: HTMLTextAreaElement,
|
||||
|
||||
prefix = '',
|
||||
suffix = ''
|
||||
) => event => {
|
||||
event.preventDefault();
|
||||
wrapTextInsideInput(target, prefix, suffix, onChange);
|
||||
},
|
||||
[target, onChange, prefix, suffix]
|
||||
[onChange]
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { FC } from 'react';
|
|||
import styles from './styles.module.scss';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { Container } from '~/containers/main/Container';
|
||||
import StickyBox from 'react-sticky-box/dist/esnext';
|
||||
import StickyBox from 'react-sticky-box';
|
||||
import { BorisComments } from '~/containers/boris/BorisComments';
|
||||
import { Card } from '~/components/containers/Card';
|
||||
import { SidebarRouter } from '~/containers/main/SidebarRouter';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue