Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated new post modal #196

Merged
merged 7 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function getModalStyle() {
transform: `translate(-${top}%, -${left}%)`,
padding: `${padding}%`,
borderRadius: `${radius}%`,
textAlign: "center"
};
}

Expand Down Expand Up @@ -293,8 +294,15 @@ function App() {
</div>
)}
</div>
<Dialog open={openNewUpload} onClose={() => setOpenNewUpload(false)}>
<DialogTitle>New Upload</DialogTitle>
<Dialog sx={{borderRadius: "100px"}} open={openNewUpload} onClose={() => setOpenNewUpload(false)}>
<div style={{padding: "20px", borderRadius: "10%", textAlign: "center"}}>
<img
src="https://user-images.githubusercontent.com/27727921/185767526-a002a17d-c12e-4a6a-82a4-dd1a13a5ecda.png"
alt="instagram"
className="modal__signup__img"
style={{ width: "50%" }}
/>
<p style={{fontSize: "25px", fontFamily: "monospace"}}>New Post</p>
<DialogContent>
{!loadingPosts &&
(user ? (
Expand All @@ -306,17 +314,17 @@ function App() {
<h3>Sorry you need to login to upload posts</h3>
))}
</DialogContent>
</div>
</Dialog>

<Modal open={openSignUp} onClose={() => setOpenSignUp(false)}>
<div style={modalStyle} className={classes.paper}>
<form className="modal__signup" onSubmit={signUp}>
<center>
<img
src="https://user-images.githubusercontent.com/27727921/185767526-a002a17d-c12e-4a6a-82a4-dd1a13a5ecda.png"
alt="instagram"
className="modal__signup__img"
style={{ width: "80%" }}
style={{ width: "80%", marginLeft:"10%" }}
/>
<div
style={{
Expand All @@ -326,6 +334,7 @@ function App() {
border: "2px",
borderColor: "black",
borderStyle: "solid",
marginLeft:"22%"
}}
>
{address ? (
Expand Down Expand Up @@ -382,19 +391,17 @@ function App() {
>
Sign Up
</AnimatedButton>
</center>
</form>
</div>
</Modal>
<Modal open={openSignIn} onClose={() => setOpenSignIn(false)}>
<div style={getModalStyle()} className={classes.paper}>
<form className="modal__signup">
<center>
<img
src="https://user-images.githubusercontent.com/27727921/185767526-a002a17d-c12e-4a6a-82a4-dd1a13a5ecda.png"
alt="dummygram"
className="modal__signup__img"
style={{ width: "80%" }}
style={{ width: "80%", marginLeft: "10%" }}
/>
<Input
type="text"
Expand All @@ -419,12 +426,12 @@ function App() {
>
Sign In
</AnimatedButton>
</center>
</form>
</div>
</Modal>

<center
<div style={{display: "flex", alignContent: "center", justifyContent: "center"}}>
<div
style={
!loadingPosts
? {}
Expand All @@ -446,7 +453,8 @@ function App() {
))}
</div>
)}
</center>
</div>
</div>
<FaArrowCircleUp
fill="#777"
// stroke="30"
Expand All @@ -458,6 +466,7 @@ function App() {
}}
/>
</div>

);
}

Expand Down
29 changes: 16 additions & 13 deletions src/components/ImgUpload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,30 +144,33 @@ function ImgUpload(props) {
)}
{(!uploadingPost || (uploadingPost && image)) && (
<>
<input
type="file"
name="file"
id="file"
onChange={handleChange}
multiple
accept="image/*"
ref={imgInput}
disabled={uploadingPost}
/>
<caption>Allowed Types: jpg, jpeg, png</caption>
<center><div className="file-input">
<input
type="file"
className="file"
name="file"
id="file"
onChange={handleChange}
multiple
accept="image/*"
ref={imgInput}
disabled={uploadingPost}
/>
<label htmlFor="file">Upload Picture</label>
</div></center>
</>
)}
{imagePreviews && (
<div>
{imagePreviews.map((img, i) => {
return (
<img
<center><img
id="imgPreview"
className="preview"
src={img}
alt={`image-${i}`}
key={i}
/>
/></center>
);
})}
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@
margin-right: auto;
margin-top: 10px;
margin-bottom: 10px;
/* border: 1px solid #ccc; */
background-color: rgb(157, 237, 226);
}

.imageUpload-progress {
Expand Down Expand Up @@ -262,7 +260,7 @@ div#picker {
display: flex;
align-items: center;
justify-content: center;
color: #cf0db5;
color: #ffffff;
font-weight: bold;
cursor: pointer;
transition: transform 0.2s ease-out;
Expand Down