Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
MAC_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이정민
2021-05-10 14:15:01 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f2f049d136fad0e8441b631a7060ddf1860bcc9d
f2f049d1
1 parent
09c2d5cb
업로드 예외처리
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
gif-generator/yarn.lock
src/components/ToastEditor/index.tsx
gif-generator/yarn.lock
0 → 100644
View file @
f2f049d
This diff could not be displayed because it is too large.
src/components/ToastEditor/index.tsx
View file @
f2f049d
...
...
@@ -54,14 +54,25 @@ const ToastEditor = ({ setPreviewURL, setIsImgAdded, setIsEditorOpened }) => {
// }
// }, [lowerCanvas?.toDataURL("image/png")]);
const [alertIsShown, setAlertIsShown] = useState(false);
const handleEnd = () => {
const lowerCanvas = document.getElementsByClassName(
"lower-canvas"
)[0] as HTMLCanvasElement;
setPreviewURL(lowerCanvas.toDataURL("image/png"));
// console.log("asdf");
setIsImgAdded(true);
setIsEditorOpened(false);
if (
lowerCanvas.toDataURL("image/png") ===
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACWCAYAAABkW7XSAAAEYklEQVR4Xu3UAQkAAAwCwdm/9HI83BLIOdw5AgQIRAQWySkmAQIEzmB5AgIEMgIGK1OVoAQIGCw/QIBARsBgZaoSlAABg+UHCBDICBisTFWCEiBgsPwAAQIZAYOVqUpQAgQMlh8gQCAjYLAyVQlKgIDB8gMECGQEDFamKkEJEDBYfoAAgYyAwcpUJSgBAgbLDxAgkBEwWJmqBCVAwGD5AQIEMgIGK1OVoAQIGCw/QIBARsBgZaoSlAABg+UHCBDICBisTFWCEiBgsPwAAQIZAYOVqUpQAgQMlh8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iBgsPwAAQIZAYOVqUpQAgQMlh8gQCAjYLAyVQlKgIDB8gMECGQEDFamKkEJEDBYfoAAgYyAwcpUJSgBAgbLDxAgkBEwWJmqBCVAwGD5AQIEMgIGK1OVoAQIGCw/QIBARsBgZaoSlACBB1YxAJfjJb2jAAAAAElFTkSuQmCC"
) {
setAlertIsShown(true);
setTimeout(() => {
setAlertIsShown(false);
}, 1000);
} else {
setPreviewURL(lowerCanvas.toDataURL("image/png"));
setIsImgAdded(true);
setIsEditorOpened(false);
}
};
return (
...
...
@@ -92,6 +103,9 @@ const ToastEditor = ({ setPreviewURL, setIsImgAdded, setIsEditorOpened }) => {
}}
usageStatistics={true}
/>
<div className="alert" style={{ opacity: alertIsShown ? 1 : 0 }}>
Please select a photo.
</div>
</Container>
);
};
...
...
@@ -122,6 +136,12 @@ const Container = styled.div`
justify-content: center;
cursor: pointer;
}
.alert {
position: fixed;
border-radius: 0.5rem;
transition: 1s;
top: 7rem;
}
.tui-image-editor-container {
border-radius: 1.5rem;
}
...
...
Please
register
or
login
to post a comment