mirror of
https://github.com/voltbonn/profile-picture-generator.git
synced 2024-12-22 07:45:04 +00:00
images have url in their name and hashtagURL can be displayed
This commit is contained in:
parent
d9f131e163
commit
c57707b305
2 changed files with 12 additions and 6 deletions
|
@ -297,9 +297,10 @@ function App() {
|
|||
*/}
|
||||
|
||||
<Editor
|
||||
background={originalPhoto}
|
||||
backgroundURL={originalPhoto || empty_1x1}
|
||||
backgroundRatio={originalPhotoRation}
|
||||
foreground={frameURL}
|
||||
frameURL={frameURL}
|
||||
hashtagURL={hashtagURL || empty_1x1}
|
||||
onChange={handleCordsChange}
|
||||
/>
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ let maxScale = 8;
|
|||
|
||||
|
||||
|
||||
function Editor({ onChange, background, backgroundRatio, foreground }) {
|
||||
function Editor({ onChange, backgroundURL, backgroundRatio, frameURL, hashtagURL }) {
|
||||
const editorRef = useRef(null)
|
||||
const backgroundImageRef = useRef(null)
|
||||
|
||||
|
@ -111,7 +111,7 @@ function Editor({ onChange, background, backgroundRatio, foreground }) {
|
|||
set_add_x(0)
|
||||
set_add_y(0)
|
||||
set_scale(1)
|
||||
}, [background])
|
||||
}, [backgroundURL])
|
||||
|
||||
const handleMove = useCallback(event => {
|
||||
const prev_x = event.target.dataset.x * 1
|
||||
|
@ -206,7 +206,7 @@ function Editor({ onChange, background, backgroundRatio, foreground }) {
|
|||
data-scale={scale}
|
||||
>
|
||||
<img
|
||||
src={background}
|
||||
src={backgroundURL}
|
||||
ref={backgroundImageRef}
|
||||
alt=""
|
||||
className="background"
|
||||
|
@ -217,10 +217,15 @@ function Editor({ onChange, background, backgroundRatio, foreground }) {
|
|||
}}
|
||||
/>
|
||||
<img
|
||||
src={foreground}
|
||||
src={frameURL}
|
||||
alt=""
|
||||
className="foreground"
|
||||
/>
|
||||
<img
|
||||
src={hashtagURL}
|
||||
alt=""
|
||||
className="hashtag"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue