mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
refactor main components and IProps
This commit is contained in:
parent
85a182c053
commit
efbaf13151
124 changed files with 235 additions and 256 deletions
|
@ -4,12 +4,12 @@ import { describeArc } from '~/utils/dom';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
size: number;
|
size: number;
|
||||||
progress?: number;
|
progress?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ArcProgress: FC<IProps> = ({ size, progress = 0 }) => (
|
export const ArcProgress: FC<Props> = ({ size, progress = 0 }) => (
|
||||||
<svg className={styles.icon} width={size} height={size}>
|
<svg className={styles.icon} width={size} height={size}>
|
||||||
<path
|
<path
|
||||||
d={describeArc(
|
d={describeArc(
|
||||||
|
|
|
@ -4,12 +4,12 @@ import { observer } from 'mobx-react-lite';
|
||||||
|
|
||||||
import { useAuth } from '~/hooks/auth/useAuth';
|
import { useAuth } from '~/hooks/auth/useAuth';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
// don't wait for user refetch, trust hydration
|
// don't wait for user refetch, trust hydration
|
||||||
hydratedOnly?: boolean;
|
hydratedOnly?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Authorized: FC<IProps> = observer(({ children, hydratedOnly }) => {
|
const Authorized: FC<Props> = observer(({ children, hydratedOnly }) => {
|
||||||
const { isUser, fetched } = useAuth();
|
const { isUser, fetched } = useAuth();
|
||||||
|
|
||||||
if (!isUser || (!hydratedOnly && !fetched)) return null;
|
if (!isUser || (!hydratedOnly && !fetched)) return null;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { LoaderCircle } from '~/components/common/LoaderCircle';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
children: ReactChild;
|
children: ReactChild;
|
||||||
header?: JSX.Element;
|
header?: JSX.Element;
|
||||||
footer?: JSX.Element;
|
footer?: JSX.Element;
|
||||||
|
@ -23,7 +23,7 @@ interface IProps {
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BetterScrollDialog: FC<IProps> = ({
|
const BetterScrollDialog: FC<Props> = ({
|
||||||
children,
|
children,
|
||||||
header,
|
header,
|
||||||
footer,
|
footer,
|
||||||
|
|
|
@ -4,9 +4,9 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = AllHTMLAttributes<HTMLDivElement> & { is_blurred: boolean };
|
type Props = AllHTMLAttributes<HTMLDivElement> & { is_blurred: boolean };
|
||||||
|
|
||||||
export const BlurWrapper: FC<IProps> = ({ children, is_blurred }) => (
|
export const BlurWrapper: FC<Props> = ({ children, is_blurred }) => (
|
||||||
<div className={classNames(styles.blur, { [styles.is_blurred]: is_blurred })}>
|
<div className={classNames(styles.blur, { [styles.is_blurred]: is_blurred })}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|
11
src/components/common/BottomContainer/index.tsx
Normal file
11
src/components/common/BottomContainer/index.tsx
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
|
const BottomContainer = ({ children }) => (
|
||||||
|
<div className={styles.wrap}>
|
||||||
|
<div className={styles.content}>
|
||||||
|
<div className={styles.padder}></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
export { BottomContainer };
|
|
@ -4,12 +4,12 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = HTMLAttributes<HTMLDivElement> & {
|
type Props = HTMLAttributes<HTMLDivElement> & {
|
||||||
children: any;
|
children: any;
|
||||||
size: number;
|
size: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
const CellGrid: FC<IProps> = ({ children, size, className, ...props }) => (
|
const CellGrid: FC<Props> = ({ children, size, className, ...props }) => (
|
||||||
<div
|
<div
|
||||||
className={classNames(styles.grid, className)}
|
className={classNames(styles.grid, className)}
|
||||||
style={{ gridTemplateColumns: `repeat(auto-fit, minmax(${size}px, 1fr))` }}
|
style={{ gridTemplateColumns: `repeat(auto-fit, minmax(${size}px, 1fr))` }}
|
||||||
|
|
|
@ -4,11 +4,11 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Container: FC<IProps> = ({ className, children }) => (
|
const Container: FC<Props> = ({ className, children }) => (
|
||||||
<div className={classNames(styles.container, className)}>{children}</div>
|
<div className={classNames(styles.container, className)}>{children}</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,11 +8,11 @@ import { getURL } from '~/utils/dom';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
cover: IUser['cover'];
|
cover: IUser['cover'];
|
||||||
}
|
}
|
||||||
|
|
||||||
const CoverBackdrop: FC<IProps> = ({ cover }) => {
|
const CoverBackdrop: FC<Props> = ({ cover }) => {
|
||||||
const ref = useRef<HTMLImageElement>(null);
|
const ref = useRef<HTMLImageElement>(null);
|
||||||
|
|
||||||
const [is_loaded, setIsLoaded] = useState(false);
|
const [is_loaded, setIsLoaded] = useState(false);
|
||||||
|
|
|
@ -2,11 +2,11 @@ import { FC, ReactNode } from 'react';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DialogTitle: FC<IProps> = ({ children }) => (
|
const DialogTitle: FC<Props> = ({ children }) => (
|
||||||
<h2 className={styles.title}>{children}</h2>
|
<h2 className={styles.title}>{children}</h2>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = HTMLAttributes<HTMLDivElement>;
|
type Props = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
export const Filler: FC<IProps> = ({ className = '', ...props }) => (
|
export const Filler: FC<Props> = ({ className = '', ...props }) => (
|
||||||
<div className={classNames(styles.filler, className)} {...props} />
|
<div className={classNames(styles.filler, className)} {...props} />
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,9 +2,9 @@ import { FC, memo } from 'react';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {}
|
interface Props {}
|
||||||
|
|
||||||
const Footer: FC<IProps> = memo(() => (
|
const Footer: FC<Props> = memo(() => (
|
||||||
<footer className={styles.footer}>
|
<footer className={styles.footer}>
|
||||||
<div className={styles.slogan}>Уделяй больше времени тишине. Спасибо</div>
|
<div className={styles.slogan}>Уделяй больше времени тишине. Спасибо</div>
|
||||||
<div className={styles.copy}>2009 - {new Date().getFullYear()}</div>
|
<div className={styles.copy}>2009 - {new Date().getFullYear()}</div>
|
|
@ -4,7 +4,7 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = HTMLAttributes<HTMLDivElement> & {
|
type Props = HTMLAttributes<HTMLDivElement> & {
|
||||||
horizontal?: boolean;
|
horizontal?: boolean;
|
||||||
vertical?: boolean;
|
vertical?: boolean;
|
||||||
columns?: string;
|
columns?: string;
|
||||||
|
@ -15,7 +15,7 @@ type IProps = HTMLAttributes<HTMLDivElement> & {
|
||||||
stretchy?: boolean;
|
stretchy?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Grid: FC<IProps> = ({
|
const Grid: FC<Props> = ({
|
||||||
children,
|
children,
|
||||||
className = '',
|
className = '',
|
||||||
horizontal = false,
|
horizontal = false,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = HTMLAttributes<HTMLDivElement> & {
|
type Props = HTMLAttributes<HTMLDivElement> & {
|
||||||
horizontal?: boolean;
|
horizontal?: boolean;
|
||||||
top?: boolean;
|
top?: boolean;
|
||||||
bottom?: boolean;
|
bottom?: boolean;
|
||||||
|
@ -12,7 +12,7 @@ type IProps = HTMLAttributes<HTMLDivElement> & {
|
||||||
seamless?: boolean;
|
seamless?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Group: FC<IProps> = ({
|
const Group: FC<Props> = ({
|
||||||
children,
|
children,
|
||||||
className = '',
|
className = '',
|
||||||
horizontal = false,
|
horizontal = false,
|
||||||
|
|
|
@ -2,12 +2,12 @@ import { FC, SVGAttributes } from 'react';
|
||||||
|
|
||||||
import { IIcon } from '~/types';
|
import { IIcon } from '~/types';
|
||||||
|
|
||||||
type IProps = SVGAttributes<SVGElement> & {
|
type Props = SVGAttributes<SVGElement> & {
|
||||||
size?: number;
|
size?: number;
|
||||||
icon: IIcon;
|
icon: IIcon;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Icon: FC<IProps> = ({ size = 20, icon, style, ...props }) => (
|
export const Icon: FC<Props> = ({ size = 20, icon, style, ...props }) => (
|
||||||
<svg
|
<svg
|
||||||
width={size}
|
width={size}
|
||||||
height={size}
|
height={size}
|
||||||
|
|
|
@ -2,13 +2,13 @@ import { FC, HTMLAttributes, useCallback, useEffect, useRef } from 'react';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends HTMLAttributes<HTMLDivElement> {
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
||||||
hasMore: boolean;
|
hasMore: boolean;
|
||||||
scrollReactPx?: number;
|
scrollReactPx?: number;
|
||||||
loadMore: () => void;
|
loadMore: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const InfiniteScroll: FC<IProps> = ({
|
const InfiniteScroll: FC<Props> = ({
|
||||||
children,
|
children,
|
||||||
hasMore,
|
hasMore,
|
||||||
scrollReactPx,
|
scrollReactPx,
|
||||||
|
|
|
@ -6,12 +6,12 @@ import { describeArc } from '~/utils/dom';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends SVGAttributes<SVGElement> {
|
interface Props extends SVGAttributes<SVGElement> {
|
||||||
size: number;
|
size: number;
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LoaderCircleInner: FC<IProps> = ({ size, className, ...props }) => (
|
const LoaderCircleInner: FC<Props> = ({ size, className, ...props }) => (
|
||||||
<svg
|
<svg
|
||||||
className={classNames(styles.icon, className)}
|
className={classNames(styles.icon, className)}
|
||||||
width={size}
|
width={size}
|
||||||
|
|
|
@ -7,12 +7,12 @@ import { SVGProps } from '~/utils/types';
|
||||||
import { LoaderCircleInner } from './components/LoaderCircleInner';
|
import { LoaderCircleInner } from './components/LoaderCircleInner';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends SVGProps {
|
interface Props extends SVGProps {
|
||||||
size?: number;
|
size?: number;
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const LoaderCircle: FC<IProps> = ({ size = 24, className }) => (
|
export const LoaderCircle: FC<Props> = ({ size = 24, className }) => (
|
||||||
<div className={classNames(styles.wrap, 'loader-circle', className)}>
|
<div className={classNames(styles.wrap, 'loader-circle', className)}>
|
||||||
<LoaderCircleInner size={size} />
|
<LoaderCircleInner size={size} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,12 +5,12 @@ import classNames from 'classnames';
|
||||||
import styles from '~/styles/common/markdown.module.scss';
|
import styles from '~/styles/common/markdown.module.scss';
|
||||||
import { formatText } from '~/utils/dom';
|
import { formatText } from '~/utils/dom';
|
||||||
|
|
||||||
interface IProps
|
interface Props
|
||||||
extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
||||||
children?: string;
|
children?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Markdown: VFC<IProps> = ({ className, children = '', ...props }) => (
|
const Markdown: VFC<Props> = ({ className, children = '', ...props }) => (
|
||||||
<div
|
<div
|
||||||
className={classNames(styles.wrapper, className)}
|
className={classNames(styles.wrapper, className)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
@ -4,11 +4,11 @@ import ReactDOM from 'react-dom';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = {
|
type Props = {
|
||||||
onOverlayClick: MouseEventHandler;
|
onOverlayClick: MouseEventHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ModalWrapper: FC<IProps> = ({ children, onOverlayClick }) => {
|
const ModalWrapper: FC<Props> = ({ children, onOverlayClick }) => {
|
||||||
return ReactDOM.createPortal(
|
return ReactDOM.createPortal(
|
||||||
<div className={styles.fixed}>
|
<div className={styles.fixed}>
|
||||||
<div className={styles.overlay} onClick={onOverlayClick} />
|
<div className={styles.overlay} onClick={onOverlayClick} />
|
||||||
|
|
|
@ -4,13 +4,13 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = HTMLAttributes<HTMLDivElement> & {
|
type Props = HTMLAttributes<HTMLDivElement> & {
|
||||||
padding?: number;
|
padding?: number;
|
||||||
vertical?: boolean;
|
vertical?: boolean;
|
||||||
horizontal?: boolean;
|
horizontal?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Padder: FC<IProps> = ({
|
const Padder: FC<Props> = ({
|
||||||
padding,
|
padding,
|
||||||
children,
|
children,
|
||||||
className,
|
className,
|
||||||
|
|
|
@ -4,12 +4,12 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = HTMLAttributes<HTMLDivElement> & {
|
type Props = HTMLAttributes<HTMLDivElement> & {
|
||||||
seamless?: boolean;
|
seamless?: boolean;
|
||||||
stretchy?: boolean;
|
stretchy?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Panel: FC<IProps> = ({
|
const Panel: FC<Props> = ({
|
||||||
className,
|
className,
|
||||||
children,
|
children,
|
||||||
seamless,
|
seamless,
|
||||||
|
|
|
@ -2,11 +2,11 @@ import { DetailsHTMLAttributes, FC } from 'react';
|
||||||
|
|
||||||
import StickyBox from 'react-sticky-box';
|
import StickyBox from 'react-sticky-box';
|
||||||
|
|
||||||
interface IProps extends DetailsHTMLAttributes<HTMLDivElement> {
|
interface Props extends DetailsHTMLAttributes<HTMLDivElement> {
|
||||||
offsetTop?: number;
|
offsetTop?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Sticky: FC<IProps> = ({ children, offsetTop = 65 }) => (
|
const Sticky: FC<Props> = ({ children, offsetTop = 65 }) => (
|
||||||
<StickyBox offsetTop={offsetTop} offsetBottom={10}>
|
<StickyBox offsetTop={offsetTop} offsetBottom={10}>
|
||||||
{children}
|
{children}
|
||||||
</StickyBox>
|
</StickyBox>
|
||||||
|
|
|
@ -4,9 +4,9 @@ import { observer } from 'mobx-react-lite';
|
||||||
|
|
||||||
import { useAuth } from '~/hooks/auth/useAuth';
|
import { useAuth } from '~/hooks/auth/useAuth';
|
||||||
|
|
||||||
interface IProps {}
|
interface Props {}
|
||||||
|
|
||||||
const Superpower: FC<IProps> = observer(({ children }) => {
|
const Superpower: FC<Props> = observer(({ children }) => {
|
||||||
const { isTester } = useAuth();
|
const { isTester } = useAuth();
|
||||||
|
|
||||||
if (!isTester) return null;
|
if (!isTester) return null;
|
||||||
|
|
|
@ -2,9 +2,9 @@ import { FC, HTMLAttributes } from 'react';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = HTMLAttributes<HTMLDivElement> & {};
|
type Props = HTMLAttributes<HTMLDivElement> & {};
|
||||||
|
|
||||||
const TagField: FC<IProps> = ({ children }) => (
|
const TagField: FC<Props> = ({ children }) => (
|
||||||
<div className={styles.wrap}>{children}</div>
|
<div className={styles.wrap}>{children}</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ import classNames from 'classnames';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = HTMLAttributes<HTMLDivElement> & {};
|
type Props = HTMLAttributes<HTMLDivElement> & {};
|
||||||
|
|
||||||
export const ButtonGroup = ({ children, className }: IProps) => (
|
export const ButtonGroup = ({ children, className }: Props) => (
|
||||||
<div className={classNames(styles.wrap, className)}>{children}</div>
|
<div className={classNames(styles.wrap, className)}>{children}</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { useForwardRef } from '~/hooks/dom/useForwardRef';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = DetailedHTMLProps<
|
type Props = DetailedHTMLProps<
|
||||||
TextareaHTMLAttributes<HTMLTextAreaElement>,
|
TextareaHTMLAttributes<HTMLTextAreaElement>,
|
||||||
HTMLTextAreaElement
|
HTMLTextAreaElement
|
||||||
> & {
|
> & {
|
||||||
|
@ -29,7 +29,7 @@ type IProps = DetailedHTMLProps<
|
||||||
title?: string;
|
title?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Textarea = forwardRef<HTMLTextAreaElement, IProps>(
|
const Textarea = forwardRef<HTMLTextAreaElement, Props>(
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
placeholder,
|
placeholder,
|
||||||
|
|
|
@ -8,13 +8,13 @@ import styles from './styles.module.scss';
|
||||||
|
|
||||||
type ToggleColor = 'primary' | 'secondary' | 'lab' | 'danger' | 'white';
|
type ToggleColor = 'primary' | 'secondary' | 'lab' | 'danger' | 'white';
|
||||||
|
|
||||||
type IProps = Omit<ButtonProps, 'value' | 'color'> & {
|
type Props = Omit<ButtonProps, 'value' | 'color'> & {
|
||||||
value?: boolean;
|
value?: boolean;
|
||||||
handler?: (val: boolean) => void;
|
handler?: (val: boolean) => void;
|
||||||
color?: ToggleColor;
|
color?: ToggleColor;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Toggle: FC<IProps> = ({ value, handler, color = 'primary', ...rest }) => {
|
const Toggle: FC<Props> = ({ value, handler, color = 'primary', ...rest }) => {
|
||||||
const onClick = useCallback(() => {
|
const onClick = useCallback(() => {
|
||||||
if (!handler) {
|
if (!handler) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -5,12 +5,12 @@ import { IComment } from '~/types';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
id: IComment['id'];
|
id: IComment['id'];
|
||||||
onDelete: (id: IComment['id'], isLocked: boolean) => void;
|
onDelete: (id: IComment['id'], isLocked: boolean) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CommendDeleted: FC<IProps> = ({ id, onDelete }) => {
|
const CommendDeleted: FC<Props> = ({ id, onDelete }) => {
|
||||||
const onRestore = useCallback(() => onDelete(id, false), [id, onDelete]);
|
const onRestore = useCallback(() => onDelete(id, false), [id, onDelete]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { useNodeAudios } from '~/hooks/node/useNodeAudios';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends NodeComponentProps {}
|
interface Props extends NodeComponentProps {}
|
||||||
|
|
||||||
const NodeAudioBlock: FC<IProps> = ({ node }) => {
|
const NodeAudioBlock: FC<Props> = ({ node }) => {
|
||||||
const audios = useNodeAudios(node);
|
const audios = useNodeAudios(node);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -8,9 +8,9 @@ import { path } from '~/utils/ramda';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends NodeComponentProps {}
|
interface Props extends NodeComponentProps {}
|
||||||
|
|
||||||
const NodeAudioImageBlock: FC<IProps> = ({ node }) => {
|
const NodeAudioImageBlock: FC<Props> = ({ node }) => {
|
||||||
const images = useNodeImages(node);
|
const images = useNodeImages(node);
|
||||||
|
|
||||||
if (images.length === 0) return null;
|
if (images.length === 0) return null;
|
||||||
|
|
|
@ -2,9 +2,9 @@ import { FC } from 'react';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {}
|
interface Props {}
|
||||||
|
|
||||||
const NodeDeletedBadge: FC<IProps> = () => {
|
const NodeDeletedBadge: FC<Props> = () => {
|
||||||
return (
|
return (
|
||||||
<div className={styles.badge}>
|
<div className={styles.badge}>
|
||||||
Эта ячейка заблокирована. Её не никто не увидит.
|
Эта ячейка заблокирована. Её не никто не увидит.
|
||||||
|
|
|
@ -22,9 +22,9 @@ import { getNodeSwiperImageSizes } from './helpers';
|
||||||
import { NODE_SWIPER_OPTIONS } from './options';
|
import { NODE_SWIPER_OPTIONS } from './options';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends NodeComponentProps {}
|
interface Props extends NodeComponentProps {}
|
||||||
|
|
||||||
const NodeImageSwiperBlock: FC<IProps> = observer(({ node }) => {
|
const NodeImageSwiperBlock: FC<Props> = observer(({ node }) => {
|
||||||
const [controlledSwiper, setControlledSwiper] = useState<SwiperClass>();
|
const [controlledSwiper, setControlledSwiper] = useState<SwiperClass>();
|
||||||
const showPhotoSwiper = useImageModal();
|
const showPhotoSwiper = useImageModal();
|
||||||
const { isOpened: isModalActive } = useModal();
|
const { isOpened: isModalActive } = useModal();
|
||||||
|
|
|
@ -8,12 +8,12 @@ import { t } from '~/utils/trans';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
count?: number;
|
count?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const NodeNoComments: FC<IProps> = ({ loading = false, count = 3 }) => {
|
const NodeNoComments: FC<Props> = ({ loading = false, count = 3 }) => {
|
||||||
const items = useMemo(
|
const items = useMemo(
|
||||||
() =>
|
() =>
|
||||||
[...new Array(count)].map((_, i) => (
|
[...new Array(count)].map((_, i) => (
|
||||||
|
|
|
@ -8,12 +8,12 @@ import { INode } from '~/types';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
title: ReactElement | string;
|
title: ReactElement | string;
|
||||||
items: Partial<INode>[];
|
items: Partial<INode>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const NodeRelated: FC<IProps> = ({ title, items }) => {
|
const NodeRelated: FC<Props> = ({ title, items }) => {
|
||||||
return (
|
return (
|
||||||
<Group className={styles.wrap}>
|
<Group className={styles.wrap}>
|
||||||
<SubTitle className={styles.title}>{title}</SubTitle>
|
<SubTitle className={styles.title}>{title}</SubTitle>
|
||||||
|
|
|
@ -9,9 +9,9 @@ import { range } from '~/utils/ramda';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {}
|
interface Props {}
|
||||||
|
|
||||||
const NodeRelatedPlaceholder: FC<IProps> = memo(() => {
|
const NodeRelatedPlaceholder: FC<Props> = memo(() => {
|
||||||
return (
|
return (
|
||||||
<Group className={classNames(styles.wrap, styles.placeholder)}>
|
<Group className={classNames(styles.wrap, styles.placeholder)}>
|
||||||
<div className={styles.title}>
|
<div className={styles.title}>
|
||||||
|
|
|
@ -7,13 +7,13 @@ import { useTagSidebar } from '~/hooks/sidebar/useTagSidebar';
|
||||||
import { INode } from '~/types';
|
import { INode } from '~/types';
|
||||||
import { INodeRelated } from '~/types/node';
|
import { INodeRelated } from '~/types/node';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
node: INode;
|
node: INode;
|
||||||
related: INodeRelated;
|
related: INodeRelated;
|
||||||
}
|
}
|
||||||
|
|
||||||
const NodeRelatedBlock: FC<IProps> = ({ isLoading, node, related }) => {
|
const NodeRelatedBlock: FC<Props> = ({ isLoading, node, related }) => {
|
||||||
const goToTag = useTagSidebar();
|
const goToTag = useTagSidebar();
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { FC, memo } from 'react';
|
||||||
import { Tags } from '~/containers/tags/Tags';
|
import { Tags } from '~/containers/tags/Tags';
|
||||||
import { ITag } from '~/types';
|
import { ITag } from '~/types';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
is_deletable?: boolean;
|
is_deletable?: boolean;
|
||||||
is_editable?: boolean;
|
is_editable?: boolean;
|
||||||
tags: ITag[];
|
tags: ITag[];
|
||||||
|
@ -12,7 +12,7 @@ interface IProps {
|
||||||
onTagDelete?: (id: ITag['ID']) => void;
|
onTagDelete?: (id: ITag['ID']) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const NodeTags: FC<IProps> = memo(
|
const NodeTags: FC<Props> = memo(
|
||||||
({ is_editable, is_deletable, tags, onChange, onTagClick, onTagDelete }) => {
|
({ is_editable, is_deletable, tags, onChange, onTagClick, onTagDelete }) => {
|
||||||
return (
|
return (
|
||||||
<Tags
|
<Tags
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { FC } from 'react';
|
||||||
import { NodeTags } from '~/components/node/NodeTags';
|
import { NodeTags } from '~/components/node/NodeTags';
|
||||||
import { useTagContext } from '~/utils/context/TagsContextProvider';
|
import { useTagContext } from '~/utils/context/TagsContextProvider';
|
||||||
|
|
||||||
interface IProps {}
|
interface Props {}
|
||||||
|
|
||||||
const NodeTagsBlock: FC<IProps> = () => {
|
const NodeTagsBlock: FC<Props> = () => {
|
||||||
const {
|
const {
|
||||||
tags,
|
tags,
|
||||||
canAppend,
|
canAppend,
|
||||||
|
|
|
@ -3,13 +3,13 @@ import { FC, memo } from 'react';
|
||||||
import { Tags } from '~/containers/tags/Tags';
|
import { Tags } from '~/containers/tags/Tags';
|
||||||
import { ITag } from '~/types';
|
import { ITag } from '~/types';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
is_editable?: boolean;
|
is_editable?: boolean;
|
||||||
tags: ITag[];
|
tags: ITag[];
|
||||||
onChange?: (tags: string[]) => void;
|
onChange?: (tags: string[]) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const NodeTagsPlaceholder: FC<IProps> = memo(
|
const NodeTagsPlaceholder: FC<Props> = memo(
|
||||||
({ is_editable, tags, onChange }) => (
|
({ is_editable, tags, onChange }) => (
|
||||||
<Tags tags={tags} editable={is_editable} onTagsChange={onChange} />
|
<Tags tags={tags} editable={is_editable} onTagsChange={onChange} />
|
||||||
),
|
),
|
||||||
|
|
|
@ -10,9 +10,9 @@ import { path } from '~/utils/ramda';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends NodeComponentProps {}
|
interface Props extends NodeComponentProps {}
|
||||||
|
|
||||||
const NodeTextBlock: FC<IProps> = ({ node }) => {
|
const NodeTextBlock: FC<Props> = ({ node }) => {
|
||||||
const content = useMemo(
|
const content = useMemo(
|
||||||
() => formatTextParagraphs(path(['blocks', 0, 'text'], node) || ''),
|
() => formatTextParagraphs(path(['blocks', 0, 'text'], node) || ''),
|
||||||
[node],
|
[node],
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { NodeLikeButton } from '../NodeLikeButton';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
id?: number;
|
id?: number;
|
||||||
title: string;
|
title: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
|
@ -34,7 +34,7 @@ interface IProps {
|
||||||
onEdit: () => void;
|
onEdit: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const NodeTitle: VFC<IProps> = memo(
|
const NodeTitle: VFC<Props> = memo(
|
||||||
({
|
({
|
||||||
title,
|
title,
|
||||||
username,
|
username,
|
||||||
|
|
|
@ -5,9 +5,9 @@ import { path } from '~/utils/ramda';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends NodeComponentProps {}
|
interface Props extends NodeComponentProps {}
|
||||||
|
|
||||||
const NodeVideoBlock: FC<IProps> = ({ node }) => {
|
const NodeVideoBlock: FC<Props> = ({ node }) => {
|
||||||
const video = useMemo(() => {
|
const video = useMemo(() => {
|
||||||
const url: string = path(['blocks', 0, 'url'], node) || '';
|
const url: string = path(['blocks', 0, 'url'], node) || '';
|
||||||
const match =
|
const match =
|
||||||
|
|
|
@ -6,12 +6,12 @@ import { ERROR_LITERAL } from '~/constants/errors';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ProfileAccountsError: FC<IProps> = ({ onClose, error }) => (
|
const ProfileAccountsError: FC<Props> = ({ onClose, error }) => (
|
||||||
<div className={styles.wrap}>
|
<div className={styles.wrap}>
|
||||||
<Group className={styles.content}>
|
<Group className={styles.content}>
|
||||||
<div className={styles.title}>О НЕТ!</div>
|
<div className={styles.title}>О НЕТ!</div>
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {}
|
interface Props {}
|
||||||
|
|
||||||
const Form = ({ children, className }) => {
|
const Form = ({ children, className }) => {
|
||||||
const { handleSubmit } = useSettings();
|
const { handleSubmit } = useSettings();
|
||||||
|
@ -24,7 +24,7 @@ const Form = ({ children, className }) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ProfileSidebarSettings: FC<IProps> = () => {
|
const ProfileSidebarSettings: FC<Props> = () => {
|
||||||
const { closeAllTabs } = useStackContext();
|
const { closeAllTabs } = useStackContext();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -6,13 +6,13 @@ import { useCloseOnEscape } from '~/hooks';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
closeOnBackdropClick?: boolean;
|
closeOnBackdropClick?: boolean;
|
||||||
backdrop?: ReactNode;
|
backdrop?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SidebarWrapper: FC<IProps> = ({
|
const SidebarWrapper: FC<Props> = ({
|
||||||
children,
|
children,
|
||||||
onClose,
|
onClose,
|
||||||
closeOnBackdropClick = true,
|
closeOnBackdropClick = true,
|
||||||
|
|
|
@ -5,11 +5,11 @@ import { INode } from '~/types';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
nodes: INode[];
|
nodes: INode[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const TagSidebarList: FC<IProps> = ({ nodes }) => (
|
const TagSidebarList: FC<Props> = ({ nodes }) => (
|
||||||
<div className={styles.list}>
|
<div className={styles.list}>
|
||||||
{nodes.map((node) => (
|
{nodes.map((node) => (
|
||||||
<NodeHorizontalCard node={node} key={node.id} />
|
<NodeHorizontalCard node={node} key={node.id} />
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { FC, FocusEventHandler, useCallback } from 'react';
|
||||||
import { TagWrapper } from '~/components/tags/TagWrapper';
|
import { TagWrapper } from '~/components/tags/TagWrapper';
|
||||||
import { ITag } from '~/types';
|
import { ITag } from '~/types';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
tag: Partial<ITag>;
|
tag: Partial<ITag>;
|
||||||
size?: 'normal' | 'big';
|
size?: 'normal' | 'big';
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ interface IProps {
|
||||||
onDelete?: (id: ITag['ID']) => void;
|
onDelete?: (id: ITag['ID']) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Tag: FC<IProps> = ({
|
const Tag: FC<Props> = ({
|
||||||
tag,
|
tag,
|
||||||
deletable: deletable,
|
deletable: deletable,
|
||||||
hoverable: hoverable,
|
hoverable: hoverable,
|
||||||
|
|
|
@ -6,19 +6,14 @@ import { Icon } from '~/components/common/Icon';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
selected: boolean;
|
selected: boolean;
|
||||||
title: string;
|
title: string;
|
||||||
type: 'enter' | 'right' | 'tag';
|
type: 'enter' | 'right' | 'tag';
|
||||||
onSelect: (val: string) => void;
|
onSelect: (val: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TagAutocompleteRow: FC<IProps> = ({
|
const TagAutocompleteRow: FC<Props> = ({ selected, type, title, onSelect }) => {
|
||||||
selected,
|
|
||||||
type,
|
|
||||||
title,
|
|
||||||
onSelect,
|
|
||||||
}) => {
|
|
||||||
const onClick = useCallback(() => onSelect(title), [title, onSelect]);
|
const onClick = useCallback(() => onSelect(title), [title, onSelect]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { Icon } from '~/components/common/Icon';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
className?: string;
|
className?: string;
|
||||||
size?: string;
|
size?: string;
|
||||||
color?: 'primary' | 'danger' | 'info' | 'black' | 'default';
|
color?: 'primary' | 'danger' | 'info' | 'black' | 'default';
|
||||||
|
@ -18,7 +18,7 @@ interface IProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TagWrapper: FC<IProps> = ({
|
const TagWrapper: FC<Props> = ({
|
||||||
className,
|
className,
|
||||||
color = 'default',
|
color = 'default',
|
||||||
children,
|
children,
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { Icon } from '~/components/common/Icon';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
id?: string;
|
id?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
progress?: number;
|
progress?: number;
|
||||||
|
@ -16,13 +16,7 @@ interface IProps {
|
||||||
uploading?: boolean;
|
uploading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AudioUpload: FC<IProps> = ({
|
const AudioUpload: FC<Props> = ({ title, progress, uploading, id, onDrop }) => {
|
||||||
title,
|
|
||||||
progress,
|
|
||||||
uploading,
|
|
||||||
id,
|
|
||||||
onDrop,
|
|
||||||
}) => {
|
|
||||||
const onDropFile = useCallback(() => {
|
const onDropFile = useCallback(() => {
|
||||||
if (!id || !onDrop) return;
|
if (!id || !onDrop) return;
|
||||||
onDrop(id);
|
onDrop(id);
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { IFile } from '~/types';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
id?: IFile['id'];
|
id?: IFile['id'];
|
||||||
thumb?: string;
|
thumb?: string;
|
||||||
progress?: number;
|
progress?: number;
|
||||||
|
@ -17,13 +17,7 @@ interface IProps {
|
||||||
uploading?: boolean;
|
uploading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ImageUpload: FC<IProps> = ({
|
const ImageUpload: FC<Props> = ({ thumb, progress, uploading, id, onDrop }) => {
|
||||||
thumb,
|
|
||||||
progress,
|
|
||||||
uploading,
|
|
||||||
id,
|
|
||||||
onDrop,
|
|
||||||
}) => {
|
|
||||||
const onDropFile = useCallback(() => {
|
const onDropFile = useCallback(() => {
|
||||||
if (!id || !onDrop) return;
|
if (!id || !onDrop) return;
|
||||||
onDrop(id);
|
onDrop(id);
|
||||||
|
|
|
@ -10,12 +10,12 @@ import { DivProps } from '~/utils/types';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends DivProps {
|
interface Props extends DivProps {
|
||||||
onUpload: (files: File[]) => void;
|
onUpload: (files: File[]) => void;
|
||||||
helperClassName?: string;
|
helperClassName?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const UploadDropzone: FC<IProps> = ({
|
const UploadDropzone: FC<Props> = ({
|
||||||
children,
|
children,
|
||||||
onUpload,
|
onUpload,
|
||||||
helperClassName,
|
helperClassName,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { Container } from '~/containers/main/Container';
|
import { Container } from '~/components/common/Container';
|
||||||
import markdown from '~/styles/common/markdown.module.scss';
|
import markdown from '~/styles/common/markdown.module.scss';
|
||||||
|
|
||||||
import { WelcomeSlideWrapper } from '../WelcomeSlideWrapper';
|
import { WelcomeSlideWrapper } from '../WelcomeSlideWrapper';
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { FC } from 'react';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import { Container } from '~/components/common/Container';
|
||||||
import { Filler } from '~/components/common/Filler';
|
import { Filler } from '~/components/common/Filler';
|
||||||
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';
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,11 @@ import { OAuthProvider } from '~/types/auth';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
openOauthWindow: (provider: OAuthProvider) => void;
|
openOauthWindow: (provider: OAuthProvider) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LoginDialogButtons: FC<IProps> = ({ openOauthWindow }) => (
|
const LoginDialogButtons: FC<Props> = ({ openOauthWindow }) => (
|
||||||
<Group className={styles.footer}>
|
<Group className={styles.footer}>
|
||||||
<Button>Войти</Button>
|
<Button>Войти</Button>
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ import { Button } from '~/components/input/Button';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {}
|
interface Props {}
|
||||||
|
|
||||||
const LoginSocialRegisterButtons: FC<IProps> = () => (
|
const LoginSocialRegisterButtons: FC<Props> = () => (
|
||||||
<div className={styles.wrap}>
|
<div className={styles.wrap}>
|
||||||
<Button>Впустите меня!</Button>
|
<Button>Впустите меня!</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,12 +4,12 @@ import { Toggle } from '~/components/input/Toggle';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
onChange?: (val: boolean) => void;
|
onChange?: (val: boolean) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BorisSuperpowers: FC<IProps> = ({ active, onChange }) => {
|
const BorisSuperpowers: FC<Props> = ({ active, onChange }) => {
|
||||||
const onToggle = useCallback(() => {
|
const onToggle = useCallback(() => {
|
||||||
if (!onChange) {
|
if (!onChange) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
|
|
||||||
|
import { Footer } from '~/components/common/Footer';
|
||||||
import { Group } from '~/components/common/Group';
|
import { Group } from '~/components/common/Group';
|
||||||
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';
|
||||||
import { NodeComments } from '~/containers/node/NodeComments';
|
import { NodeComments } from '~/containers/node/NodeComments';
|
||||||
|
|
|
@ -9,12 +9,12 @@ import { BorisGraphicStats } from '../BorisGraphicStats';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
stats: StatBackend;
|
stats: StatBackend;
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BorisStatsBackend: FC<IProps> = ({ isLoading, stats }) => {
|
const BorisStatsBackend: FC<Props> = ({ isLoading, stats }) => {
|
||||||
const commentsByMonth = useMemo(
|
const commentsByMonth = useMemo(
|
||||||
() => stats.comments.by_month?.slice(0, -1),
|
() => stats.comments.by_month?.slice(0, -1),
|
||||||
[stats.comments.by_month],
|
[stats.comments.by_month],
|
||||||
|
|
|
@ -7,12 +7,12 @@ import { BorisStatsGitCard } from '../BorisStatsGitCard';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
issues: GithubIssue[];
|
issues: GithubIssue[];
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BorisStatsGit: FC<IProps> = ({ issues, isLoading }) => {
|
const BorisStatsGit: FC<Props> = ({ issues, isLoading }) => {
|
||||||
const open = useMemo(
|
const open = useMemo(
|
||||||
() =>
|
() =>
|
||||||
issues
|
issues
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { getPrettyDate } from '~/utils/dom';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
data: GithubIssue;
|
data: GithubIssue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ const stateLabels: Record<GithubIssue['state'], string> = {
|
||||||
closed: 'Сделано',
|
closed: 'Сделано',
|
||||||
};
|
};
|
||||||
|
|
||||||
const BorisStatsGitCard: FC<IProps> = ({
|
const BorisStatsGitCard: FC<Props> = ({
|
||||||
data: { created_at, title, html_url, state },
|
data: { created_at, title, html_url, state },
|
||||||
}) => {
|
}) => {
|
||||||
const date = useMemo(() => getPrettyDate(created_at), [created_at]);
|
const date = useMemo(() => getPrettyDate(created_at), [created_at]);
|
||||||
|
|
|
@ -5,12 +5,12 @@ import { BorisUsageStats } from '~/types/boris';
|
||||||
import { BorisStatsBackend } from './components/BorisStatsBackend';
|
import { BorisStatsBackend } from './components/BorisStatsBackend';
|
||||||
import { BorisStatsGit } from './components/BorisStatsGit';
|
import { BorisStatsGit } from './components/BorisStatsGit';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
stats: BorisUsageStats;
|
stats: BorisUsageStats;
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BorisStats: FC<IProps> = ({ stats, isLoading }) => {
|
const BorisStats: FC<Props> = ({ stats, isLoading }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BorisStatsBackend stats={stats.backend} isLoading={isLoading} />
|
<BorisStatsBackend stats={stats.backend} isLoading={isLoading} />
|
||||||
|
|
|
@ -4,11 +4,11 @@ import { Button } from '~/components/input/Button';
|
||||||
import { ButtonGroup } from '~/components/input/ButtonGroup';
|
import { ButtonGroup } from '~/components/input/ButtonGroup';
|
||||||
import { COMMENT_FILE_TYPES } from '~/constants/uploads';
|
import { COMMENT_FILE_TYPES } from '~/constants/uploads';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
onUpload: (files: File[]) => void;
|
onUpload: (files: File[]) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CommentFormAttachButtons: FC<IProps> = ({ onUpload }) => {
|
const CommentFormAttachButtons: FC<Props> = ({ onUpload }) => {
|
||||||
const onInputChange = useCallback(
|
const onInputChange = useCallback(
|
||||||
(event) => {
|
(event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
|
@ -9,12 +9,12 @@ import {
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
element: HTMLTextAreaElement;
|
element: HTMLTextAreaElement;
|
||||||
handler: (val: string) => void;
|
handler: (val: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CommentFormFormatButtons: FC<IProps> = ({ element, handler }) => {
|
const CommentFormFormatButtons: FC<Props> = ({ element, handler }) => {
|
||||||
const wrapper = useFormatWrapper(handler);
|
const wrapper = useFormatWrapper(handler);
|
||||||
|
|
||||||
const wrap = useCallback(
|
const wrap = useCallback(
|
||||||
|
|
|
@ -9,11 +9,11 @@ import { Textarea } from '~/components/input/Textarea';
|
||||||
import { useRandomPhrase } from '~/constants/phrases';
|
import { useRandomPhrase } from '~/constants/phrases';
|
||||||
import { useCommentFormContext } from '~/hooks/comments/useCommentFormFormik';
|
import { useCommentFormContext } from '~/hooks/comments/useCommentFormFormik';
|
||||||
|
|
||||||
interface IProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
interface Props extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CommentFormTextarea = forwardRef<HTMLTextAreaElement, IProps>(
|
const CommentFormTextarea = forwardRef<HTMLTextAreaElement, Props>(
|
||||||
({ ...rest }, ref) => {
|
({ ...rest }, ref) => {
|
||||||
const { values, handleChange, handleSubmit, isSubmitting } =
|
const { values, handleChange, handleSubmit, isSubmitting } =
|
||||||
useCommentFormContext();
|
useCommentFormContext();
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { CommentFormFormatButtons } from './components/CommentFormFormatButtons'
|
||||||
import { CommentFormTextarea } from './components/CommentFormTextarea';
|
import { CommentFormTextarea } from './components/CommentFormTextarea';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
comment?: IComment;
|
comment?: IComment;
|
||||||
allowUploads?: boolean;
|
allowUploads?: boolean;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ interface IProps {
|
||||||
onCancelEdit?: () => void;
|
onCancelEdit?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CommentForm: FC<IProps> = observer(
|
const CommentForm: FC<Props> = observer(
|
||||||
({ comment, allowUploads, saveComment, onCancelEdit }) => {
|
({ comment, allowUploads, saveComment, onCancelEdit }) => {
|
||||||
const [textarea, setTextArea] = useState<HTMLTextAreaElement | null>(null);
|
const [textarea, setTextArea] = useState<HTMLTextAreaElement | null>(null);
|
||||||
const uploader = useUploaderContext();
|
const uploader = useUploaderContext();
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { DivProps } from '~/utils/types';
|
||||||
import { CommentAvatar } from './components/CommentAvatar';
|
import { CommentAvatar } from './components/CommentAvatar';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = DivProps & {
|
type Props = DivProps & {
|
||||||
user?: IUser;
|
user?: IUser;
|
||||||
isEmpty?: boolean;
|
isEmpty?: boolean;
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
|
@ -17,7 +17,7 @@ type IProps = DivProps & {
|
||||||
isNew?: boolean;
|
isNew?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const CommentWrapper: FC<IProps> = ({
|
const CommentWrapper: FC<Props> = ({
|
||||||
user,
|
user,
|
||||||
className,
|
className,
|
||||||
isEmpty,
|
isEmpty,
|
||||||
|
|
|
@ -4,13 +4,13 @@ import { SortableAudioGrid } from '~/components/sortable/SortableAudioGrid';
|
||||||
import { UploadStatus } from '~/store/uploader/UploaderStore';
|
import { UploadStatus } from '~/store/uploader/UploaderStore';
|
||||||
import { IFile } from '~/types';
|
import { IFile } from '~/types';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
files: IFile[];
|
files: IFile[];
|
||||||
setFiles: (val: IFile[]) => void;
|
setFiles: (val: IFile[]) => void;
|
||||||
locked: UploadStatus[];
|
locked: UploadStatus[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const AudioGrid: FC<IProps> = ({ files, setFiles, locked }) => {
|
const AudioGrid: FC<Props> = ({ files, setFiles, locked }) => {
|
||||||
const onMove = useCallback(
|
const onMove = useCallback(
|
||||||
(newFiles: IFile[]) => {
|
(newFiles: IFile[]) => {
|
||||||
setFiles(newFiles);
|
setFiles(newFiles);
|
||||||
|
|
|
@ -4,9 +4,9 @@ import { UploadType } from '~/constants/uploads';
|
||||||
import { EditorUploadButton } from '~/containers/dialogs/EditorDialog/components/EditorButtons/components/EditorActionsPanel/components/EditorUploadButton';
|
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 Props = IEditorComponentProps & {};
|
||||||
|
|
||||||
const EditorAudioUploadButton: FC<IProps> = () => (
|
const EditorAudioUploadButton: FC<Props> = () => (
|
||||||
<EditorUploadButton
|
<EditorUploadButton
|
||||||
accept="audio/*"
|
accept="audio/*"
|
||||||
icon="audio"
|
icon="audio"
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { IEditorComponentProps } from '~/types/node';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = IEditorComponentProps & {};
|
type Props = IEditorComponentProps & {};
|
||||||
|
|
||||||
const EditorFiller: FC<IProps> = () => <Filler className={styles.filler} />;
|
const EditorFiller: FC<Props> = () => <Filler className={styles.filler} />;
|
||||||
|
|
||||||
export { EditorFiller };
|
export { EditorFiller };
|
||||||
|
|
|
@ -5,9 +5,9 @@ import { IEditorComponentProps } from '~/types/node';
|
||||||
|
|
||||||
import { EditorUploadButton } from '../EditorUploadButton';
|
import { EditorUploadButton } from '../EditorUploadButton';
|
||||||
|
|
||||||
type IProps = IEditorComponentProps & {};
|
type Props = IEditorComponentProps & {};
|
||||||
|
|
||||||
const EditorImageUploadButton: FC<IProps> = () => (
|
const EditorImageUploadButton: FC<Props> = () => (
|
||||||
<EditorUploadButton
|
<EditorUploadButton
|
||||||
accept="image/*"
|
accept="image/*"
|
||||||
icon="image"
|
icon="image"
|
||||||
|
|
|
@ -7,9 +7,9 @@ import { IEditorComponentProps } from '~/types/node';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends IEditorComponentProps {}
|
interface Props extends IEditorComponentProps {}
|
||||||
|
|
||||||
const EditorPublicSwitch: FC<IProps> = () => {
|
const EditorPublicSwitch: FC<Props> = () => {
|
||||||
const { values, setFieldValue } = useNodeFormContext();
|
const { values, setFieldValue } = useNodeFormContext();
|
||||||
|
|
||||||
const onChange = useCallback(
|
const onChange = useCallback(
|
||||||
|
|
|
@ -10,14 +10,14 @@ import { getFileType } from '~/utils/uploader';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = IEditorComponentProps & {
|
type Props = IEditorComponentProps & {
|
||||||
accept?: string;
|
accept?: string;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
type?: UploadType;
|
type?: UploadType;
|
||||||
label?: string;
|
label?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const EditorUploadButton: FC<IProps> = ({
|
const EditorUploadButton: FC<Props> = ({
|
||||||
accept = 'image/*',
|
accept = 'image/*',
|
||||||
icon = 'plus',
|
icon = 'plus',
|
||||||
type = UploadType.Image,
|
type = UploadType.Image,
|
||||||
|
|
|
@ -11,9 +11,9 @@ import { getFileType } from '~/utils/uploader';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = IEditorComponentProps & {};
|
type Props = IEditorComponentProps & {};
|
||||||
|
|
||||||
const EditorUploadCoverButton: FC<IProps> = () => {
|
const EditorUploadCoverButton: FC<Props> = () => {
|
||||||
const { values, setFieldValue } = useNodeFormContext();
|
const { values, setFieldValue } = useNodeFormContext();
|
||||||
const { uploadFile, files, pendingImages } = useUploader(
|
const { uploadFile, files, pendingImages } = useUploader(
|
||||||
UploadSubject.Editor,
|
UploadSubject.Editor,
|
||||||
|
|
|
@ -5,12 +5,12 @@ import { Button } from '~/components/input/Button';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
onApprove: () => void;
|
onApprove: () => void;
|
||||||
onDecline: () => void;
|
onDecline: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EditorConfirmClose: FC<IProps> = ({ onApprove, onDecline }) => (
|
const EditorConfirmClose: FC<Props> = ({ onApprove, onDecline }) => (
|
||||||
<div className={styles.wrap}>
|
<div className={styles.wrap}>
|
||||||
<Group className={styles.content}>
|
<Group className={styles.content}>
|
||||||
<div className={styles.title}>Точно закрыть?</div>
|
<div className={styles.title}>Точно закрыть?</div>
|
||||||
|
|
|
@ -9,9 +9,9 @@ import { ImageGrid } from '../ImageGrid';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = NodeEditorProps;
|
type Props = NodeEditorProps;
|
||||||
|
|
||||||
const ImageEditor: FC<IProps> = () => {
|
const ImageEditor: FC<Props> = () => {
|
||||||
const { pending, files, setFiles, uploadFiles } = useUploaderContext()!;
|
const { pending, files, setFiles, uploadFiles } = useUploaderContext()!;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -5,13 +5,13 @@ import { useWindowSize } from '~/hooks/dom/useWindowSize';
|
||||||
import { UploadStatus } from '~/store/uploader/UploaderStore';
|
import { UploadStatus } from '~/store/uploader/UploaderStore';
|
||||||
import { IFile } from '~/types';
|
import { IFile } from '~/types';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
files: IFile[];
|
files: IFile[];
|
||||||
setFiles: (val: IFile[]) => void;
|
setFiles: (val: IFile[]) => void;
|
||||||
locked: UploadStatus[];
|
locked: UploadStatus[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const ImageGrid: FC<IProps> = ({ files, setFiles, locked }) => {
|
const ImageGrid: FC<Props> = ({ files, setFiles, locked }) => {
|
||||||
const { isTablet } = useWindowSize();
|
const { isTablet } = useWindowSize();
|
||||||
|
|
||||||
const onMove = useCallback(
|
const onMove = useCallback(
|
||||||
|
|
|
@ -8,9 +8,9 @@ import { path } from '~/utils/ramda';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = NodeEditorProps & {};
|
type Props = NodeEditorProps & {};
|
||||||
|
|
||||||
const TextEditor: FC<IProps> = () => {
|
const TextEditor: FC<Props> = () => {
|
||||||
const { values, setFieldValue } = useNodeFormContext();
|
const { values, setFieldValue } = useNodeFormContext();
|
||||||
const placeholder = useRandomPhrase('SIMPLE');
|
const placeholder = useRandomPhrase('SIMPLE');
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,9 @@ import { path } from '~/utils/ramda';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
type IProps = NodeEditorProps & {};
|
type Props = NodeEditorProps & {};
|
||||||
|
|
||||||
const VideoEditor: FC<IProps> = () => {
|
const VideoEditor: FC<Props> = () => {
|
||||||
const { values, setFieldValue } = useNodeFormContext();
|
const { values, setFieldValue } = useNodeFormContext();
|
||||||
|
|
||||||
const setUrl = useCallback(
|
const setUrl = useCallback(
|
||||||
|
|
|
@ -7,9 +7,9 @@ import { DIALOG_CONTENT } from '~/constants/modal';
|
||||||
import { useModalStore } from '~/store/modal/useModalStore';
|
import { useModalStore } from '~/store/modal/useModalStore';
|
||||||
import { has } from '~/utils/ramda';
|
import { has } from '~/utils/ramda';
|
||||||
|
|
||||||
type IProps = {};
|
type Props = {};
|
||||||
|
|
||||||
const Modal: FC<IProps> = observer(() => {
|
const Modal: FC<Props> = observer(() => {
|
||||||
const { current, hide, props } = useModalStore();
|
const { current, hide, props } = useModalStore();
|
||||||
|
|
||||||
if (!current || !has(current, DIALOG_CONTENT)) {
|
if (!current || !has(current, DIALOG_CONTENT)) {
|
||||||
|
|
|
@ -4,9 +4,9 @@ import { BetterScrollDialog } from '~/components/common/BetterScrollDialog';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {}
|
interface Props {}
|
||||||
|
|
||||||
const TestDialog: FC<IProps> = () => (
|
const TestDialog: FC<Props> = () => (
|
||||||
<BetterScrollDialog
|
<BetterScrollDialog
|
||||||
header={<div className={styles.head}>HEAD</div>}
|
header={<div className={styles.head}>HEAD</div>}
|
||||||
footer={<div className={styles.footer}>FOOTER</div>}
|
footer={<div className={styles.footer}>FOOTER</div>}
|
||||||
|
|
|
@ -5,12 +5,12 @@ import { IFlowNode } from '~/types';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
recent: IFlowNode[];
|
recent: IFlowNode[];
|
||||||
updated: IFlowNode[];
|
updated: IFlowNode[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const FlowRecent: FC<IProps> = ({ recent, updated }) => {
|
const FlowRecent: FC<Props> = ({ recent, updated }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={styles.updates}>
|
<div className={styles.updates}>
|
||||||
|
|
|
@ -7,14 +7,14 @@ import { INode } from '~/types';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
results: INode[];
|
results: INode[];
|
||||||
hasMore: boolean;
|
hasMore: boolean;
|
||||||
onLoadMore: () => void;
|
onLoadMore: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FlowSearchResults: FC<IProps> = ({ results, onLoadMore, hasMore }) => {
|
const FlowSearchResults: FC<Props> = ({ results, onLoadMore, hasMore }) => {
|
||||||
if (!results.length) {
|
if (!results.length) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.loading}>
|
<div className={styles.loading}>
|
||||||
|
|
|
@ -15,12 +15,12 @@ import { useSearchContext } from '~/utils/providers/SearchProvider';
|
||||||
import { FlowRecent } from './components/FlowRecent';
|
import { FlowRecent } from './components/FlowRecent';
|
||||||
import { FlowSearchResults } from './components/FlowSearchResults';
|
import { FlowSearchResults } from './components/FlowSearchResults';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
isFluid: boolean;
|
isFluid: boolean;
|
||||||
onToggleLayout: () => void;
|
onToggleLayout: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FlowStamp: FC<IProps> = ({ isFluid, onToggleLayout }) => {
|
const FlowStamp: FC<Props> = ({ isFluid, onToggleLayout }) => {
|
||||||
const {
|
const {
|
||||||
searchText,
|
searchText,
|
||||||
hasMore: searchHasMore,
|
hasMore: searchHasMore,
|
||||||
|
|
|
@ -12,9 +12,9 @@ import { getURL } from '~/utils/dom';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends NodeComponentProps {}
|
interface Props extends NodeComponentProps {}
|
||||||
|
|
||||||
const LabImage: FC<IProps> = ({ node, isLoading }) => {
|
const LabImage: FC<Props> = ({ node, isLoading }) => {
|
||||||
const images = useNodeImages(node);
|
const images = useNodeImages(node);
|
||||||
const onClick = useGotoNode(node.id);
|
const onClick = useGotoNode(node.id);
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ import { LabNoResults } from './components/LabNoResults';
|
||||||
import { LabNode } from './components/LabNode';
|
import { LabNode } from './components/LabNode';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {}
|
interface Props {}
|
||||||
|
|
||||||
const LabGrid: FC<IProps> = memo(() => {
|
const LabGrid: FC<Props> = memo(() => {
|
||||||
const { nodes, hasMore, loadMore, search, setSearch, isLoading } =
|
const { nodes, hasMore, loadMore, search, setSearch, isLoading } =
|
||||||
useLabContext();
|
useLabContext();
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,11 @@ import { useLabContext } from '~/utils/context/LabContextProvider';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LabHead: FC<IProps> = ({ isLoading }) => {
|
const LabHead: FC<Props> = ({ isLoading }) => {
|
||||||
const { sort, setSort, search, setSearch } = useLabContext();
|
const { sort, setSort, search, setSearch } = useLabContext();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -6,9 +6,9 @@ import { DivProps } from '~/utils/types';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps extends DivProps {}
|
interface Props extends DivProps {}
|
||||||
|
|
||||||
const LabSquare: FC<IProps> = ({ children, ...rest }) => (
|
const LabSquare: FC<Props> = ({ children, ...rest }) => (
|
||||||
<div className={styles.square}>
|
<div className={styles.square}>
|
||||||
<div {...rest} className={classNames(styles.content, rest.className)}>
|
<div {...rest} className={classNames(styles.content, rest.className)}>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
@ -6,14 +6,14 @@ import { INode } from '~/types';
|
||||||
|
|
||||||
import { LabHero } from './components/LabHero';
|
import { LabHero } from './components/LabHero';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
nodes: Partial<INode>[];
|
nodes: Partial<INode>[];
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const empty = [...new Array(5)].map((_, i) => i);
|
const empty = [...new Array(5)].map((_, i) => i);
|
||||||
|
|
||||||
const LabHeroes: FC<IProps> = ({ nodes, isLoading }) => {
|
const LabHeroes: FC<Props> = ({ nodes, isLoading }) => {
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<Group className={styles.heroes}>
|
<Group className={styles.heroes}>
|
||||||
|
|
|
@ -6,12 +6,12 @@ import { ITag } from '~/types';
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {
|
interface Props {
|
||||||
tags: ITag[];
|
tags: ITag[];
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LabTags: FC<IProps> = ({ tags, isLoading }) => {
|
const LabTags: FC<Props> = ({ tags, isLoading }) => {
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.tags}>
|
<div className={styles.tags}>
|
||||||
|
|
|
@ -10,9 +10,9 @@ import { LabFactoryBanner } from './components/LabFactoryBanner';
|
||||||
import { LabTags } from './components/LabTags';
|
import { LabTags } from './components/LabTags';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
||||||
interface IProps {}
|
interface Props {}
|
||||||
|
|
||||||
const LabStats: FC<IProps> = () => {
|
const LabStats: FC<Props> = () => {
|
||||||
const { isLoadingStats, tags, heroes, updates } = useLabContext();
|
const { isLoadingStats, tags, heroes, updates } = useLabContext();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
import { FC } from 'react';
|
|
||||||
|
|
||||||
import { PlayerView } from '~/containers/player/PlayerView';
|
|
||||||
|
|
||||||
import styles from './styles.module.scss';
|
|
||||||
|
|
||||||
type IProps = {};
|
|
||||||
|
|
||||||
const BottomContainer: FC<IProps> = () => (
|
|
||||||
<div className={styles.wrap}>
|
|
||||||
<div className={styles.content}>
|
|
||||||
<div className={styles.padder}>
|
|
||||||
<PlayerView />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
export { BottomContainer };
|
|
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