Skip to content

Commit

Permalink
Merge pull request #845 from Stremio/fix/calendar-mobile-placeholder
Browse files Browse the repository at this point in the history
Calendar: Fix placeholder responsiveness
  • Loading branch information
kKaskak authored Feb 24, 2025
2 parents c91758f + bf37815 commit 235d09f
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 38 deletions.
5 changes: 2 additions & 3 deletions src/components/MainNavBars/MainNavBars.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@

.nav-content-container {
position: absolute;
padding-top: calc(var(--horizontal-nav-bar-size) + var(--safe-area-inset-top));
top: 0;
top: calc(var(--horizontal-nav-bar-size) + var(--safe-area-inset-top));
right: 0;
bottom: 0;
left: var(--vertical-nav-bar-size);
Expand All @@ -43,7 +42,7 @@
.main-nav-bars-container {
.nav-content-container {
left: 0;
padding-bottom: var(--vertical-nav-bar-size);
bottom: var(--vertical-nav-bar-size);
}

.vertical-nav-bar {
Expand Down
87 changes: 60 additions & 27 deletions src/routes/Calendar/Placeholder/Placeholder.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
min-height: 100%;
width: 100%;
overflow-y: auto;

.title {
flex: none;
font-size: 1.75rem;
font-weight: 400;
text-align: center;
Expand All @@ -22,19 +21,22 @@
opacity: 0.5;
}

.image {
flex: none;
height: 14rem;
margin: 1.5rem 0;
.image-container {
padding: 1.5rem 0;

.image {
height: 100%;
max-height: 14rem;
object-fit: contain;
}
}

.overview {
flex: none;
display: flex;
flex-direction: row;
align-items: center;
gap: 4rem;
margin-bottom: 3rem;
margin-bottom: 1rem;

.point {
display: flex;
Expand All @@ -61,39 +63,70 @@
}
}

.button {
flex: none;
justify-content: center;
height: 4rem;
line-height: 4rem;
padding: 0 5rem;
font-size: 1.1rem;
color: var(--primary-foreground-color);
text-align: center;
border-radius: 3.5rem;
background-color: var(--overlay-color);
.button-container {
margin: 1rem 0;

.button {
display: flex;
justify-content: center;
height: 4rem;
line-height: 4rem;
padding: 0 5rem;
font-size: 1.1rem;
color: var(--primary-foreground-color);
text-align: center;
border-radius: 3.5rem;
background-color: var(--overlay-color);

&:hover {
outline: var(--focus-outline-size) solid var(--primary-foreground-color);
background-color: transparent;
&:hover {
outline: var(--focus-outline-size) solid var(--primary-foreground-color);
background-color: transparent;
}
}
}
}

@media only screen and (max-width: @minimum) {
@media only screen and (max-width: @xsmall) {
.placeholder {
padding: 1rem 2rem;

.image {
height: 10rem;
.title {
margin-bottom: 0;
}

.image-container {
padding: 1rem;

.image {
max-height: 10rem;
}
}

.button-container {
margin: 1rem 0 0;
}
}
}

@media only screen and (max-width: @minimum) {
.placeholder {
padding: 1rem 2rem;

.overview {
flex-direction: column;
gap: 1rem;

.point {
.text {
font-size: 1rem;
}
}
}

.button {
width: 100%;
.button-container {
.button {
width: 100%;
}
}
}
}
20 changes: 12 additions & 8 deletions src/routes/Calendar/Placeholder/Placeholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ const Placeholder = () => {
<div className={styles['title']}>
{t('CALENDAR_NOT_LOGGED_IN')}
</div>
<Image
className={styles['image']}
src={require('/images/calendar_placeholder.png')}
alt={' '}
/>
<div className={styles['image-container']}>
<Image
className={styles['image']}
src={require('/images/calendar_placeholder.png')}
alt={' '}
/>
</div>
<div className={styles['overview']}>
<div className={styles['point']}>
<Icon className={styles['icon']} name={'megaphone'} />
Expand All @@ -33,9 +35,11 @@ const Placeholder = () => {
</div>
</div>
</div>
<Button className={styles['button']} href={'#/intro?form=login'}>
{t('LOG_IN')}
</Button>
<div className={styles['button-container']}>
<Button className={styles['button']} href={'#/intro?form=login'}>
{t('LOG_IN')}
</Button>
</div>
</div>
);
};
Expand Down

0 comments on commit 235d09f

Please sign in to comment.