File tree Expand file tree Collapse file tree 4 files changed +31
-24
lines changed Expand file tree Collapse file tree 4 files changed +31
-24
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,8 @@ import PropTypes from 'prop-types';
33import styled from 'styled-components' ;
44
55const BodyComponent = styled . div `
6- color: #002a3a;
76 font-size: 0.9em;
8- padding-bottom: 20px ;
7+ padding-bottom: 30px ;
98 padding-left: 15px;
109 position: relative;
1110
@@ -14,8 +13,8 @@ const BodyComponent = styled.div`
1413 }
1514
1615 &::before {
17- background-color: #ccc;
1816 content: '';
17+ background-color: #cccccc;
1918 height: 100%;
2019 left: -3px;
2120 min-height: 95%;
@@ -26,8 +25,10 @@ const BodyComponent = styled.div`
2625` ;
2726
2827const BodyComponentTitle = styled . p `
28+ color: #002a3a;
2929 font-weight: bold;
30- margin-bottom: 5px;
30+ margin-bottom: 10px;
31+ font-size: 18px;
3132 margin-top: 0;
3233 text-align: left;
3334` ;
Original file line number Diff line number Diff line change @@ -27,31 +27,38 @@ const YearComponentItem = styled.div`
2727 margin-bottom: 8px;
2828` ;
2929
30- const compare = ( a , b ) => {
31- if ( a < b ) return 1 ;
32- if ( b < a ) return - 1 ;
33- return 0 ;
34- } ;
35-
36- const handleEachYears = years =>
37- years . sort ( compare ) . map ( year => (
38- < YearComponentItem key = { year } className = "item-year-component" >
39- { year }
40- </ YearComponentItem >
41- ) ) ;
42-
4330const ContentYear = props => {
44- const { years } = props ;
31+ const { startYear , endYear , current } = props ;
4532
4633 return (
4734 < YearComponent className = "year-component" >
48- { handleEachYears ( years ) }
35+ { current ? (
36+ < >
37+ < YearComponentItem className = "item-year-component" >
38+ { endYear }
39+ </ YearComponentItem >
40+ < YearComponentItem className = "item-year-component" >
41+ { startYear }
42+ </ YearComponentItem >
43+ </ >
44+ ) : (
45+ < YearComponentItem className = "item-year-component" >
46+ { startYear }
47+ </ YearComponentItem >
48+ ) }
4949 </ YearComponent >
5050 ) ;
5151} ;
5252
53+ ContentYear . defaultProps = {
54+ current : false ,
55+ endYear : 0
56+ } ;
57+
5358ContentYear . propTypes = {
54- years : PropTypes . arrayOf ( PropTypes . string ) . isRequired
59+ startYear : PropTypes . number . isRequired ,
60+ endYear : PropTypes . number ,
61+ current : PropTypes . bool
5562} ;
5663
5764export default ContentYear ;
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ import PropTypes from 'prop-types';
33import styled from 'styled-components' ;
44
55const DescriptionComponent = styled . div `
6- margin-bottom: 10px;
7- margin-top: 10px;
6+ margin-top: 5px;
87 text-align: left;
98` ;
109
You can’t perform that action at this time.
0 commit comments