-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat(app, home): emotion 기반으로 홈 배너와 홈 페이지 컨테이너 로직을 변경합니다. #77
Changes from all commits
92e7ed8
240dc71
625303d
a42d9dd
0560aa3
8a746b0
b3ab47e
9e145ba
61a3dcc
b13fe19
a637e81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styled from '@emotion/styled'; | ||
import { Banner, BannerTitle } from '../shared/banner/Banner.styled'; | ||
|
||
export const HomeBannerContainer = styled(Banner)` | ||
background: #5cb85c; | ||
box-shadow: | ||
inset 0 8px 8px -8px rgba(0, 0, 0, 0.3), | ||
inset 0 -8px 8px -8px rgba(0, 0, 0, 0.3); | ||
text-align: center; | ||
`; | ||
|
||
export const HomeBannerTitle = styled(BannerTitle)` | ||
text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3); | ||
font-weight: 700; | ||
font-size: 3.5rem; | ||
padding-bottom: 0.5rem; | ||
margin-bottom: 0px; | ||
font-family: 'Titillium Web', sans-serif; | ||
`; | ||
|
||
export const HomeBannerText = styled.p` | ||
color: #fff; | ||
font-size: 1.5rem; | ||
font-weight: 300; | ||
margin-bottom: 0px; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { | ||
HomeBannerContainer, | ||
HomeBannerText, | ||
HomeBannerTitle, | ||
} from './HomeBanner.styled'; | ||
|
||
export const HomeBanner: React.FC = () => { | ||
return ( | ||
<div className="home-page"> | ||
<div className="banner"> | ||
<div className="container"> | ||
<h1 className="logo-font">conduit</h1> | ||
<p>A place to share your knowledge.</p> | ||
</div> | ||
</div> | ||
</div> | ||
<HomeBannerContainer> | ||
<HomeBannerTitle>conduit</HomeBannerTitle> | ||
<HomeBannerText>A place to share your knowledge.</HomeBannerText> | ||
</HomeBannerContainer> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,28 @@ | ||
interface HomePageContainerProps { | ||
children: React.ReactNode; | ||
} | ||
import { ReactNode } from 'react'; | ||
import styled from '@emotion/styled'; | ||
|
||
const HomePageContainer: React.FC<HomePageContainerProps> = ({ children }) => { | ||
return <div className="home-page">{children}</div>; | ||
type ContainerProps = { | ||
children?: ReactNode; | ||
}; | ||
|
||
export const HomePageContainer = ({ children }: ContainerProps) => { | ||
return <Container>{children}</Container>; | ||
}; | ||
|
||
const Container = styled.div` | ||
&.home-page .feed-toggle { | ||
margin-bottom: -1px; | ||
} | ||
|
||
&.home-page .sidebar { | ||
padding: 5px 10px 10px 10px; | ||
background: #f3f3f3; | ||
border-radius: 4px; | ||
} | ||
|
||
&.home-page .sidebar p { | ||
margin-bottom: 0.2rem; | ||
} | ||
`; | ||
|
||
export default HomePageContainer; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const Container = styled.div` | ||
margin-left: auto; | ||
margin-right: auto; | ||
padding-left: 15px; | ||
padding-right: 15px; | ||
|
||
@media (min-width: 544px) { | ||
max-width: 576px; | ||
} | ||
|
||
@media (min-width: 768px) { | ||
max-width: 720px; | ||
} | ||
|
||
@media (min-width: 992px) { | ||
max-width: 940px; | ||
} | ||
|
||
@media (min-width: 1200px) { | ||
max-width: 1140px; | ||
} | ||
Comment on lines
+9
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이렇게 반응형 미디어 쿼리를 여러 곳에서 사용하게 되면 아래와 같은 상황이 헷갈리게 됩니다.
그래서 보통은, 디자인 토큰이나 상수로 width 값을 관리하게 됩니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
오 그렇군요 이 부분은 향후 더 좋은 방향을 접하는대로 조금씩 개선해 나가겠습니다! |
||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const Banner = styled.div` | ||
color: #fff; | ||
background: #333; | ||
padding: 2rem; | ||
margin-bottom: 2rem; | ||
`; | ||
|
||
export const BannerTitle = styled.h1` | ||
text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3); | ||
margin-bottom: 0px; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ReactNode } from 'react'; | ||
import { Navbar } from './NavBar'; | ||
import { Footer } from './Footer'; | ||
|
||
type LayoutProps = { | ||
children?: ReactNode; | ||
}; | ||
|
||
export const Layout = ({ children }: LayoutProps) => { | ||
return ( | ||
<> | ||
<Navbar /> | ||
{children} | ||
<Footer /> | ||
</> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Layout.tsx'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React.FC
를 사용하지 말라는 여러가지 커뮤니티의 의견이 있는데요,function
기명식 컴포넌트 선언에서는 타이핑 함수를 사용할 수가 없습니다.defaultProps
를 사용할 수 없게 합니다.더 자세한 내용을 보고 싶다면 이 블로그를 참조하면 좋을 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코멘트 감사합니다! 블로그 포함해서 관련 내용은 더 살펴봐야겠지만 우선은 안 쓰는 방향으로 반영해나갈게요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이후 PR에서 반영했습니다!