mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
loading profile image to crop
This commit is contained in:
parent
3fdc53715a
commit
81450eedc7
@ -68,7 +68,7 @@ export function Profile(props) {
|
||||
<div class="select">
|
||||
<Button key="select" class="select" onClick={() => onSelectImage()}>Select Image</Button>
|
||||
</div>
|
||||
<Button key="select" onClick={() => setLogoVisible(false)}>Cancel</Button>
|
||||
<Button key="back" onClick={() => setLogoVisible(false)}>Cancel</Button>
|
||||
<Button key="save" type="primary" onClick={() => setLogoVisible(false)}>Save</Button>
|
||||
</ModalFooter>
|
||||
);
|
||||
@ -97,7 +97,7 @@ export function Profile(props) {
|
||||
onOk={() => onProfileSave()} onCancel={() => setInfoVisible(false)}>
|
||||
<ProfileInfo state={state} actions={actions} />
|
||||
</Modal>
|
||||
<Modal title="Profile Image" centered visible={logoVisible} footer={Footer}>
|
||||
<Modal title="Profile Image" centered visible={logoVisible} footer={Footer} onCancel={() => setLogoVisible(false)}>
|
||||
<ProfileImage state={state} actions={actions} />
|
||||
</Modal>
|
||||
</ProfileWrapper>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useState, useCallback } from 'react';
|
||||
import Cropper from 'react-easy-crop'
|
||||
import { UserOutlined } from '@ant-design/icons';
|
||||
import { ProfileImageWrapper, ProfileDefaultImage } from './ProfileImage.styled';
|
||||
@ -8,9 +8,9 @@ export function ProfileImage({ state, actions }) {
|
||||
const [crop, setCrop] = useState({ x: 0, y: 0 })
|
||||
const [zoom, setZoom] = useState(1)
|
||||
|
||||
const onCropComplete = (croppedArea, croppedAreaPixels) => {
|
||||
const onCropComplete = useCallback((croppedArea, croppedAreaPixels) => {
|
||||
console.log("crop complete");
|
||||
};
|
||||
});
|
||||
|
||||
const Logo = () => {
|
||||
if (state.modalImage == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user