forked from manikandanraji/instaclone-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f43356c
commit 1b4bdc5
Showing
8 changed files
with
245 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import Button from "../styles/Button"; | ||
import { Wrapper } from "./ProfileForm"; | ||
|
||
const buttonStyle = { | ||
marginLeft: '13rem' | ||
} | ||
|
||
const labelStyle = { | ||
width: '200px' | ||
} | ||
|
||
|
||
const ChangeAvatar = () => { | ||
return ( | ||
<Wrapper> | ||
<form> | ||
<div className="input-group"> | ||
<label style={labelStyle} className="bold">Old Password</label> | ||
<input type="password" /> | ||
</div> | ||
<div className="input-group"> | ||
<label style={labelStyle} className="bold">New Password</label> | ||
<input type="password" /> | ||
</div> | ||
<div className="input-group"> | ||
<label style={labelStyle} className="bold">Confirm New Password</label> | ||
<input type="password" /> | ||
</div> | ||
<Button style={buttonStyle}>Submit</Button> | ||
</form> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default ChangeAvatar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React, { useState } from "react"; | ||
import styled from "styled-components"; | ||
import ProfileForm from "./ProfileForm"; | ||
import ChangePassword from "./ChangePassword"; | ||
|
||
const Wrapper = styled.div` | ||
grid-template-columns: 240px 1fr; | ||
width: 930px; | ||
border: 1px solid #dbdbdb; | ||
display: grid; | ||
background: #fff; | ||
.tabs { | ||
border-right: 1px solid #dbdbdb; | ||
padding: 1rem; | ||
} | ||
ul { | ||
list-style-type: none; | ||
} | ||
li { | ||
margin-bottom: 1.5rem; | ||
cursor: pointer; | ||
} | ||
.profile-form-container { | ||
display: flex; | ||
justify-content: center; | ||
} | ||
`; | ||
|
||
const EditProfile = () => { | ||
const [tab, setTab] = useState("profile"); | ||
|
||
return ( | ||
<Wrapper> | ||
<div className="tabs"> | ||
<ul> | ||
<li | ||
onClick={() => setTab("profile")} | ||
className={tab === "profile" ? "bold" : ""} | ||
> | ||
Edit Profile | ||
</li> | ||
<li | ||
onClick={() => setTab("changepw")} | ||
className={tab === "changepw" ? "bold" : ""} | ||
> | ||
Change Password | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
{tab === "profile" && ( | ||
<div className="profile-form-container"> | ||
<ProfileForm /> | ||
</div> | ||
)} | ||
|
||
{tab === "changepw" && ( | ||
<div className="profile-form-container"> | ||
<ChangePassword /> | ||
</div> | ||
)} | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default EditProfile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import avatar from "../assets/avatar.jpg"; | ||
import Button from "../styles/Button"; | ||
import Avatar from "../styles/Avatar"; | ||
|
||
export const Wrapper = styled.div` | ||
padding: 1rem; | ||
img { | ||
cursor: pointer; | ||
margin-right: 40px; | ||
} | ||
.input-group { | ||
margin-top: 1.5rem; | ||
} | ||
.input-group > label { | ||
display: inline-block; | ||
width: 100px; | ||
} | ||
input, | ||
textarea { | ||
padding: 0.4rem 1rem; | ||
font-family: "Fira Sans", sans-serif; | ||
font-size: 1rem; | ||
border-radius: 4px; | ||
border: 1px solid #dbdbdb; | ||
width: 350px; | ||
} | ||
.textarea-group { | ||
display: flex; | ||
} | ||
.change-avatar { | ||
display: flex; | ||
} | ||
input[id="change-avatar"] { | ||
display: none; | ||
} | ||
span { | ||
color: #0095f6; | ||
cursor: pointer; | ||
} | ||
button { | ||
margin-top: 1.5rem; | ||
margin-left: 6.25rem; | ||
margin-bottom: 1rem; | ||
} | ||
`; | ||
|
||
const ProfileForm = () => { | ||
return ( | ||
<Wrapper> | ||
<form> | ||
<div className="input-group change-avatar"> | ||
<div> | ||
<label htmlFor="change-avatar"> | ||
<Avatar lg src={avatar} alt="avatar" /> | ||
</label> | ||
<input id="change-avatar" type="file" /> | ||
</div> | ||
<div class="change-avatar-meta"> | ||
<h2>kickbuttowski248</h2> | ||
<label htmlFor="change-avatar"> | ||
<span>Change Profile Photo</span> | ||
</label> | ||
<input id="change-avatar" type="file" /> | ||
</div> | ||
</div> | ||
|
||
<div className="input-group"> | ||
<label className="bold" htmlFor="name"> | ||
Name | ||
</label> | ||
<input type="text" value="Kick Buttowski" /> | ||
</div> | ||
<div className="input-group"> | ||
<label className="bold" htmlFor="username"> | ||
Username | ||
</label> | ||
<input type="text" value="kickbuttowski248" /> | ||
</div> | ||
<div className="input-group"> | ||
<label className="bold" htmlFor="website"> | ||
Website | ||
</label> | ||
<input type="text" value="https://github.com/manikandanraji" /> | ||
</div> | ||
<div className="input-group textarea-group"> | ||
<label className="bold" htmlFor="bio"> | ||
Bio | ||
</label> | ||
<textarea | ||
cols="10" | ||
value="Former Assassin, killed a guy with an pencil" | ||
></textarea> | ||
</div> | ||
<div className="input-group"> | ||
<label className="bold" htmlFor="email"> | ||
</label> | ||
<input type="email" value="[email protected]" /> | ||
</div> | ||
<Button>Submit</Button> | ||
</form> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default ProfileForm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import styled from "styled-components"; | ||
import styled, { css } from "styled-components"; | ||
|
||
const Avatar = styled.img` | ||
width: 28px; | ||
height: 28px; | ||
border-radius: 14px; | ||
margin-right: 1rem; | ||
${props => props.lg && css` | ||
width: 60px; | ||
height: 60px; | ||
border-radius: 30px; | ||
`} | ||
`; | ||
|
||
export default Avatar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters