mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-01 23:56:41 +07:00
refactor editos
This commit is contained in:
parent
03ddb1862c
commit
5e9c111e0f
149 changed files with 416 additions and 317 deletions
src
components
common
BetterScrollDialog
BlurWrapper
Card
CellGrid
Columns
CoverBackdrop
DialogTitle
Filler
Grid
Group
InfiniteScroll
Markdown
ModalWrapper
Padder
Panel
Sticky
Tabs
TagField
Zone
flow
lab
LabBanner
LabBottomPanel
LabDescription
LabFactoryBanner
LabHead
LabHero
LabHeroes
LabNoResults
LabNodeTitle
LabText
main/UserButton
node
notes
notifications/NotificationSettingsForm
placeholders/Paragraph
profile
ProfileAccountsError
ProfileDescription
ProfileSettings
ProfileSidebarNotifications
ProfileSidebarSettings
settings/SettingsMenu
sidebar/SidebarStackCard
welcome/WelcomeSlide
constants/node
containers
auth
LoginDialog
LoginSocialRegisterDialog
RestorePasswordDialog
RestoreRequestDialog
TelegramAttachDialog
boris
comments/CommentForm
dialogs/EditorDialog/components
AudioEditor
AudioGrid
EditorButtons/components/EditorActionsPanel
components
EditorAudioUploadButton
EditorFiller
EditorImageUploadButton
EditorPublicSwitch
EditorUploadButton
EditorUploadCoverButton
constants
index.tsx
|
@ -2,7 +2,7 @@ import React, { FC } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Icon } from '~/components/input/Icon';
|
import { Icon } from '~/components/input/Icon';
|
||||||
import { Toggle } from '~/components/input/Toggle';
|
import { Toggle } from '~/components/input/Toggle';
|
||||||
import { FlowDisplayVariant } from '~/types';
|
import { FlowDisplayVariant } from '~/types';
|
||||||
|
@ -60,7 +60,11 @@ const FlowCellMenu: FC<Props> = ({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{hasDescription && (
|
{hasDescription && (
|
||||||
<Group className={styles.description} horizontal onClick={toggleViewDescription}>
|
<Group
|
||||||
|
className={styles.description}
|
||||||
|
horizontal
|
||||||
|
onClick={toggleViewDescription}
|
||||||
|
>
|
||||||
<Toggle color="white" value={descriptionEnabled} />
|
<Toggle color="white" value={descriptionEnabled} />
|
||||||
<span>Текст</span>
|
<span>Текст</span>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { FC, ReactElement } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Markdown } from '~/components/containers/Markdown';
|
import { Markdown } from '~/components/common/Markdown';
|
||||||
import { formatText } from '~/utils/dom';
|
import { formatText } from '~/utils/dom';
|
||||||
import { DivProps } from '~/utils/types';
|
import { DivProps } from '~/utils/types';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { Dialog } from '~/constants/modal';
|
import { Dialog } from '~/constants/modal';
|
||||||
import { useWindowSize } from '~/hooks/dom/useWindowSize';
|
import { useWindowSize } from '~/hooks/dom/useWindowSize';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { InfiniteScroll } from '~/components/containers/InfiniteScroll';
|
import { InfiniteScroll } from '~/components/common/InfiniteScroll';
|
||||||
import { Icon } from '~/components/input/Icon';
|
import { Icon } from '~/components/input/Icon';
|
||||||
import { INode } from '~/types';
|
import { INode } from '~/types';
|
||||||
|
|
||||||
|
@ -15,7 +15,12 @@ interface IProps {
|
||||||
onLoadMore: () => void;
|
onLoadMore: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FlowSearchResults: FC<IProps> = ({ results, isLoading, onLoadMore, hasMore }) => {
|
const FlowSearchResults: FC<IProps> = ({
|
||||||
|
results,
|
||||||
|
isLoading,
|
||||||
|
onLoadMore,
|
||||||
|
hasMore,
|
||||||
|
}) => {
|
||||||
if (!results.length) {
|
if (!results.length) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.loading}>
|
<div className={styles.loading}>
|
||||||
|
@ -28,7 +33,7 @@ const FlowSearchResults: FC<IProps> = ({ results, isLoading, onLoadMore, hasMore
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrap}>
|
<div className={styles.wrap}>
|
||||||
<InfiniteScroll hasMore={hasMore} loadMore={onLoadMore}>
|
<InfiniteScroll hasMore={hasMore} loadMore={onLoadMore}>
|
||||||
{results.map(node => (
|
{results.map((node) => (
|
||||||
<FlowRecentItem node={node} key={node.id} />
|
<FlowRecentItem node={node} key={node.id} />
|
||||||
))}
|
))}
|
||||||
</InfiniteScroll>
|
</InfiniteScroll>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { LabSquare } from '~/components/lab/LabSquare';
|
import { LabSquare } from '~/components/lab/LabSquare';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
@ -15,8 +15,8 @@ const LabBanner: FC<IProps> = () => (
|
||||||
<Group className={styles.content}>
|
<Group className={styles.content}>
|
||||||
<p>
|
<p>
|
||||||
<strong>
|
<strong>
|
||||||
Всё, что происходит здесь — всего лишь эксперимент, о котором не узнает никто за
|
Всё, что происходит здесь — всего лишь эксперимент, о котором
|
||||||
пределами Убежища.
|
не узнает никто за пределами Убежища.
|
||||||
</strong>
|
</strong>
|
||||||
</p>
|
</p>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
|
@ -2,9 +2,9 @@ import React, { FC, useCallback } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { Grid } from '~/components/containers/Grid';
|
import { Grid } from '~/components/common/Grid';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Icon } from '~/components/input/Icon';
|
import { Icon } from '~/components/input/Icon';
|
||||||
import { Placeholder } from '~/components/placeholders/Placeholder';
|
import { Placeholder } from '~/components/placeholders/Placeholder';
|
||||||
import { URLS } from '~/constants/urls';
|
import { URLS } from '~/constants/urls';
|
||||||
|
@ -21,14 +21,24 @@ type Props = {
|
||||||
commentCount: number;
|
commentCount: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
const LabBottomPanel: FC<Props> = ({ node, hasNewComments, commentCount, isLoading }) => {
|
const LabBottomPanel: FC<Props> = ({
|
||||||
|
node,
|
||||||
|
hasNewComments,
|
||||||
|
commentCount,
|
||||||
|
isLoading,
|
||||||
|
}) => {
|
||||||
const { push } = useNavigation();
|
const { push } = useNavigation();
|
||||||
const onClick = useCallback(() => push(URLS.NODE_URL(node.id)), [push, node.id]);
|
const onClick = useCallback(
|
||||||
|
() => push(URLS.NODE_URL(node.id)),
|
||||||
|
[push, node.id],
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Group horizontal className={styles.wrap} onClick={onClick}>
|
<Group horizontal className={styles.wrap} onClick={onClick}>
|
||||||
<div className={styles.timestamp}>
|
<div className={styles.timestamp}>
|
||||||
<Placeholder active={isLoading}>{getPrettyDate(node.created_at)}</Placeholder>
|
<Placeholder active={isLoading}>
|
||||||
|
{getPrettyDate(node.created_at)}
|
||||||
|
</Placeholder>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Filler />
|
<Filler />
|
||||||
|
@ -37,7 +47,9 @@ const LabBottomPanel: FC<Props> = ({ node, hasNewComments, commentCount, isLoadi
|
||||||
{commentCount > 0 && (
|
{commentCount > 0 && (
|
||||||
<Grid
|
<Grid
|
||||||
horizontal
|
horizontal
|
||||||
className={classNames(styles.comments, { [styles.active]: hasNewComments })}
|
className={classNames(styles.comments, {
|
||||||
|
[styles.active]: hasNewComments,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
<Icon icon={hasNewComments ? 'comment_new' : 'comment'} size={24} />
|
<Icon icon={hasNewComments ? 'comment_new' : 'comment'} size={24} />
|
||||||
<span>{commentCount}</span>
|
<span>{commentCount}</span>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { Markdown } from '~/components/containers/Markdown';
|
import { Markdown } from '~/components/common/Markdown';
|
||||||
import { Paragraph } from '~/components/placeholders/Paragraph';
|
import { Paragraph } from '~/components/placeholders/Paragraph';
|
||||||
import { NodeComponentProps } from '~/constants/node';
|
import { NodeComponentProps } from '~/constants/node';
|
||||||
import { useGotoNode } from '~/hooks/node/useGotoNode';
|
import { useGotoNode } from '~/hooks/node/useGotoNode';
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { useRef } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { SearchInput } from '~/components/input/SearchInput';
|
import { SearchInput } from '~/components/input/SearchInput';
|
||||||
import { HorizontalMenu } from '~/components/menu/HorizontalMenu';
|
import { HorizontalMenu } from '~/components/menu/HorizontalMenu';
|
||||||
import { LabNodesSort } from '~/types/lab';
|
import { LabNodesSort } from '~/types/lab';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC, useCallback } from 'react';
|
import React, { FC, useCallback } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Icon } from '~/components/input/Icon';
|
import { Icon } from '~/components/input/Icon';
|
||||||
import { Placeholder } from '~/components/placeholders/Placeholder';
|
import { Placeholder } from '~/components/placeholders/Placeholder';
|
||||||
import { URLS } from '~/constants/urls';
|
import { URLS } from '~/constants/urls';
|
||||||
|
@ -44,7 +44,9 @@ const LabHero: FC<IProps> = ({ node, isLoading }) => {
|
||||||
|
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
<div className={styles.title}>{node.title}</div>
|
<div className={styles.title}>{node.title}</div>
|
||||||
<div className={styles.description}>{getPrettyDate(node.created_at)}</div>
|
<div className={styles.description}>
|
||||||
|
{getPrettyDate(node.created_at)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Group>
|
</Group>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { LabHero } from '~/components/lab/LabHero';
|
import { LabHero } from '~/components/lab/LabHero';
|
||||||
import styles from '~/containers/lab/LabStats/styles.module.scss';
|
import styles from '~/containers/lab/LabStats/styles.module.scss';
|
||||||
import { INode } from '~/types';
|
import { INode } from '~/types';
|
||||||
|
@ -16,7 +16,7 @@ const LabHeroes: FC<IProps> = ({ nodes, isLoading }) => {
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<Group className={styles.heroes}>
|
<Group className={styles.heroes}>
|
||||||
{empty.map(i => (
|
{empty.map((i) => (
|
||||||
<LabHero isLoading key={i} />
|
<LabHero isLoading key={i} />
|
||||||
))}
|
))}
|
||||||
</Group>
|
</Group>
|
||||||
|
@ -25,7 +25,7 @@ const LabHeroes: FC<IProps> = ({ nodes, isLoading }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Group className={styles.heroes}>
|
<Group className={styles.heroes}>
|
||||||
{nodes.slice(0, 10).map(node => (
|
{nodes.slice(0, 10).map((node) => (
|
||||||
<LabHero node={node} key={node?.id} />
|
<LabHero node={node} key={node?.id} />
|
||||||
))}
|
))}
|
||||||
</Group>
|
</Group>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { VFC } from 'react';
|
import React, { VFC } from 'react';
|
||||||
|
|
||||||
import { Card } from '~/components/containers/Card';
|
import { Card } from '~/components/common/Card';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { FC } from 'react';
|
||||||
|
|
||||||
import Tippy from '@tippyjs/react';
|
import Tippy from '@tippyjs/react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Icon } from '~/components/input/Icon';
|
import { Icon } from '~/components/input/Icon';
|
||||||
import { Placeholder } from '~/components/placeholders/Placeholder';
|
import { Placeholder } from '~/components/placeholders/Placeholder';
|
||||||
import { NodeComponentProps } from '~/constants/node';
|
import { NodeComponentProps } from '~/constants/node';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC, useMemo } from 'react';
|
import React, { FC, useMemo } from 'react';
|
||||||
|
|
||||||
import { Markdown } from '~/components/containers/Markdown';
|
import { Markdown } from '~/components/common/Markdown';
|
||||||
import { Paragraph } from '~/components/placeholders/Paragraph';
|
import { Paragraph } from '~/components/placeholders/Paragraph';
|
||||||
import { NodeComponentProps } from '~/constants/node';
|
import { NodeComponentProps } from '~/constants/node';
|
||||||
import { useGotoNode } from '~/hooks/node/useGotoNode';
|
import { useGotoNode } from '~/hooks/node/useGotoNode';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
import { Avatar } from '~/components/common/Avatar';
|
import { Avatar } from '~/components/common/Avatar';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { imagePresets } from '~/constants/urls';
|
import { imagePresets } from '~/constants/urls';
|
||||||
import { IFile } from '~/types';
|
import { IFile } from '~/types';
|
||||||
import { getURL } from '~/utils/dom';
|
import { getURL } from '~/utils/dom';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { Avatar } from '~/components/common/Avatar';
|
import { Avatar } from '~/components/common/Avatar';
|
||||||
import { Card } from '~/components/containers/Card';
|
import { Card } from '~/components/common/Card';
|
||||||
import { useUserDescription } from '~/hooks/auth/useUserDescription';
|
import { useUserDescription } from '~/hooks/auth/useUserDescription';
|
||||||
import { INodeUser } from '~/types';
|
import { INodeUser } from '~/types';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { FC, useMemo } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { ERRORS } from '~/constants/errors';
|
import { ERRORS } from '~/constants/errors';
|
||||||
import { t } from '~/utils/trans';
|
import { t } from '~/utils/trans';
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React, { FC, ReactElement } from 'react';
|
import React, { FC, ReactElement } from 'react';
|
||||||
|
|
||||||
|
import { Group } from '~/components/common/Group';
|
||||||
import { Hoverable } from '~/components/common/Hoverable';
|
import { Hoverable } from '~/components/common/Hoverable';
|
||||||
import { SubTitle } from '~/components/common/SubTitle';
|
import { SubTitle } from '~/components/common/SubTitle';
|
||||||
import { Group } from '~/components/containers/Group';
|
|
||||||
import { NodeThumbnail } from '~/components/node/NodeThumbnail';
|
import { NodeThumbnail } from '~/components/node/NodeThumbnail';
|
||||||
import { INode } from '~/types';
|
import { INode } from '~/types';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { FC, memo } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import cell_style from '~/components/node/NodeThumbnail/styles.module.scss';
|
import cell_style from '~/components/node/NodeThumbnail/styles.module.scss';
|
||||||
import { Placeholder } from '~/components/placeholders/Placeholder';
|
import { Placeholder } from '~/components/placeholders/Placeholder';
|
||||||
import { range } from '~/utils/ramda';
|
import { range } from '~/utils/ramda';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React, { useCallback, useState, VFC } from 'react';
|
import React, { useCallback, useState, VFC } from 'react';
|
||||||
|
|
||||||
import { Card } from '~/components/containers/Card';
|
import { Card } from '~/components/common/Card';
|
||||||
import { Markdown } from '~/components/containers/Markdown';
|
import { Markdown } from '~/components/common/Markdown';
|
||||||
import { Padder } from '~/components/containers/Padder';
|
import { Padder } from '~/components/common/Padder';
|
||||||
import { NoteMenu } from '~/components/notes/NoteMenu';
|
import { NoteMenu } from '~/components/notes/NoteMenu';
|
||||||
import { formatText, getPrettyDate } from '~/utils/dom';
|
import { formatText, getPrettyDate } from '~/utils/dom';
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { FC, useCallback } from 'react';
|
||||||
import { FormikConfig, useFormik } from 'formik';
|
import { FormikConfig, useFormik } from 'formik';
|
||||||
import { Asserts, object, string } from 'yup';
|
import { Asserts, object, string } from 'yup';
|
||||||
|
|
||||||
import { Card } from '~/components/containers/Card';
|
import { Card } from '~/components/common/Card';
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { Textarea } from '~/components/input/Textarea';
|
import { Textarea } from '~/components/input/Textarea';
|
||||||
import { useRandomPhrase } from '~/constants/phrases';
|
import { useRandomPhrase } from '~/constants/phrases';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React, { FC, useCallback } from 'react';
|
import React, { FC, useCallback } from 'react';
|
||||||
|
|
||||||
import { Card } from '~/components/containers/Card';
|
import { Card } from '~/components/common/Card';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Zone } from '~/components/containers/Zone';
|
import { Zone } from '~/components/common/Zone';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { InputRow } from '~/components/input/InputRow';
|
import { InputRow } from '~/components/input/InputRow';
|
||||||
import { Toggle } from '~/components/input/Toggle';
|
import { Toggle } from '~/components/input/Toggle';
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
import React, { FC, useMemo } from 'react';
|
import React, { FC, useMemo } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Placeholder, PlaceholderProps } from '~/components/placeholders/Placeholder';
|
import {
|
||||||
|
Placeholder,
|
||||||
|
PlaceholderProps,
|
||||||
|
} from '~/components/placeholders/Placeholder';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
|
@ -14,17 +17,21 @@ const Paragraph: FC<Props> = ({ lines = 3, wordsLimit = 12, ...props }) => {
|
||||||
const iters = useMemo(
|
const iters = useMemo(
|
||||||
() =>
|
() =>
|
||||||
[...new Array(lines)].map(() =>
|
[...new Array(lines)].map(() =>
|
||||||
[...new Array(Math.ceil(Math.random() * wordsLimit))].map((_, i) => i)
|
[...new Array(Math.ceil(Math.random() * wordsLimit))].map((_, i) => i),
|
||||||
),
|
),
|
||||||
[lines, wordsLimit]
|
[lines, wordsLimit],
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Group>
|
<Group>
|
||||||
{iters.map((words, i) => (
|
{iters.map((words, i) => (
|
||||||
<div className={styles.para} key={i}>
|
<div className={styles.para} key={i}>
|
||||||
{words.map(word => (
|
{words.map((word) => (
|
||||||
<Placeholder key={word} width={`${Math.round(Math.random() * 120) + 60}px`} active />
|
<Placeholder
|
||||||
|
key={word}
|
||||||
|
width={`${Math.round(Math.random() * 120) + 60}px`}
|
||||||
|
active
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { ERROR_LITERAL } from '~/constants/errors';
|
import { ERROR_LITERAL } from '~/constants/errors';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { FC } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { ProfileLoader } from '~/containers/profile/ProfileLoader';
|
import { ProfileLoader } from '~/containers/profile/ProfileLoader';
|
||||||
import { useUser } from '~/hooks/auth/useUser';
|
import { useUser } from '~/hooks/auth/useUser';
|
||||||
import markdown from '~/styles/common/markdown.module.scss';
|
import markdown from '~/styles/common/markdown.module.scss';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Padder } from '~/components/containers/Padder';
|
import { Padder } from '~/components/common/Padder';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { UserSettingsView } from '~/containers/settings/UserSettingsView';
|
import { UserSettingsView } from '~/containers/settings/UserSettingsView';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { useState, VFC } from 'react';
|
import { useState, VFC } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { HorizontalMenu } from '~/components/menu/HorizontalMenu';
|
import { HorizontalMenu } from '~/components/menu/HorizontalMenu';
|
||||||
import { useStackContext } from '~/components/sidebar/SidebarStack';
|
import { useStackContext } from '~/components/sidebar/SidebarStack';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { useStackContext } from '~/components/sidebar/SidebarStack';
|
import { useStackContext } from '~/components/sidebar/SidebarStack';
|
||||||
import { SidebarStackCard } from '~/components/sidebar/SidebarStackCard';
|
import { SidebarStackCard } from '~/components/sidebar/SidebarStackCard';
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { VFC } from 'react';
|
||||||
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { VerticalMenu } from '~/components/menu/VerticalMenu';
|
import { VerticalMenu } from '~/components/menu/VerticalMenu';
|
||||||
import { URLS } from '~/constants/urls';
|
import { URLS } from '~/constants/urls';
|
||||||
|
@ -28,7 +28,9 @@ const SettingsMenu: VFC<SettingsMenuProps> = () => (
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Link href={URLS.SETTINGS.TRASH} passHref>
|
<Link href={URLS.SETTINGS.TRASH} passHref>
|
||||||
<VerticalMenu.Item onClick={console.log}>Удалённые посты</VerticalMenu.Item>
|
<VerticalMenu.Item onClick={console.log}>
|
||||||
|
Удалённые посты
|
||||||
|
</VerticalMenu.Item>
|
||||||
</Link>
|
</Link>
|
||||||
</VerticalMenu>
|
</VerticalMenu>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC, ReactNode, useMemo } from 'react';
|
import React, { FC, ReactNode, useMemo } from 'react';
|
||||||
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { FC } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { Container } from '~/containers/main/Container';
|
import { Container } from '~/containers/main/Container';
|
||||||
import { useAuth } from '~/hooks/auth/useAuth';
|
import { useAuth } from '~/hooks/auth/useAuth';
|
||||||
import markdown from '~/styles/common/markdown.module.scss';
|
import markdown from '~/styles/common/markdown.module.scss';
|
||||||
|
|
|
@ -1,15 +1,5 @@
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
import { AudioEditor } from '~/components/editors/AudioEditor';
|
|
||||||
import { EditorAudioUploadButton } from '~/components/editors/EditorAudioUploadButton';
|
|
||||||
import { EditorFiller } from '~/components/editors/EditorFiller';
|
|
||||||
import { EditorImageUploadButton } from '~/components/editors/EditorImageUploadButton';
|
|
||||||
import { EditorPublicSwitch } from '~/components/editors/EditorPublicSwitch';
|
|
||||||
import { EditorUploadCoverButton } from '~/components/editors/EditorUploadCoverButton';
|
|
||||||
import { ImageEditor } from '~/components/editors/ImageEditor';
|
|
||||||
import { RoomEditor } from '~/components/editors/RoomEditor';
|
|
||||||
import { TextEditor } from '~/components/editors/TextEditor';
|
|
||||||
import { VideoEditor } from '~/components/editors/VideoEditor';
|
|
||||||
import { LabAudio } from '~/components/lab/LabAudioBlock';
|
import { LabAudio } from '~/components/lab/LabAudioBlock';
|
||||||
import { LabDescription } from '~/components/lab/LabDescription';
|
import { LabDescription } from '~/components/lab/LabDescription';
|
||||||
import { LabImage } from '~/components/lab/LabImage';
|
import { LabImage } from '~/components/lab/LabImage';
|
||||||
|
@ -23,7 +13,6 @@ import { NodeImageSwiperBlock } from '~/components/node/NodeImageSwiperBlock';
|
||||||
import { NodeTextBlock } from '~/components/node/NodeTextBlock';
|
import { NodeTextBlock } from '~/components/node/NodeTextBlock';
|
||||||
import { NodeVideoBlock } from '~/components/node/NodeVideoBlock';
|
import { NodeVideoBlock } from '~/components/node/NodeVideoBlock';
|
||||||
import { IComment, INode, ValueOf } from '~/types';
|
import { IComment, INode, ValueOf } from '~/types';
|
||||||
import { IEditorComponentProps, NodeEditorProps } from '~/types/node';
|
|
||||||
|
|
||||||
export const EMPTY_NODE: INode = {
|
export const EMPTY_NODE: INode = {
|
||||||
id: 0,
|
id: 0,
|
||||||
|
@ -98,60 +87,6 @@ export const EMPTY_COMMENT: IComment = {
|
||||||
user: undefined,
|
user: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const NODE_EDITORS: Record<
|
|
||||||
typeof NODE_TYPES[keyof typeof NODE_TYPES],
|
|
||||||
FC<NodeEditorProps>
|
|
||||||
> = {
|
|
||||||
[NODE_TYPES.IMAGE]: ImageEditor,
|
|
||||||
[NODE_TYPES.TEXT]: TextEditor,
|
|
||||||
[NODE_TYPES.VIDEO]: VideoEditor,
|
|
||||||
[NODE_TYPES.AUDIO]: AudioEditor,
|
|
||||||
[NODE_TYPES.ROOM]: RoomEditor,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const NODE_PANEL_COMPONENTS: Record<
|
|
||||||
string,
|
|
||||||
FC<IEditorComponentProps>[]
|
|
||||||
> = {
|
|
||||||
[NODE_TYPES.TEXT]: [
|
|
||||||
EditorFiller,
|
|
||||||
EditorUploadCoverButton,
|
|
||||||
EditorPublicSwitch,
|
|
||||||
],
|
|
||||||
[NODE_TYPES.VIDEO]: [
|
|
||||||
EditorFiller,
|
|
||||||
EditorUploadCoverButton,
|
|
||||||
EditorPublicSwitch,
|
|
||||||
],
|
|
||||||
[NODE_TYPES.IMAGE]: [
|
|
||||||
EditorImageUploadButton,
|
|
||||||
EditorFiller,
|
|
||||||
EditorUploadCoverButton,
|
|
||||||
EditorPublicSwitch,
|
|
||||||
],
|
|
||||||
[NODE_TYPES.AUDIO]: [
|
|
||||||
EditorAudioUploadButton,
|
|
||||||
EditorImageUploadButton,
|
|
||||||
EditorFiller,
|
|
||||||
EditorUploadCoverButton,
|
|
||||||
EditorPublicSwitch,
|
|
||||||
],
|
|
||||||
[NODE_TYPES.ROOM]: [
|
|
||||||
EditorAudioUploadButton,
|
|
||||||
EditorImageUploadButton,
|
|
||||||
EditorFiller,
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export const NODE_EDITOR_DATA: Record<
|
|
||||||
typeof NODE_TYPES[keyof typeof NODE_TYPES],
|
|
||||||
Partial<INode>
|
|
||||||
> = {
|
|
||||||
[NODE_TYPES.TEXT]: {
|
|
||||||
blocks: [{ text: '', type: 'text' }],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const NODE_SETTINGS = {
|
export const NODE_SETTINGS = {
|
||||||
MAX_FILES: 16,
|
MAX_FILES: 16,
|
||||||
MAX_IMAGE_ASPECT: 1.2,
|
MAX_IMAGE_ASPECT: 1.2,
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { Grid } from '~/components/containers/Grid';
|
import { Grid } from '~/components/common/Grid';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { OAuthProvider } from '~/types/auth';
|
import { OAuthProvider } from '~/types/auth';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
openOauthWindow: (provider: OAuthProvider) => void;
|
openOauthWindow: (provider: OAuthProvider) => void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { FC, useCallback, useRef } from 'react';
|
import { FC, useCallback, useRef } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { BetterScrollDialog } from '~/components/common/BetterScrollDialog';
|
||||||
import { Padder } from '~/components/containers/Padder';
|
import { DialogTitle } from '~/components/common/DialogTitle';
|
||||||
import { BetterScrollDialog } from '~/components/dialogs/BetterScrollDialog';
|
import { Group } from '~/components/common/Group';
|
||||||
import { DialogTitle } from '~/components/dialogs/DialogTitle';
|
import { Padder } from '~/components/common/Padder';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { InputText } from '~/components/input/InputText';
|
import { InputText } from '~/components/input/InputText';
|
||||||
import { Dialog } from '~/constants/modal';
|
import { Dialog } from '~/constants/modal';
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import React, { FC, useCallback, useState } from 'react';
|
import React, { FC, useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { apiLoginWithSocial } from '~/api/auth';
|
import { apiLoginWithSocial } from '~/api/auth';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { BetterScrollDialog } from '~/components/common/BetterScrollDialog';
|
||||||
import { Padder } from '~/components/containers/Padder';
|
import { DialogTitle } from '~/components/common/DialogTitle';
|
||||||
import { BetterScrollDialog } from '~/components/dialogs/BetterScrollDialog';
|
import { Group } from '~/components/common/Group';
|
||||||
import { DialogTitle } from '~/components/dialogs/DialogTitle';
|
import { Padder } from '~/components/common/Padder';
|
||||||
import { InputText } from '~/components/input/InputText';
|
import { InputText } from '~/components/input/InputText';
|
||||||
import { Toggle } from '~/components/input/Toggle';
|
import { Toggle } from '~/components/input/Toggle';
|
||||||
import { getRandomPhrase } from '~/constants/phrases';
|
import { getRandomPhrase } from '~/constants/phrases';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { VFC } from 'react';
|
import React, { VFC } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { Icon } from '~/components/input/Icon';
|
import { Icon } from '~/components/input/Icon';
|
||||||
import { ERROR_LITERAL, ERRORS } from '~/constants/errors';
|
import { ERROR_LITERAL, ERRORS } from '~/constants/errors';
|
||||||
|
@ -12,7 +12,10 @@ interface RestoreInvalidCodeProps {
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const RestoreInvalidCode: VFC<RestoreInvalidCodeProps> = ({ error, onClose }) => (
|
const RestoreInvalidCode: VFC<RestoreInvalidCodeProps> = ({
|
||||||
|
error,
|
||||||
|
onClose,
|
||||||
|
}) => (
|
||||||
<Group className={styles.error_shade}>
|
<Group className={styles.error_shade}>
|
||||||
<Icon icon="close" size={64} />
|
<Icon icon="close" size={64} />
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { VFC } from 'react';
|
import React, { VFC } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { Icon } from '~/components/input/Icon';
|
import { Icon } from '~/components/input/Icon';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { FC, useCallback, useMemo, useState } from 'react';
|
import React, { FC, useCallback, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import { apiRestoreCode } from '~/api/auth';
|
import { apiRestoreCode } from '~/api/auth';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { InputText } from '~/components/input/InputText';
|
import { InputText } from '~/components/input/InputText';
|
||||||
import { useCloseOnEscape } from '~/hooks';
|
import { useCloseOnEscape } from '~/hooks';
|
||||||
|
@ -9,7 +9,7 @@ import { useRestoreCode } from '~/hooks/auth/useRestoreCode';
|
||||||
import { useRestorePasswordForm } from '~/hooks/auth/useRestorePasswordForm';
|
import { useRestorePasswordForm } from '~/hooks/auth/useRestorePasswordForm';
|
||||||
import { DialogComponentProps } from '~/types/modal';
|
import { DialogComponentProps } from '~/types/modal';
|
||||||
|
|
||||||
import { BetterScrollDialog } from '../../../components/dialogs/BetterScrollDialog';
|
import { BetterScrollDialog } from '../../../components/common/BetterScrollDialog';
|
||||||
|
|
||||||
import { RestoreInvalidCode } from './components/RestoreInvalidCode';
|
import { RestoreInvalidCode } from './components/RestoreInvalidCode';
|
||||||
import { RestoreSuccess } from './components/RestoreSuccess';
|
import { RestoreSuccess } from './components/RestoreSuccess';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { VFC } from 'react';
|
import React, { VFC } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { Icon } from '~/components/input/Icon';
|
import { Icon } from '~/components/input/Icon';
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import React, { useCallback, useMemo, useState, VFC } from 'react';
|
import React, { useCallback, useMemo, useState, VFC } from 'react';
|
||||||
|
|
||||||
import { apiRequestRestoreCode } from '~/api/auth';
|
import { apiRequestRestoreCode } from '~/api/auth';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { InputText } from '~/components/input/InputText';
|
import { InputText } from '~/components/input/InputText';
|
||||||
import { useCloseOnEscape } from '~/hooks';
|
import { useCloseOnEscape } from '~/hooks';
|
||||||
import { useRestoreRequestForm } from '~/hooks/auth/useRestoreRequestForm';
|
import { useRestoreRequestForm } from '~/hooks/auth/useRestoreRequestForm';
|
||||||
import { DialogComponentProps } from '~/types/modal';
|
import { DialogComponentProps } from '~/types/modal';
|
||||||
|
|
||||||
import { BetterScrollDialog } from '../../../components/dialogs/BetterScrollDialog';
|
import { BetterScrollDialog } from '../../../components/common/BetterScrollDialog';
|
||||||
|
|
||||||
import { RestoreSent } from './components/RestoreSent';
|
import { RestoreSent } from './components/RestoreSent';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
|
@ -2,12 +2,12 @@ import React, { FC, useCallback, useMemo } from 'react';
|
||||||
|
|
||||||
import { TelegramUser } from '@v9v/ts-react-telegram-login';
|
import { TelegramUser } from '@v9v/ts-react-telegram-login';
|
||||||
|
|
||||||
import { Padder } from '~/components/containers/Padder';
|
import { Padder } from '~/components/common/Padder';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { useTelegramAccount } from '~/hooks/auth/useTelegramAccount';
|
import { useTelegramAccount } from '~/hooks/auth/useTelegramAccount';
|
||||||
import { DialogComponentProps } from '~/types/modal';
|
import { DialogComponentProps } from '~/types/modal';
|
||||||
|
|
||||||
import { BetterScrollDialog } from '../../../components/dialogs/BetterScrollDialog';
|
import { BetterScrollDialog } from '../../../components/common/BetterScrollDialog';
|
||||||
import { TelegramLoginForm } from '../LoginDialog/components/TelegramLoginForm/index';
|
import { TelegramLoginForm } from '../LoginDialog/components/TelegramLoginForm/index';
|
||||||
|
|
||||||
interface TelegramAttachDialogProps extends DialogComponentProps {}
|
interface TelegramAttachDialogProps extends DialogComponentProps {}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { Footer } from '~/components/main/Footer';
|
import { Footer } from '~/components/main/Footer';
|
||||||
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
||||||
import { NodeCommentFormSSR } from '~/containers/node/NodeCommentForm/ssr';
|
import { NodeCommentFormSSR } from '~/containers/node/NodeCommentForm/ssr';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { Padder } from '~/components/containers/Padder';
|
import { Padder } from '~/components/common/Padder';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
|
|
||||||
import { BorisContactItem } from './components/BorisContactItem';
|
import { BorisContactItem } from './components/BorisContactItem';
|
||||||
|
|
|
@ -2,10 +2,10 @@ import React, { FC, ReactNode } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import { Card, CardProps } from '~/components/common/Card';
|
||||||
|
import { Filler } from '~/components/common/Filler';
|
||||||
|
import { Group } from '~/components/common/Group';
|
||||||
import { SubTitle } from '~/components/common/SubTitle';
|
import { SubTitle } from '~/components/common/SubTitle';
|
||||||
import { Card, CardProps } from '~/components/containers/Card';
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
|
||||||
import { Group } from '~/components/containers/Group';
|
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import React, { VFC } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { addYears, differenceInMonths, differenceInYears } from 'date-fns';
|
import { addYears, differenceInMonths, differenceInYears } from 'date-fns';
|
||||||
|
|
||||||
import { CardProps } from '~/components/containers/Card';
|
import { CardProps } from '~/components/common/Card';
|
||||||
|
|
||||||
import { StatsCard } from '../StatsCard';
|
import { StatsCard } from '../StatsCard';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { VFC } from 'react';
|
import React, { VFC } from 'react';
|
||||||
|
|
||||||
import { CardProps } from '~/components/containers/Card';
|
import { CardProps } from '~/components/common/Card';
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
|
|
||||||
import { BasicCurveChart } from '../BasicCurveChart';
|
import { BasicCurveChart } from '../BasicCurveChart';
|
||||||
import { StatsCard } from '../StatsCard';
|
import { StatsCard } from '../StatsCard';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import { SuperPowersToggle } from '~/containers/auth/SuperPowersToggle';
|
import { SuperPowersToggle } from '~/containers/auth/SuperPowersToggle';
|
||||||
import { useTelegramAccount } from '~/hooks/auth/useTelegramAccount';
|
import { useTelegramAccount } from '~/hooks/auth/useTelegramAccount';
|
||||||
import { BorisUsageStats } from '~/types/boris';
|
import { BorisUsageStats } from '~/types/boris';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
import { Anchor } from '~/components/common/Anchor';
|
import { Anchor } from '~/components/common/Anchor';
|
||||||
import { Card } from '~/components/containers/Card';
|
import { Card } from '~/components/common/Card';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
import markdown from '~/styles/common/markdown.module.scss';
|
import markdown from '~/styles/common/markdown.module.scss';
|
||||||
|
|
||||||
export interface BorisSuperpowersProps {}
|
export interface BorisSuperpowersProps {}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { FC, useCallback, useState } from 'react';
|
||||||
import { FormikProvider } from 'formik';
|
import { FormikProvider } from 'formik';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { Button } from '~/components/input/Button';
|
import { Button } from '~/components/input/Button';
|
||||||
import { ERROR_LITERAL } from '~/constants/errors';
|
import { ERROR_LITERAL } from '~/constants/errors';
|
||||||
import { EMPTY_COMMENT } from '~/constants/node';
|
import { EMPTY_COMMENT } from '~/constants/node';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { EditorUploadButton } from '~/components/editors/EditorUploadButton';
|
|
||||||
import { UploadType } from '~/constants/uploads';
|
import { UploadType } from '~/constants/uploads';
|
||||||
|
import { EditorUploadButton } from '~/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadButton';
|
||||||
import { IEditorComponentProps } from '~/types/node';
|
import { IEditorComponentProps } from '~/types/node';
|
||||||
|
|
||||||
type IProps = IEditorComponentProps & {};
|
type IProps = IEditorComponentProps & {};
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
import { IEditorComponentProps } from '~/types/node';
|
import { IEditorComponentProps } from '~/types/node';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
|
@ -1,9 +1,10 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
import { EditorUploadButton } from '~/components/editors/EditorUploadButton';
|
|
||||||
import { UploadType } from '~/constants/uploads';
|
import { UploadType } from '~/constants/uploads';
|
||||||
import { IEditorComponentProps } from '~/types/node';
|
import { IEditorComponentProps } from '~/types/node';
|
||||||
|
|
||||||
|
import { EditorUploadButton } from '../EditorUploadButton';
|
||||||
|
|
||||||
type IProps = IEditorComponentProps & {};
|
type IProps = IEditorComponentProps & {};
|
||||||
|
|
||||||
const EditorImageUploadButton: FC<IProps> = () => (
|
const EditorImageUploadButton: FC<IProps> = () => (
|
|
@ -0,0 +1,44 @@
|
||||||
|
import { FC } from 'react';
|
||||||
|
|
||||||
|
import { NODE_TYPES } from '~/constants/node';
|
||||||
|
import { IEditorComponentProps } from '~/types/node';
|
||||||
|
|
||||||
|
import { EditorAudioUploadButton } from '../components/EditorAudioUploadButton';
|
||||||
|
import { EditorFiller } from '../components/EditorFiller';
|
||||||
|
import { EditorImageUploadButton } from '../components/EditorImageUploadButton';
|
||||||
|
import { EditorPublicSwitch } from '../components/EditorPublicSwitch';
|
||||||
|
import { EditorUploadCoverButton } from '../components/EditorUploadCoverButton';
|
||||||
|
|
||||||
|
export const NODE_PANEL_COMPONENTS: Record<
|
||||||
|
string,
|
||||||
|
FC<IEditorComponentProps>[]
|
||||||
|
> = {
|
||||||
|
[NODE_TYPES.TEXT]: [
|
||||||
|
EditorFiller,
|
||||||
|
EditorUploadCoverButton,
|
||||||
|
EditorPublicSwitch,
|
||||||
|
],
|
||||||
|
[NODE_TYPES.VIDEO]: [
|
||||||
|
EditorFiller,
|
||||||
|
EditorUploadCoverButton,
|
||||||
|
EditorPublicSwitch,
|
||||||
|
],
|
||||||
|
[NODE_TYPES.IMAGE]: [
|
||||||
|
EditorImageUploadButton,
|
||||||
|
EditorFiller,
|
||||||
|
EditorUploadCoverButton,
|
||||||
|
EditorPublicSwitch,
|
||||||
|
],
|
||||||
|
[NODE_TYPES.AUDIO]: [
|
||||||
|
EditorAudioUploadButton,
|
||||||
|
EditorImageUploadButton,
|
||||||
|
EditorFiller,
|
||||||
|
EditorUploadCoverButton,
|
||||||
|
EditorPublicSwitch,
|
||||||
|
],
|
||||||
|
[NODE_TYPES.ROOM]: [
|
||||||
|
EditorAudioUploadButton,
|
||||||
|
EditorImageUploadButton,
|
||||||
|
EditorFiller,
|
||||||
|
],
|
||||||
|
};
|
|
@ -1,9 +1,9 @@
|
||||||
import React, { createElement, FC } from 'react';
|
import React, { createElement, FC } from 'react';
|
||||||
|
|
||||||
import { NODE_PANEL_COMPONENTS } from '~/constants/node';
|
|
||||||
import { useNodeFormContext } from '~/hooks/node/useNodeFormFormik';
|
import { useNodeFormContext } from '~/hooks/node/useNodeFormFormik';
|
||||||
import { has } from '~/utils/ramda';
|
import { has } from '~/utils/ramda';
|
||||||
|
|
||||||
|
import { NODE_PANEL_COMPONENTS } from './constants';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
const EditorActionsPanel: FC = () => {
|
const EditorActionsPanel: FC = () => {
|
||||||
|
@ -16,7 +16,9 @@ const EditorActionsPanel: FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className={styles.panel}>
|
<div className={styles.panel}>
|
||||||
{NODE_PANEL_COMPONENTS[values.type] &&
|
{NODE_PANEL_COMPONENTS[values.type] &&
|
||||||
NODE_PANEL_COMPONENTS[values.type].map((el, key) => createElement(el, { key }))}
|
NODE_PANEL_COMPONENTS[values.type].map((el, key) =>
|
||||||
|
createElement(el, { key }),
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue