mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
added imagecaching
This commit is contained in:
parent
88f50e3348
commit
1320f0851f
16 changed files with 43 additions and 35 deletions
|
@ -6,6 +6,7 @@ import { Card } from '../Card';
|
|||
import { IUser } from '~/redux/auth/types';
|
||||
import { getURL } from '~/utils/dom';
|
||||
import path from 'ramda/es/path';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
|
||||
type IProps = HTMLAttributes<HTMLDivElement> & {
|
||||
// photo?: string;
|
||||
|
@ -33,7 +34,7 @@ const CommentWrapper: FC<IProps> = ({
|
|||
<div className={styles.thumb}>
|
||||
<div
|
||||
className={styles.thumb_image}
|
||||
style={{ backgroundImage: `url("${getURL(path(['photo'], user))}")` }}
|
||||
style={{ backgroundImage: `url("${getURL(path(['photo'], user), PRESETS.avatar)}")` }}
|
||||
/>
|
||||
<div className={styles.thumb_user}>~{path(['username'], user)}</div>
|
||||
</div>
|
||||
|
|
|
@ -5,6 +5,7 @@ import { selectNode } from '~/redux/node/selectors';
|
|||
import { connect } from 'react-redux';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { getURL } from '~/utils/dom';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
|
||||
const mapStateToProps = state => pick(['current_cover_image'], selectNode(state));
|
||||
|
||||
|
@ -15,7 +16,7 @@ const PageCoverUnconnected: FC<IProps> = memo(({ current_cover_image }) =>
|
|||
? createPortal(
|
||||
<div
|
||||
className={styles.wrap}
|
||||
style={{ backgroundImage: `url("${getURL(current_cover_image)}")` }}
|
||||
style={{ backgroundImage: `url("${getURL(current_cover_image, PRESETS.cover)}")` }}
|
||||
/>,
|
||||
document.body
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue