Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit1a91511

Browse files
committed
refactor(meetup): make DateSelector responsive
1 parenta2c2142 commit1a91511

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

‎src/containers/content/MeetupsContent/DateSelector/Cell.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ import {
1515
constweekends=[5,6,18,19,27,28]
1616
constactivitiesDates=[3,4,19,23,24]
1717

18-
constCell=({ item})=>{
18+
constCell=({ item, isLeapMonth})=>{
1919
return(
20-
<Wrapperkey={item.id}active={contains(item.id,activitiesDates)}>
20+
<Wrapper
21+
key={item.id}
22+
active={contains(item.id,activitiesDates)}
23+
isLeapMonth={isLeapMonth}
24+
>
2125
<Head>
2226
<DateTextactive={item.id===9}>{item.date}</DateText>
2327
{contains(item.id,weekends)&&<WeekendHint></WeekendHint>}

‎src/containers/content/MeetupsContent/DateSelector/index.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const fillItems = () => {
2626
constDateSelector=()=>{
2727
fillItems()
2828
constitems=dates
29+
constisLeapMonth=!!items[30]
2930

3031
return(
3132
<Wrapper>
@@ -34,12 +35,12 @@ const DateSelector = () => {
3435
<CellsWrapper>
3536
<DatesWrapper>
3637
{items.slice(0,15).map(item=>(
37-
<Cellkey={item.id}item={item}/>
38+
<Cellkey={item.id}item={item}isLeapMonth={isLeapMonth}/>
3839
))}
3940
</DatesWrapper>
4041
<DatesWrapper>
4142
{items.slice(15).map(item=>(
42-
<Cellkey={item.id}item={item}/>
43+
<Cellkey={item.id}item={item}isLeapMonth={isLeapMonth}/>
4344
))}
4445
</DatesWrapper>
4546
</CellsWrapper>

‎src/containers/content/MeetupsContent/styles/date_selector/cell.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ export const Wrapper = styled.div`
77
${cs.flexColumn('justify-between')};
88
border: 1px solid;
99
border-color: #004354;
10-
width: 55px;
10+
width:${({ isLeapMonth})=>(isLeapMonth ?'50px' :'55px')};
1111
height: 45px;
1212
padding-left: 3px;
1313
background:${({ active})=>(active ?'#003b4c' :'#04303c')};
1414
border-top-color:${({ active})=>(active ?'#3680AD' :'#004354')};
15+
@media (max-width: 1255px) {
16+
width: 50px;
17+
}
1518
`
1619
exportconstWeekName=styled.div`
1720
${cs.flex('align-both')};

‎src/containers/content/MeetupsContent/styles/date_selector/index.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const CellsWrapper = styled.div`
1616
margin-left: 15px;
1717
`
1818
exportconstDatesWrapper=styled.div`
19+
position: relative;
1920
${cs.flex()}
2021
flex-wrap: wrap;
2122
width: 100%;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp