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

chore(mainFooter): basic MainFooter template #114

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
100 changes: 52 additions & 48 deletions src/components/pages/ProfilePage/UserProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import SuperTooltip from 'components/atoms/SuperTooltip';
import GroupList from 'components/organisms/GroupList';
import ProfileStats from 'components/organisms/ProfileStats';
import Header from 'components/templates/Header';
import MainFooter from 'components/templates/MainFooter';
import ZaboList from 'components/templates/ZaboList';

import { logout as logoutAction } from 'store/reducers/auth';
Expand Down Expand Up @@ -54,54 +55,57 @@ const UserProfile = ({ profile }) => {
const groupsWithPending = useMemo (() => [...groups, ...pendingGroups.map (group => ({ ...group, isPending: true }))], [groups, pendingGroups]);

return (
<Page>
<Header type="upload" scrollHeader />
<Page.Header>
<Page.Header.Left>
<Page.Header.Left.ProfilePhoto>
{
profilePhoto
? <img src={profilePhoto} alt="profile photo" />
: <img src={defaultProfile} alt="default profile img" />
}
</Page.Header.Left.ProfilePhoto>
<Page.Header.Left.UserInfo>
<h1>{username}</h1>
<SuperTooltip title={description} hide={!showTooltip}>
<p ref={descRef}>{description || '아직 소개가 없습니다.'}</p>
</SuperTooltip>
{isMyProfile ? (
<section>
<Button.Group>
<Button onClick={logout}>로그아웃</Button>
<Button to="/settings/profile" border="main">{isMobile ? '편집' : '프로필 편집'}</Button>
{isAdmin && (<Button to="/admin">{isMobile ? '관리' : '관리자'}</Button>)}
</Button.Group>
</section>
) : (
// <sectino>
// {following
// ? <button onClick={follow} type="button">팔로우 취소</button>
// : <button onClick={follow} type="button">팔로우</button>}
// </sectino>
''
)}
</Page.Header.Left.UserInfo>
</Page.Header.Left>
<Page.Header.Right>
<ProfileStats stats={stats} />
</Page.Header.Right>
</Page.Header>
<Page.Body>
<Page.Body.User>
</Page.Body.User>
</Page.Body>
<GroupList type="profile" groups={groupsWithPending} hasApplyBox isMyProfile={isMyProfile} />
<Zabos>
<h1>저장한 자보</h1>
<ZaboList type="pins" query={username} key={username} />
</Zabos>
</Page>
<>
<Page>
<Header type="upload" scrollHeader />
<Page.Header>
<Page.Header.Left>
<Page.Header.Left.ProfilePhoto>
{
profilePhoto
? <img src={profilePhoto} alt="profile photo" />
: <img src={defaultProfile} alt="default profile img" />
}
</Page.Header.Left.ProfilePhoto>
<Page.Header.Left.UserInfo>
<h1>{username}</h1>
<SuperTooltip title={description} hide={!showTooltip}>
<p ref={descRef}>{description || '아직 소개가 없습니다.'}</p>
</SuperTooltip>
{isMyProfile ? (
<section>
<Button.Group>
<Button onClick={logout}>로그아웃</Button>
<Button to="/settings/profile" border="main">{isMobile ? '편집' : '프로필 편집'}</Button>
{isAdmin && (<Button to="/admin">{isMobile ? '관리' : '관리자'}</Button>)}
</Button.Group>
</section>
) : (
// <sectino>
// {following
// ? <button onClick={follow} type="button">팔로우 취소</button>
// : <button onClick={follow} type="button">팔로우</button>}
// </sectino>
''
)}
</Page.Header.Left.UserInfo>
</Page.Header.Left>
<Page.Header.Right>
<ProfileStats stats={stats} />
</Page.Header.Right>
</Page.Header>
<Page.Body>
<Page.Body.User>
</Page.Body.User>
</Page.Body>
<GroupList type="profile" groups={groupsWithPending} hasApplyBox isMyProfile={isMyProfile} />
<Zabos>
<h1>저장한 자보</h1>
<ZaboList type="pins" query={username} key={username} />
</Zabos>
</Page>
<MainFooter />
</>
);
};

Expand Down
21 changes: 21 additions & 0 deletions src/components/templates/MainFooter/MainFooter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';

import logo from 'static/logo/logo_white.svg';

import { MainFooterW } from './MainFooter.styled';

// TODO: white sparcs logo svg
const MainFooter = () => (
<MainFooterW>
<a href="https://sparcs.org" target="_blank" rel="noopener noreferrer">
<img alt="logo" src={logo} style={{ height: '25px' }} />
</a>
<MainFooterW.Links>
<MainFooterW.Button>만든 사람들</MainFooterW.Button>
<MainFooterW.Button>라이센스</MainFooterW.Button>
</MainFooterW.Links>
<MainFooterW.Contact>Contact:[email protected]</MainFooterW.Contact>
</MainFooterW>
);

export default MainFooter;
50 changes: 50 additions & 0 deletions src/components/templates/MainFooter/MainFooter.styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import styled from 'styled-components';

export const MainFooterW = styled.div`
position: relative;
left: 0;
bottom: 0;
height: 50px;
color: white;
background-color: #143441;
padding: 0 24px;

display: flex;
align-items: center;

@media(max-width: 910px) {
padding: 0 16px;
}
`;

MainFooterW.Links = styled.div`
font-size: 15px;
line-height: 17px;
font-weight: 700;
margin-left: 40px;

flex: 1;
display: flex;
align-items: center;
@media(max-width: 910px) {
justify-content: flex-end;
}
`;

MainFooterW.Button = styled.div`
margin-left: 24px;
cursor: pointer;

@media(max-width: 910px) {
margin-left: 12px;
}
`;

MainFooterW.Contact = styled.div`
font-size: 13px;
font-weight: 700;

@media(max-width: 910px) {
display: none;
}
`;
1 change: 1 addition & 0 deletions src/components/templates/MainFooter/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './MainFooter';