1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

added new flow presets

This commit is contained in:
Fedor Katurov 2022-03-15 12:09:00 +07:00
parent 4e5a6d727a
commit 5cd1064140
18 changed files with 64 additions and 45 deletions

View file

@ -5,7 +5,7 @@ import { observer } from 'mobx-react-lite';
import PhotoSwipeUI_Default from 'photoswipe/dist/photoswipe-ui-default.js';
import PhotoSwipeJs from 'photoswipe/dist/photoswipe.js';
import { PRESETS } from '~/constants/urls';
import { ImagePresets } from '~/constants/urls';
import { useModal } from '~/hooks/modal/useModal';
import { IFile } from '~/types';
import { DialogComponentProps } from '~/types/modal';
@ -32,7 +32,10 @@ const PhotoSwipe: VFC<PhotoSwipeProps> = observer(({ index, items }) => {
img.onload = () => {
resolveImage({
src: getURL(image, window.innerWidth < 768 ? PRESETS[900] : PRESETS[1600]),
src: getURL(
image,
window.innerWidth < 768 ? ImagePresets[900] : ImagePresets[1600]
),
h: img.naturalHeight,
w: img.naturalWidth,
});
@ -42,7 +45,7 @@ const PhotoSwipe: VFC<PhotoSwipeProps> = observer(({ index, items }) => {
resolveImage({});
};
img.src = getURL(image, PRESETS[1600]);
img.src = getURL(image, ImagePresets[1600]);
})
)
);

View file

@ -3,13 +3,12 @@ import React, { FC } from 'react';
import { Avatar } from '~/components/common/Avatar';
import { Markdown } from '~/components/containers/Markdown';
import { Placeholder } from '~/components/placeholders/Placeholder';
import { PRESETS } from '~/constants/urls';
import { ImagePresets } from '~/constants/urls';
import { IUser } from '~/types/auth';
import { formatText } from '~/utils/dom';
import styles from './styles.module.scss';
interface IProps {
profile: IUser;
isLoading: boolean;
@ -23,7 +22,7 @@ const ProfilePageLeft: FC<IProps> = ({ username, profile, isLoading }) => {
username={username}
url={profile?.photo?.url}
className={styles.avatar}
preset={PRESETS['600']}
preset={ImagePresets['600']}
/>
<div className={styles.region}>