-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
9 changed files
with
121 additions
and
22 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// Duck 패턴 https://github.com/JisuPark/ducks-modular-redux | ||
|
||
const initialState = { | ||
loading: false, | ||
data: null, | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,92 @@ | ||
/* eslint-disable react/prop-types */ | ||
import React from 'react'; | ||
import { useSelector } from 'react-redux'; | ||
import styled from 'styled-components/macro'; | ||
import styled, { css } from 'styled-components/macro'; | ||
import bearIcon from '../Assets/icons8-beer-glass-96.png'; | ||
|
||
const Home = () => { | ||
const beerList = useSelector(s => s.beerListReducer.data); | ||
const Home = ({ history }) => { | ||
const beerList = useSelector(s => s.beerListReducer); | ||
|
||
return <h1>{`저장된 맥주 정보 ${beerList?.length || 0}개`}</h1>; | ||
return ( | ||
<S.Container> | ||
<h1> | ||
저장된 맥주 정보 <span>{`${beerList.data?.length ?? 0}개`}</span> | ||
</h1> | ||
<button type="button" onClick={() => history.push('/beerlist')}> | ||
<h2>맥주 리스트 보러가기</h2> | ||
<img src={bearIcon} alt="bearIcon" /> | ||
</button> | ||
</S.Container> | ||
); | ||
}; | ||
|
||
const S = {}; | ||
|
||
S.LineStyle = css` | ||
:after { | ||
background: none repeat scroll 0 0 transparent; | ||
bottom: 0; | ||
content: ''; | ||
display: block; | ||
height: 8px; | ||
left: 50%; | ||
position: absolute; | ||
background: ${({ theme }) => theme.$hover}; | ||
transition: width 0.3s ease 0s, left 0.3s ease 0s; | ||
width: 0; | ||
} | ||
:hover:after { | ||
width: 100%; | ||
left: 0; | ||
} | ||
`; | ||
|
||
S.Container = styled.section` | ||
background: ${({ theme }) => theme.$background}; | ||
height: calc(100vh - 64px); | ||
display: grid; | ||
place-content: center; | ||
button { | ||
background: none; | ||
border: none; | ||
cursor: pointer; | ||
} | ||
h1, | ||
h2 { | ||
color: white; | ||
text-decoration: none; | ||
display: inline-block; | ||
padding: 30px 0; | ||
position: relative; | ||
} | ||
h1 { | ||
margin-top: -10vh; | ||
font-size: 10vh; | ||
span { | ||
background: ${({ theme }) => theme.$highlight}; | ||
border-radius: 5px; | ||
padding: 0 10px; | ||
} | ||
} | ||
h2 { | ||
margin-top: -5vh; | ||
font-size: 5vh; | ||
${S.LineStyle} | ||
:hover { | ||
color: ${({ theme }) => theme.$hover}; | ||
} | ||
} | ||
img { | ||
height: 60px; | ||
position: relative; | ||
top: -10px; | ||
} | ||
`; | ||
|
||
export default Home; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default { | ||
$background: '#001529', | ||
$highlight: '#1890FF', | ||
$hover: '#03CEA4', | ||
$yellow: '#F7FF58', | ||
$orange: '#FF934F', | ||
}; |