Skip to content

Commit

Permalink
refactor(Calendar): improve responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
tymmesyde committed Jul 4, 2024
1 parent a561ee0 commit 4c4a41a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/routes/Calendar/List/List.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
overflow-y: auto;
}

@media only screen and (max-width: @minimum) and (orientation: portrait) {
@media only screen and (max-width: @small) and (orientation: portrait) {
.list {
display: none;
}
Expand Down
36 changes: 33 additions & 3 deletions src/routes/Calendar/Table/Cell/Cell.less
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// Copyright (C) 2017-2024 Smart code 203358507

@import (reference) '~stremio/common/screen-sizes.less';

.cell {
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 1rem;
background-color: var(--overlay-color);
border: 0.15rem solid transparent;
overflow: hidden;
Expand All @@ -21,7 +24,7 @@
.heading {
flex: none;
position: relative;
padding: 1rem;
padding: 1rem 1rem 0 1rem;

.day {
position: relative;
Expand All @@ -37,7 +40,7 @@
}
}

.body {
.items {
flex: 1 1 auto;
position: relative;
display: flex;
Expand Down Expand Up @@ -103,7 +106,7 @@
}

&.past {
.body {
.items {
opacity: 0.5;
}
}
Expand All @@ -116,3 +119,30 @@
border-color: var(--overlay-color);
}
}

@media only screen and (max-width: @minimum) and (orientation: portrait) {
.cell {
gap: 1rem;

.items {
.item {
border-radius: 0.25rem;
}
}
}
}

@media only screen and (max-width: @small) and (orientation: landscape) {
.cell {
flex-direction: row;
align-items: center;

.heading {
padding: 1rem;
}

.items {
display: none;
}
}
}
2 changes: 1 addition & 1 deletion src/routes/Calendar/Table/Cell/Cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Cell = ({ selected, monthInfo, date, items, onClick }: Props) => {
{date.day}
</div>
</div>
<HorizontalScroll className={styles['body']}>
<HorizontalScroll className={styles['items']}>
{
items.map(({ id, name, poster, deepLinks }) => (
<Button key={id} className={styles['item']} href={deepLinks.metaDetailsStreams}>
Expand Down

0 comments on commit 4c4a41a

Please sign in to comment.