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

added imagecaching

This commit is contained in:
Fedor Katurov 2019-11-07 12:20:17 +07:00
parent 88f50e3348
commit 1320f0851f
16 changed files with 43 additions and 35 deletions

View file

@ -110,7 +110,7 @@ const Cell: FC<IProps> = ({
}}
onClick={onClick}
>
<img src={getURL({ url: thumbnail })} onLoad={onImageLoad} alt="" />
<img src={getURL({ url: thumbnail }, PRESETS.cover)} onLoad={onImageLoad} alt="" />
</div>
)}
</div>

View file

@ -5,7 +5,7 @@ import classNames from 'classnames';
import * as styles from './styles.scss';
import { getURL } from '~/utils/dom';
import { withRouter, RouteComponentProps } from 'react-router';
import { URLS } from '~/constants/urls';
import { URLS, PRESETS } from '~/constants/urls';
import { Icon } from '~/components/input/Icon';
type IProps = RouteComponentProps & {
@ -103,12 +103,12 @@ const FlowHeroUnconnected: FC<IProps> = ({ heroes, history }) => {
[styles.is_visible]: loaded.includes(hero.id),
[styles.is_active]: current === hero.id,
})}
style={{ backgroundImage: `url("${getURL({ url: hero.thumbnail })}")` }}
style={{ backgroundImage: `url("${getURL({ url: hero.thumbnail }, PRESETS.hero)}")` }}
key={hero.id}
onClick={onClick}
>
<img
src={getURL({ url: hero.thumbnail })}
src={getURL({ url: hero.thumbnail }, PRESETS.hero)}
alt={hero.thumbnail}
onLoad={onLoad(hero.id)}
/>

View file

@ -3,7 +3,7 @@ import * as styles from './styles.scss';
import { IFlowState } from '~/redux/flow/reducer';
import { getURL, getPrettyDate } from '~/utils/dom';
import { Link } from 'react-router-dom';
import { URLS } from '~/constants/urls';
import { URLS, PRESETS } from '~/constants/urls';
import classNames from 'classnames';
interface IProps {
@ -18,7 +18,7 @@ const FlowRecent: FC<IProps> = ({ recent, updated }) => (
<Link key={node.id} className={styles.item} to={URLS.NODE_URL(node.id)}>
<div
className={classNames(styles.thumb, styles.new)}
style={{ backgroundImage: `url("${getURL({ url: node.thumbnail })}")` }}
style={{ backgroundImage: `url("${getURL({ url: node.thumbnail }, PRESETS.avatar)}")` }}
/>
<div className={styles.info}>
@ -33,7 +33,7 @@ const FlowRecent: FC<IProps> = ({ recent, updated }) => (
<Link key={node.id} className={styles.item} to={URLS.NODE_URL(node.id)}>
<div
className={styles.thumb}
style={{ backgroundImage: `url("${getURL({ url: node.thumbnail })}")` }}
style={{ backgroundImage: `url("${getURL({ url: node.thumbnail }, PRESETS.avatar)}")` }}
/>
<div className={styles.info}>
<div className={styles.title}>{node.title}</div>