Toggle navigation
Toggle navigation
This project
Loading...
Sign in
HyeonJun Jeon
/
Extended-Calendar
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
HyeonJun Jeon
2022-05-27 14:41:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
945cc99e9c18d0c73ceaf74ae44406155956eeed
945cc99e
1 parent
ef7ec14b
[Style] Change calendar layout from flex to grid
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
27 deletions
src/components/Grid.js
src/components/GridRow.js
src/styles/Month.css
src/components/Grid.js
View file @
945cc99
import
GridRow
from
"./GridRow.js"
;
import
{
CalendarStateContext
}
from
"../pages/Calendar"
;
import
{
moveDate
,
toSunday
}
from
"../utils/Dates"
;
import
React
,
{
useContext
}
from
"react"
;
import
GridItem
from
"./GridItem.js"
;
const
Grid
=
()
=>
{
const
{
state
}
=
useContext
(
CalendarStateContext
);
...
...
@@ -13,9 +13,9 @@ const Grid = () => {
ndate
.
setDate
(
1
);
toSunday
(
ndate
);
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
rows
.
push
(
<
Grid
Row
key
=
{
i
}
star
tDate
=
{
new
Date
(
ndate
)}
/>
)
;
moveDate
(
ndate
,
"
week
"
,
1
);
for
(
let
i
=
0
;
i
<
3
5
;
i
++
)
{
rows
.
push
(
<
Grid
Item
key
=
{
i
}
targe
tDate
=
{
new
Date
(
ndate
)}
/>
)
;
moveDate
(
ndate
,
"
day
"
,
1
);
}
return
rows
;
...
...
src/components/GridRow.js
deleted
100644 → 0
View file @
ef7ec14
import
{
moveDate
}
from
"../utils/Dates"
;
import
GridItem
from
"./GridItem"
;
const
GridRow
=
({
startDate
})
=>
{
const
renderItems
=
()
=>
{
const
items
=
[];
const
ndate
=
new
Date
(
startDate
);
for
(
let
i
=
0
;
i
<
7
;
i
++
)
{
items
.
push
(
<
GridItem
key
=
{
i
}
targetDate
=
{
new
Date
(
ndate
)}
/>
)
;
moveDate
(
ndate
,
"day"
,
1
);
}
return
items
;
};
return
<
div
className
=
"GridRow"
>
{
renderItems
()}
<
/div>
;
};
export
default
GridRow
;
src/styles/Month.css
View file @
945cc99
...
...
@@ -23,7 +23,6 @@
padding
:
10px
5px
10px
5px
;
}
.GridRow
,
.GridHead
{
display
:
flex
;
}
...
...
@@ -33,8 +32,8 @@
}
.Grid
{
display
:
flex
;
flex-direction
:
column
;
display
:
grid
;
grid-template-columns
:
1
fr
1
fr
1
fr
1
fr
1
fr
1
fr
1
fr
;
overflow-y
:
auto
;
height
:
calc
(
100vh
-
85px
-
50px
);
border
:
solid
thin
gray
;
...
...
Please
register
or
login
to post a comment