mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
fixed for nextjs, but it won't work
This commit is contained in:
parent
33e9e01f29
commit
4b79b06106
39 changed files with 64 additions and 63 deletions
|
@ -3,11 +3,11 @@ import styles from './styles.module.scss';
|
|||
import { Icon } from '~/components/input/Icon';
|
||||
import { PLAYER_STATES } from '~/redux/player/constants';
|
||||
import { connect } from 'react-redux';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import { selectPlayer } from '~/redux/player/selectors';
|
||||
import * as PLAYER_ACTIONS from '~/redux/player/actions';
|
||||
import { IPlayerProgress, Player } from '~/utils/player';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
import { IFile } from '~/redux/types';
|
||||
|
||||
const mapStateToProps = state => pick(['status', 'file'], selectPlayer(state));
|
||||
|
|
|
@ -4,7 +4,7 @@ import styles from './styles.module.scss';
|
|||
import { getPrettyDate } from '~/utils/dom';
|
||||
|
||||
interface IProps {
|
||||
data: IStatGitRow;
|
||||
data: Partial<IStatGitRow>;
|
||||
}
|
||||
|
||||
const BorisStatsGitCard: FC<IProps> = ({ data: { timestamp, subject } }) => {
|
||||
|
|
|
@ -5,7 +5,7 @@ import styles from './styles.module.scss';
|
|||
import { Card } from '../Card';
|
||||
import { IUser } from '~/redux/auth/types';
|
||||
import { getURL } from '~/utils/dom';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
|
||||
type IProps = HTMLAttributes<HTMLDivElement> & {
|
||||
|
|
|
@ -3,7 +3,7 @@ import styles from './styles.module.scss';
|
|||
import { createPortal } from 'react-dom';
|
||||
import { selectNode } from '~/redux/node/selectors';
|
||||
import { connect } from 'react-redux';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import { getURL } from '~/utils/dom';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ import { IFileWithUUID, INode, IFile } from '~/redux/types';
|
|||
import uuid from 'uuid4';
|
||||
import { UPLOAD_SUBJECTS, UPLOAD_TARGETS, UPLOAD_TYPES } from '~/redux/uploads/constants';
|
||||
import * as UPLOAD_ACTIONS from '~/redux/uploads/actions';
|
||||
import assocPath from 'ramda/es/assocPath';
|
||||
import append from 'ramda/es/append';
|
||||
import { assocPath } from 'ramda';
|
||||
import { append } from 'ramda';
|
||||
import { selectUploads } from '~/redux/uploads/selectors';
|
||||
import { connect } from 'react-redux';
|
||||
import { NODE_SETTINGS } from '~/redux/node/constants';
|
||||
|
|
|
@ -3,7 +3,7 @@ import { IFileWithUUID } from '~/redux/types';
|
|||
import uuid from 'uuid4';
|
||||
import styles from './styles.module.scss';
|
||||
import { UPLOAD_SUBJECTS, UPLOAD_TARGETS, UPLOAD_TYPES } from '~/redux/uploads/constants';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
import { connect } from 'react-redux';
|
||||
import * as UPLOAD_ACTIONS from '~/redux/uploads/actions';
|
||||
import { selectUploads } from '~/redux/uploads/selectors';
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { FC, useCallback } from 'react';
|
|||
import { INode } from '~/redux/types';
|
||||
import styles from './styles.module.scss';
|
||||
import { Textarea } from '~/components/input/Textarea';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
|
||||
interface IProps {
|
||||
data: INode;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { FC, useCallback, useMemo } from 'react';
|
||||
import { INode } from '~/redux/types';
|
||||
import styles from './styles.module.scss';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
import { InputText } from '~/components/input/InputText';
|
||||
import classnames from 'classnames';
|
||||
import { getYoutubeThumb } from '~/utils/dom';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { FC } from 'react';
|
||||
import React, { FC, Fragment } from 'react';
|
||||
import { Cell } from '~/components/flow/Cell';
|
||||
|
||||
import { IFlowState } from '~/redux/flow/reducer';
|
||||
|
@ -14,7 +14,7 @@ type IProps = Partial<IFlowState> & {
|
|||
};
|
||||
|
||||
export const FlowGrid: FC<IProps> = ({ user, nodes, onSelect, onChangeCellView }) => (
|
||||
<>
|
||||
<Fragment>
|
||||
{nodes.map(node => (
|
||||
<Cell
|
||||
key={node.id}
|
||||
|
@ -24,5 +24,5 @@ export const FlowGrid: FC<IProps> = ({ user, nodes, onSelect, onChangeCellView }
|
|||
onChangeCellView={onChangeCellView}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
</Fragment>
|
||||
);
|
||||
|
|
|
@ -8,8 +8,8 @@ import { Filler } from '~/components/containers/Filler';
|
|||
import { selectUser, selectAuthUpdates } from '~/redux/auth/selectors';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { DIALOGS } from '~/redux/modal/constants';
|
||||
import pick from 'ramda/es/pick';
|
||||
import path from 'ramda/es/path';
|
||||
import { pick } from 'ramda';
|
||||
import { path } from 'ramda';
|
||||
import { UserButton } from '../UserButton';
|
||||
import { Notifications } from '../Notifications';
|
||||
import { URLS } from '~/constants/urls';
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Icon } from '~/components/input/Icon';
|
|||
import styles from './styles.module.scss';
|
||||
import { connect } from 'react-redux';
|
||||
import { selectAuthUpdates, selectAuthUser } from '~/redux/auth/selectors';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import classNames from 'classnames';
|
||||
import * as AUTH_ACTIONS from '~/redux/auth/actions';
|
||||
import { NotificationBubble } from '../../notifications/NotificationBubble';
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import React, { FC, useMemo, memo, createElement, useCallback, useState } from 'react';
|
||||
import React, { FC, useMemo, memo, createElement, useCallback, Fragment } from 'react';
|
||||
import { IComment, IFile } from '~/redux/types';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
import { formatCommentText, getURL, getPrettyDate } from '~/utils/dom';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import styles from './styles.module.scss';
|
||||
import { UPLOAD_TYPES } from '~/redux/uploads/constants';
|
||||
import assocPath from 'ramda/es/assocPath';
|
||||
import append from 'ramda/es/append';
|
||||
import { assocPath } from 'ramda';
|
||||
import { append } from 'ramda';
|
||||
import reduce from 'ramda/es/reduce';
|
||||
import { AudioPlayer } from '~/components/media/AudioPlayer';
|
||||
import classnames from 'classnames';
|
||||
|
@ -84,7 +84,7 @@ const CommentContent: FC<IProps> = memo(
|
|||
)}
|
||||
|
||||
{groupped.audio && groupped.audio.length > 0 && (
|
||||
<>
|
||||
<Fragment>
|
||||
{groupped.audio.map(file => (
|
||||
<div className={classnames(styles.block, styles.block_audio)} key={file.id}>
|
||||
{menu}
|
||||
|
@ -94,7 +94,7 @@ const CommentContent: FC<IProps> = memo(
|
|||
<div className={styles.date}>{getPrettyDate(comment.created_at)}</div>
|
||||
</div>
|
||||
))}
|
||||
</>
|
||||
</Fragment>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Textarea } from '~/components/input/Textarea';
|
|||
import styles from './styles.module.scss';
|
||||
import { Filler } from '~/components/containers/Filler';
|
||||
import { Button } from '~/components/input/Button';
|
||||
import assocPath from 'ramda/es/assocPath';
|
||||
import { assocPath } from 'ramda';
|
||||
import { IFile, IFileWithUUID, InputHandler } from '~/redux/types';
|
||||
import { connect } from 'react-redux';
|
||||
import * as NODE_ACTIONS from '~/redux/node/actions';
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { FC, useMemo } from 'react';
|
|||
import { INode } from '~/redux/types';
|
||||
import styles from './styles.module.scss';
|
||||
import { UPLOAD_TYPES } from '~/redux/uploads/constants';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
import { getURL } from '~/utils/dom';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
import { INodeComponentProps } from '~/redux/node/constants';
|
||||
|
|
|
@ -4,7 +4,7 @@ import { CommentWrapper } from '~/components/containers/CommentWrapper';
|
|||
import styles from './styles.module.scss';
|
||||
import { Filler } from '~/components/containers/Filler';
|
||||
import { Button } from '~/components/input/Button';
|
||||
import assocPath from 'ramda/es/assocPath';
|
||||
import { assocPath } from 'ramda';
|
||||
import { InputHandler, IFileWithUUID, IFile } from '~/redux/types';
|
||||
import { connect } from 'react-redux';
|
||||
import * as NODE_ACTIONS from '~/redux/node/actions';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { FC } from 'react';
|
||||
import { INode } from '~/redux/types';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
import { formatTextParagraphs } from '~/utils/dom';
|
||||
import styles from './styles.module.scss';
|
||||
import { INodeComponentProps } from '~/redux/node/constants';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { FC, useMemo } from 'react';
|
||||
import styles from './styles.module.scss';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
import { INodeComponentProps } from '~/redux/node/constants';
|
||||
|
||||
interface IProps extends INodeComponentProps {}
|
||||
|
|
|
@ -7,7 +7,7 @@ import { Button } from '~/components/input/Button';
|
|||
import { Group } from '~/components/containers/Group';
|
||||
import { Filler } from '~/components/containers/Filler';
|
||||
import { InputText } from '~/components/input/InputText';
|
||||
import reject from 'ramda/es/reject';
|
||||
import { reject } from 'ramda';
|
||||
import * as AUTH_ACTIONS from '~/redux/auth/actions';
|
||||
import { ERROR_LITERAL } from '~/constants/errors';
|
||||
import { ProfileAccounts } from '~/components/profile/ProfileAccounts';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { FC, HTMLAttributes, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { TagField } from '~/components/containers/TagField';
|
||||
import { ITag } from '~/redux/types';
|
||||
import uniq from 'ramda/es/uniq';
|
||||
import { uniq } from 'ramda';
|
||||
import { Tag } from '~/components/tags/Tag';
|
||||
import { TagInput } from '~/components/tags/TagInput';
|
||||
import { separateTags } from '~/utils/tag';
|
||||
|
|
|
@ -14,7 +14,7 @@ import styles from './styles.module.scss';
|
|||
import * as ACTIONS from '~/redux/auth/actions';
|
||||
import * as MODAL_ACTIONS from '~/redux/modal/actions';
|
||||
import { ISocialProvider } from '~/redux/auth/types';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import { LoginDialogButtons } from '~/containers/dialogs/LoginDialogButtons';
|
||||
import { IOAuthEvent, OAUTH_EVENT_TYPES } from '~/redux/types';
|
||||
import { DialogTitle } from '~/components/dialogs/DialogTitle';
|
||||
|
|
|
@ -8,7 +8,7 @@ import { ProfileMessages } from '~/containers/profile/ProfileMessages';
|
|||
import { ProfileDescription } from '~/components/profile/ProfileDescription';
|
||||
import * as AUTH_ACTIONS from '~/redux/auth/actions';
|
||||
import { IAuthState } from '~/redux/auth/types';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import { CoverBackdrop } from '~/components/containers/CoverBackdrop';
|
||||
import { ProfileSettings } from '~/components/profile/ProfileSettings';
|
||||
import { ProfileAccounts } from '~/components/profile/ProfileAccounts';
|
||||
|
|
|
@ -8,7 +8,7 @@ import { Button } from '~/components/input/Button';
|
|||
import styles from './styles.module.scss';
|
||||
|
||||
import * as AUTH_ACTIONS from '~/redux/auth/actions';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import { selectAuthRestore } from '~/redux/auth/selectors';
|
||||
import { ERROR_LITERAL, ERRORS } from '~/constants/errors';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
|
|
|
@ -8,7 +8,7 @@ import { Button } from '~/components/input/Button';
|
|||
import styles from './styles.module.scss';
|
||||
|
||||
import * as AUTH_ACTIONS from '~/redux/auth/actions';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import { selectAuthRestore } from '~/redux/auth/selectors';
|
||||
import { ERROR_LITERAL } from '~/constants/errors';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
|
|
|
@ -4,7 +4,7 @@ import { FlowGrid } from '~/components/flow/FlowGrid';
|
|||
import { selectFlow } from '~/redux/flow/selectors';
|
||||
import * as NODE_ACTIONS from '~/redux/node/actions';
|
||||
import * as FLOW_ACTIONS from '~/redux/flow/actions';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import { selectUser } from '~/redux/auth/selectors';
|
||||
import { FlowHero } from '~/components/flow/FlowHero';
|
||||
import styles from './styles.module.scss';
|
||||
|
|
|
@ -3,7 +3,7 @@ import styles from './styles.module.scss';
|
|||
import { PlayerBar } from '~/components/bars/PlayerBar';
|
||||
import { SubmitBar } from '~/components/bars/SubmitBar';
|
||||
import { selectUser } from '~/redux/auth/selectors';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
const mapStateToProps = state => pick(['is_user'], selectUser(state));
|
||||
|
|
|
@ -14,7 +14,7 @@ import { NodeComments } from '~/components/node/NodeComments';
|
|||
import { NodeTags } from '~/components/node/NodeTags';
|
||||
import { INodeComponentProps, NODE_COMPONENTS, NODE_HEADS, NODE_INLINES, } from '~/redux/node/constants';
|
||||
import { selectUser } from '~/redux/auth/selectors';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import { NodeRelatedPlaceholder } from '~/components/node/NodeRelated/placeholder';
|
||||
import { NodeDeletedBadge } from '~/components/node/NodeDeletedBadge';
|
||||
import { NodeCommentForm } from '~/components/node/NodeCommentForm';
|
||||
|
|
|
@ -2,18 +2,14 @@ import React, { FC, useCallback, useEffect, useState } from "react";
|
|||
import styles from "./styles.module.scss";
|
||||
import { connect } from "react-redux";
|
||||
import { getURL } from "~/utils/dom";
|
||||
import pick from "ramda/es/pick";
|
||||
import { selectAuthUser, selectAuthProfile } from "~/redux/auth/selectors";
|
||||
import { pick } from "ramda";
|
||||
import { selectAuthProfile, selectAuthUser } from "~/redux/auth/selectors";
|
||||
import { PRESETS } from "~/constants/urls";
|
||||
import { selectUploads } from "~/redux/uploads/selectors";
|
||||
import { IFileWithUUID } from "~/redux/types";
|
||||
import uuid from "uuid4";
|
||||
import {
|
||||
UPLOAD_SUBJECTS,
|
||||
UPLOAD_TARGETS,
|
||||
UPLOAD_TYPES
|
||||
} from "~/redux/uploads/constants";
|
||||
import path from "ramda/es/path";
|
||||
import { UPLOAD_SUBJECTS, UPLOAD_TARGETS, UPLOAD_TYPES } from "~/redux/uploads/constants";
|
||||
import { path } from 'ramda';
|
||||
import * as UPLOAD_ACTIONS from "~/redux/uploads/actions";
|
||||
import * as AUTH_ACTIONS from "~/redux/auth/actions";
|
||||
import { Icon } from "~/components/input/Icon";
|
||||
|
|
|
@ -4,7 +4,7 @@ import { selectAuthProfile, selectAuthUser } from '~/redux/auth/selectors';
|
|||
import styles from './styles.module.scss';
|
||||
import * as AUTH_ACTIONS from '~/redux/messages/actions';
|
||||
import { Message } from '~/components/profile/Message';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { pick } from 'ramda';
|
||||
import { NodeNoComments } from '~/components/node/NodeNoComments';
|
||||
import { selectMessages } from '~/redux/messages/selectors';
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ export type IStatBackend = {
|
|||
|
||||
export type IBorisState = Readonly<{
|
||||
stats: {
|
||||
git: IStatGitRow[];
|
||||
git: Partial<IStatGitRow>[];
|
||||
backend: IStatBackend;
|
||||
is_loading: boolean;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import assocPath from 'ramda/es/assocPath';
|
||||
import { assocPath } from 'ramda';
|
||||
import { FLOW_ACTIONS } from './constants';
|
||||
import {
|
||||
flowSetNodes,
|
||||
|
|
|
@ -17,7 +17,7 @@ import { selectFlowNodes, selectFlow } from './selectors';
|
|||
import { reqWrapper } from '../auth/sagas';
|
||||
import { postCellView, getSearchResults } from './api';
|
||||
import { IFlowState } from './reducer';
|
||||
import uniq from 'ramda/es/uniq';
|
||||
import { uniq } from 'ramda';
|
||||
|
||||
function hideLoader() {
|
||||
document.getElementById('main_loader').style.display = 'none';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import assocPath from 'ramda/es/assocPath';
|
||||
import { assocPath } from 'ramda';
|
||||
import { NODE_ACTIONS } from './constants';
|
||||
import {
|
||||
nodeSetSaveErrors,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { takeLatest, call, put, select, delay, all, takeLeading } from 'redux-saga/effects';
|
||||
import { push } from 'connected-react-router';
|
||||
import omit from 'ramda/es/omit';
|
||||
import { omit } from 'ramda';
|
||||
|
||||
import {
|
||||
NODE_ACTIONS,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { PLAYER_ACTIONS } from './constants';
|
||||
import assocPath from 'ramda/es/assocPath';
|
||||
import { assocPath } from 'ramda';
|
||||
import { playerSetFile, playerSetStatus, playerSet } from './actions';
|
||||
|
||||
const setFile = (state, { file }: ReturnType<typeof playerSetFile>) =>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import assocPath from 'ramda/es/assocPath';
|
||||
import omit from 'ramda/es/omit';
|
||||
import { assocPath } from 'ramda';
|
||||
import { omit } from 'ramda';
|
||||
|
||||
import { UPLOAD_ACTIONS, EMPTY_UPLOAD_STATUS } from './constants';
|
||||
import {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import curry from 'ramda/es/curry';
|
||||
import insert from 'ramda/es/insert';
|
||||
import nth from 'ramda/es/nth';
|
||||
import remove from 'ramda/es/remove';
|
||||
import { curry } from 'ramda';
|
||||
import { insert } from 'ramda';
|
||||
import { nth } from 'ramda';
|
||||
import { remove } from 'ramda';
|
||||
import { ICommentGroup, IComment } from '~/redux/types';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
|
||||
export const moveArrItem = curry((at, to, list) => insert(to, nth(at, list), remove(at, 1, list)));
|
||||
export const objFromArray = (array: any[], key: string) =>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { USER_ROLES } from '~/redux/auth/constants';
|
||||
import { ICommentGroup, INode } from '~/redux/types';
|
||||
import { IUser } from '~/redux/auth/types';
|
||||
import path from 'ramda/es/path';
|
||||
import { path } from 'ramda';
|
||||
import { NODE_TYPES } from '~/redux/node/constants';
|
||||
|
||||
export const canEditNode = (node: Partial<INode>, user: Partial<IUser>): boolean =>
|
||||
|
|
|
@ -17,7 +17,7 @@ export interface IPlayerProgress {
|
|||
|
||||
export class PlayerClass {
|
||||
public constructor() {
|
||||
this.element.addEventListener('timeupdate', () => {
|
||||
this.element?.addEventListener('timeupdate', () => {
|
||||
const { duration: total, currentTime: current } = this.element;
|
||||
const progress = parseFloat(((current / total) * 100).toFixed(2));
|
||||
|
||||
|
@ -36,7 +36,7 @@ export class PlayerClass {
|
|||
|
||||
public total: number = 0;
|
||||
|
||||
public element: HTMLAudioElement = new Audio();
|
||||
public element: HTMLAudioElement = typeof Audio !== 'undefined' ? new Audio() : null;
|
||||
|
||||
public duration: number = 0;
|
||||
|
||||
|
@ -45,11 +45,11 @@ export class PlayerClass {
|
|||
};
|
||||
|
||||
public on = (type: string, callback) => {
|
||||
this.element.addEventListener(type, callback);
|
||||
this.element?.addEventListener(type, callback);
|
||||
};
|
||||
|
||||
public off = (type: string, callback) => {
|
||||
this.element.removeEventListener(type, callback);
|
||||
this.element?.removeEventListener(type, callback);
|
||||
};
|
||||
|
||||
public load = () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue