-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement table styling for seasonal planting guide
- Loading branch information
1 parent
f261738
commit 4571599
Showing
8 changed files
with
89 additions
and
112 deletions.
There are no files selected for viewing
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,28 +1,27 @@ | ||
import { | ||
MonthHeaderContainer, | ||
MonthsContainer, | ||
MonthsText, | ||
WhiteSpace, | ||
} from './styles'; | ||
import { P3 } from '@/styles/text'; | ||
import { MonthsContainer } from './styles'; | ||
|
||
const months = [ | ||
'Jan', | ||
'Feb', | ||
'Mar', | ||
'Apr', | ||
'May', | ||
'Jun', | ||
'Jul', | ||
'Aug', | ||
'Sep', | ||
'Oct', | ||
'Nov', | ||
'Dec', | ||
]; | ||
|
||
export default function MonthHeader() { | ||
return ( | ||
<MonthHeaderContainer> | ||
<WhiteSpace /> | ||
<MonthsContainer> | ||
<MonthsText>Jan</MonthsText> | ||
<MonthsText>Feb</MonthsText> | ||
<MonthsText>Mar</MonthsText> | ||
<MonthsText>Apr</MonthsText> | ||
<MonthsText>May</MonthsText> | ||
<MonthsText>Jun</MonthsText> | ||
<MonthsText>Jul</MonthsText> | ||
<MonthsText>Aug</MonthsText> | ||
<MonthsText>Sep</MonthsText> | ||
<MonthsText>Oct</MonthsText> | ||
<MonthsText>Nov</MonthsText> | ||
<MonthsText>Dec</MonthsText> | ||
</MonthsContainer> | ||
</MonthHeaderContainer> | ||
<MonthsContainer> | ||
{months.map((month, index) => ( | ||
<P3 key={index}>{month}</P3> | ||
))} | ||
</MonthsContainer> | ||
); | ||
} |
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,30 +1,9 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const MonthHeaderContainer = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
width: 100%; | ||
gap: 0.75rem; | ||
`; | ||
|
||
export const MonthsContainer = styled.div` | ||
display: grid; | ||
grid-template-columns: repeat(12, 1fr); | ||
gap: 0.75rem; | ||
/* gap: 0.75rem; */ | ||
width: 100%; | ||
justify-items: center; | ||
`; | ||
|
||
export const MonthsText = styled.p` | ||
color: #000; | ||
font-style: normal; | ||
font-size: 0.625rem; | ||
font-weight: 400; | ||
line-height: normal; | ||
text-align: center; | ||
`; | ||
|
||
export const WhiteSpace = styled.div` | ||
min-width: 10%; | ||
max-width: 10%; | ||
`; |
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,8 +1,28 @@ | ||
import styled from 'styled-components'; | ||
import { P3 } from '@/styles/text'; | ||
|
||
export const CalendarRowsContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
// Styled Table | ||
export const StyledTable = styled.table` | ||
width: 100%; | ||
border-spacing: 0; | ||
border-collapse: separate; | ||
`; | ||
|
||
// Make the plant_name sticky | ||
export const StickyTd = styled(P3).attrs({ | ||
as: 'td', | ||
})` | ||
// TODO: make this more compact | ||
width: auto; | ||
position: sticky; | ||
left: 0; | ||
background-color: white; // Optional: Adds a background color to keep text visible when scrolling | ||
z-index: 2; // Ensures the sticky header is on top of other content | ||
`; | ||
|
||
// Scrollable container for PlantCalendarRow | ||
export const ScrollableTd = styled.td` | ||
overflow-x: scroll; | ||
padding-bottom: 8px; | ||
// maybe replace with 4px above and below to center padding? | ||
`; |
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