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

refactor: flex로 변경 #124

Closed
wants to merge 1 commit into from
Closed
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
1 change: 0 additions & 1 deletion src/components/Mypage/CalendarHeatMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const CHM = styled.div`
`;

const ChartLabel = styled.div`
margin-top: 1rem;
margin-left: 2rem;
font-weight: 600;
`;
Expand Down
84 changes: 43 additions & 41 deletions src/components/Mypage/ProfileInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,61 +31,65 @@ const ProfileInfo = (props) => {
}, [loadUserDone]);

return (
<Styled.Profile>
<div style={{ position: 'relative' }}>
<Styled.ProfileInfo>
<Styled.ContainerProfile>
<Styled.ContainerLeft>
<Styled.ProfileImg
src={info?.avatar ? info?.avatar : `${process.env.PUBLIC_URL}/images/missing.png`}
/>
</Styled.ContainerLeft>

<Styled.ContainerCenter>
<Styled.UserName>{info.username}</Styled.UserName>
<Styled.Email>{info.email}</Styled.Email>
<Styled.ContainerUE>
<Styled.UserName>{info.username}</Styled.UserName>
<Styled.Email>{info.email}</Styled.Email>
</Styled.ContainerUE>
<Styled.Introduce>{info.introduce}</Styled.Introduce>
<Styled.TagContainer>
{tags.map((tag) => (
<Styled.Tagg id={tag}>{tag}</Styled.Tagg>
))}
</Styled.TagContainer>
</Styled.ContainerCenter>

<Styled.ContainerRight>
{me.user.id === info.id ? (
<Styled.EditButton onClick={props.onChangeMode}>프로필 편집</Styled.EditButton>
) : (
<Styled.EditButton>팔로우</Styled.EditButton>
)}

<Styled.SnsAccountContainer>
<Styled.IconContainer>
{info.facebookAccount ? (
<a href={`https://www.facebook.com/${info.facebookAccount}`}>
<Styled.FBIcon
src={`${process.env.PUBLIC_URL}/images/facebook.png`}
alt="fb_icon"
/>
</a>
) : null}
{info.instagramAccount ? (
<a href={`https://www.instagram.com/${info.instagramAccount}`}>
<Styled.InstaIcon
src={`${process.env.PUBLIC_URL}/images/instagram.png`}
alt="insta_icon"
/>
</a>
) : null}
{info.twitterAccount ? (
<a href={`https://twitter.com/${info.twitterAccount}`}>
<Styled.TwittIcon
src={`${process.env.PUBLIC_URL}/images/twitter.png`}
alt="twitter_icon"
/>
</a>
) : null}
</Styled.IconContainer>
{info.facebookAccount ? (
<a href={`https://www.facebook.com/${info.facebookAccount}`}>
<Styled.FBIcon
src={`${process.env.PUBLIC_URL}/images/facebook.png`}
alt="fb_icon"
/>
</a>
) : null}
{info.instagramAccount ? (
<a href={`https://www.instagram.com/${info.instagramAccount}`}>
<Styled.InstaIcon
src={`${process.env.PUBLIC_URL}/images/instagram.png`}
alt="insta_icon"
/>
</a>
) : null}
{info.twitterAccount ? (
<a href={`https://twitter.com/${info.twitterAccount}`}>
<Styled.TwittIcon
src={`${process.env.PUBLIC_URL}/images/twitter.png`}
alt="twitter_icon"
/>
</a>
) : null}
</Styled.SnsAccountContainer>
</Styled.ContainerCenter>
{me.user.id === info.id ? (
<Styled.EditButton onClick={props.onChangeMode}>프로필 편집</Styled.EditButton>
) : (
<Styled.EditButton>팔로우</Styled.EditButton>
)}
</div>
</Styled.ContainerRight>
</Styled.ContainerProfile>

<Styled.Line />

<Styled.ContainerTab>
<Styled.TabButton
type="button"
Expand All @@ -106,10 +110,8 @@ const ProfileInfo = (props) => {
내 TIL
</Styled.TabButton>
</Styled.ContainerTab>
<Styled.ContainerBottom>
{tab ? <CalendarHeatMap id={id} /> : <TIL id={id} />}
</Styled.ContainerBottom>
</Styled.Profile>
{tab ? <CalendarHeatMap id={id} /> : <TIL id={id} />}
</Styled.ProfileInfo>
);
};

Expand Down
122 changes: 51 additions & 71 deletions src/components/Mypage/ProfileInfoStyled.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import styled from 'styled-components';
import { Form, Label } from 'semantic-ui-react';
import { Label } from 'semantic-ui-react';
import media from 'styles/media';

export const ProfileInfo = styled.div`
width: 95%;
margin-left: 2.3%;
display: flex;
flex-direction: column;
justify-content: center;

export const Profile = styled.div`
width: 100%;
position: relative;
padding-top: 1rem;
.choice1 {
margin-top: 0.6rem;
float: left;
font-weight: 1000;
font-family: 'NS-R';
color: #363636;
}
.choice1.active {
margin-top: 0.6rem;
float: left;
font-weight: 1000;
font-family: 'NS-R';
text-decoration: underline;
Expand All @@ -23,45 +25,61 @@ export const Profile = styled.div`
.choice2 {
margin-top: 0.6rem;
margin-left: 1.1rem;
float: left;
font-weight: 1000;
font-family: 'NS-R';
color: #363636;
}
.choice2.active {
margin-top: 0.6rem;
margin-left: 1.1rem;
float: left;
font-weight: 1000;
font-family: 'NS-R';
text-decoration: underline;
color: #707bf3;
}
`;
export const ContainerLeft = styled.div`
width: 10rem;
export const ContainerProfile = styled.div`
width: 96%;
height: 9.5rem;
float: left;
display: flex;
flex-direction: row;
color: black;
`;
export const ContainerLeft = styled.div`
width: 8rem;
height: 9rem;
margin-left: 3rem;
color: black;
padding-left: 2.3rem;
${media.tablet`
margin-left: 0.5rem;
`}
`;
export const ContainerCenter = styled.div`
max-width: 100%;
height: 10rem;
float: left;
padding-left: 1.8rem;
padding-right: 1.8rem;
width: 80%;
display: flex;
flex-direction: column;
padding-top: 0.1rem;
padding-left: 1.5rem;
font-size: 12px;
${media.tablet`
padding-left: 0.5rem;
`}
`;
export const ContainerRight = styled.div`
height: 9rem;
display: flex;
flex-direction: column;
font-size: 12px;
position: relative;
`;
export const SnsAccountContainer = styled.div`
width: 9rem;
clear: left;
padding-left: 0.2rem;
display: flex;
margin-top: 4.5rem;
height: 2rem;
`;
export const ContainerTab = styled.div`
width: 100%;
height: 3rem;
display: flex;
margin-left: 1rem;
margin-top: 1rem;
`;
Expand All @@ -73,25 +91,26 @@ export const ProfileImg = styled.img`
width: 7.5rem;
height: 7.5rem;
border-radius: 3.75rem;
margin-right: 0;
margin-top: 0.2rem;
${media.tablet`
width: 7rem;
height: 7rem;
`}
`;
export const UserName = styled.span`
float: left;
margin-bottom: 0.4rem;
font-size: 1.3rem;
font-weight: 600;
font-family: 'NS-R';
`;
export const Email = styled.span`
float: left;
margin-bottom: 0.4rem;
font-size: 0.8rem;
margin-left: 0.3rem;
margin-top: 0.5rem;
`;
export const Introduce = styled.div`
clear: left;
height: 2rem;
height: 3.5rem;
margin-bottom: 1.2rem;
font-size: 1rem;
font-weight: 500;
Expand All @@ -108,54 +127,41 @@ export const Tags = styled.span`
background-color: #707bf3;
padding: 0.25rem 0.45rem;
font-family: 'NS-R';
float: left;
`;
export const EditButton = styled.button`
width: 4.5rem;
height: 1.6rem;
border-radius: 0.1rem;
font-size: 0.7rem;
margin-top: 0.6rem;
padding: 0;
margin-left: 0.2rem;
background-color: #707bf3;
color: white;
position: absolute;
top: 0;
right: 1.8rem;
`;
export const IconContainer = styled.div`
width: 12rem;
height: 4rem;
`;

export const FBIcon = styled.img`
float: left;
width: 1.35rem;
height: 1.35rem;
margin-right: 0.5rem;
opacity: 0.6;
`;
export const InstaIcon = styled.img`
float: left;
width: 1.45rem;
height: 1.45rem;
margin-right: 0.5rem;
opacity: 0.6;
`;
export const TwittIcon = styled.img`
float: left;
width: 1.4rem;
height: 1.4rem;
margin-right: 0.5rem;
opacity: 0.6;
`;

export const Line = styled.div`
clear: left;
width: 100%;
height: 0.1rem;
margin-left: 0.5rem;
margin-right: 2rem;
background-color: #eaeaea;
`;

Expand All @@ -164,25 +170,8 @@ export const TabButton = styled.div`
margin-left: 1rem;
margin-right: 0.5rem;
`;
export const TagButton = styled.button`
float: left;
width: 3rem;
height: 1.4rem;
border-radius: 0.1rem;
font-size: 0.6rem;
margin-top: 0.3rem;
margin-left: 0.5rem;
margin-bottom: 0.5rem;
background-color: white;
color: #707bf3;
`;
export const TagField = styled(Form.Field)`
width: 10.5rem;
float: left;
font-size: 0.8rem;
`;
export const TagContainer = styled.div`
float: left;
display: flex;
font-size: 0.8rem;
`;
export const Tagg = styled(Label)`
Expand All @@ -193,16 +182,7 @@ export const Tagg = styled(Label)`
margin-right: 0.4rem !important;
margin-bottom: 0.3rem !important;
`;

export const ContainerTop = styled.div`
width: 28rem;
max-width: 100%;
height: 9.5rem;
float: left;
/* background-color: grey; */
`;

export const ContainerTag = styled.div`
margin-top: 2.5rem;
padding-left: 7.7rem;
export const ContainerUE = styled.div`
display: flex;
height: 0.8rem;
`;
1 change: 1 addition & 0 deletions src/pages/Setting/SettingStyled.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const SettingContainer = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
background-color: gainsboro;

${media.desktop`
width: 60%;
Expand Down