1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-06-25 19:18:29 +07:00

made sample profile page

This commit is contained in:
Fedor Katurov 2021-10-01 12:01:11 +07:00
parent b43fb35b47
commit a808045a7d
17 changed files with 118 additions and 179 deletions

View file

@ -3,7 +3,7 @@ import { useCommentFormFormik } from '~/utils/hooks/useCommentFormFormik';
import { FormikProvider } from 'formik';
import { LocalCommentFormTextarea } from '~/components/comment/LocalCommentFormTextarea';
import { Button } from '~/components/input/Button';
import { FileUploaderProvider, useFileUploader } from '~/utils/hooks/fileUploader';
import { FileUploaderProvider, useFileUploader } from '~/utils/hooks/useFileUploader';
import { UPLOAD_SUBJECTS, UPLOAD_TARGETS } from '~/redux/uploads/constants';
import { CommentFormAttachButtons } from '~/components/comment/CommentFormAttachButtons';
import { CommentFormFormatButtons } from '~/components/comment/CommentFormFormatButtons';

View file

@ -7,7 +7,7 @@ import { SortEnd } from 'react-sortable-hoc';
import { moveArrItem } from '~/utils/fn';
import { useDropZone } from '~/utils/hooks';
import { COMMENT_FILE_TYPES, UPLOAD_TYPES } from '~/redux/uploads/constants';
import { useFileUploaderContext } from '~/utils/hooks/fileUploader';
import { useFileUploaderContext } from '~/utils/hooks/useFileUploader';
const CommentFormAttaches: FC = () => {
const uploader = useFileUploaderContext();

View file

@ -10,11 +10,20 @@ interface Props extends DivProps {
url?: string;
username?: string;
size?: number;
preset?: typeof PRESETS[keyof typeof PRESETS];
innerRef?: React.Ref<any>;
}
const Avatar: FC<Props> = ({ url, username, size, className, innerRef, ...rest }) => {
const backgroundImage = !!url ? `url('${getURLFromString(url, PRESETS.avatar)}')` : undefined;
const Avatar: FC<Props> = ({
url,
username,
size,
className,
innerRef,
preset = PRESETS.avatar,
...rest
}) => {
const backgroundImage = !!url ? `url('${getURLFromString(url, preset)}')` : undefined;
const onOpenProfile = useCallback(() => openUserProfile(username), [username]);
return (

View file

@ -11,7 +11,7 @@ import { NodeEditorProps } from '~/redux/node/types';
import { useNodeImages } from '~/utils/hooks/node/useNodeImages';
import { useNodeAudios } from '~/utils/hooks/node/useNodeAudios';
import { useNodeFormContext } from '~/utils/hooks/useNodeFormFormik';
import { useFileUploaderContext } from '~/utils/hooks/fileUploader';
import { useFileUploaderContext } from '~/utils/hooks/useFileUploader';
type IProps = NodeEditorProps;

View file

@ -3,7 +3,7 @@ import styles from './styles.module.scss';
import { Icon } from '~/components/input/Icon';
import { UPLOAD_TYPES } from '~/redux/uploads/constants';
import { IEditorComponentProps } from '~/redux/node/types';
import { useFileUploaderContext } from '~/utils/hooks/fileUploader';
import { useFileUploaderContext } from '~/utils/hooks/useFileUploader';
import { getFileType } from '~/utils/uploader';
import { useNodeFormContext } from '~/utils/hooks/useNodeFormFormik';
import { Button } from '~/components/input/Button';

View file

@ -11,7 +11,7 @@ import { getURL } from '~/utils/dom';
import { Icon } from '~/components/input/Icon';
import { PRESETS } from '~/constants/urls';
import { IEditorComponentProps } from '~/redux/node/types';
import { useFileUploader, useFileUploaderContext } from '~/utils/hooks/fileUploader';
import { useFileUploader, useFileUploaderContext } from '~/utils/hooks/useFileUploader';
import { useNodeFormContext } from '~/utils/hooks/useNodeFormFormik';
import { getFileType } from '~/utils/uploader';

View file

@ -6,7 +6,7 @@ import { selectUploads } from '~/redux/uploads/selectors';
import { ImageGrid } from '~/components/editors/ImageGrid';
import styles from './styles.module.scss';
import { NodeEditorProps } from '~/redux/node/types';
import { useFileUploaderContext } from '~/utils/hooks/fileUploader';
import { useFileUploaderContext } from '~/utils/hooks/useFileUploader';
type IProps = NodeEditorProps;