Skip to content

Commit

Permalink
feat(Calendar): add auth placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
tymmesyde committed Jun 28, 2024
1 parent 4250c9b commit c7b3c31
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 22 deletions.
Binary file added images/calendar_placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 28 additions & 22 deletions src/routes/Calendar/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import useCalendar from './useCalendar';
import useSelectableInputs from './useSelectableInputs';
import Table from './Table/Table';
import List from './List/List';
import Placeholder from './Placeholder/Placeholder';
import styles from './Calendar.less';

type Props = {
Expand All @@ -22,29 +23,34 @@ const Calendar = ({ urlParams }: Props) => {

return (
<MainNavBars className={styles['calendar']} route={'calendar'}>
<div className={styles['content']}>
<div className={styles['main']}>
<div className={styles['inputs']}>
{
paginationInput !== null ?
<PaginationInput {...paginationInput} className={styles['pagination-input']} />
:
null
}
{
profile.auth !== null ?
<div className={styles['content']}>
<div className={styles['main']}>
<div className={styles['inputs']}>
{
paginationInput !== null ?
<PaginationInput {...paginationInput} className={styles['pagination-input']} />
:
null
}
</div>
<Table
items={calendar.items}
monthInfo={calendar.monthInfo}
onChange={setSelected}
/>
</div>
<List
items={calendar.items}
monthInfo={calendar.monthInfo}
profile={profile}
onChange={setSelected}
/>
</div>
<Table
items={calendar.items}
monthInfo={calendar.monthInfo}
onChange={setSelected}
/>
</div>
<List
items={calendar.items}
monthInfo={calendar.monthInfo}
profile={profile}
onChange={setSelected}
/>
</div>
:
<Placeholder />
}
</MainNavBars>
);
};
Expand Down
90 changes: 90 additions & 0 deletions src/routes/Calendar/Placeholder/Placeholder.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// Copyright (C) 2017-2024 Smart code 203358507

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

.placeholder {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
overflow-y: auto;

.title {
flex: none;
font-size: 1.75rem;
font-weight: 400;
text-align: center;
color: var(--primary-foreground-color);
margin-bottom: 1rem;
opacity: 0.5;
}

.image {
flex: none;
height: 14rem;
margin: 1.5rem 0;
}

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

.point {
display: flex;
flex-direction: row;
align-items: center;
gap: 1.5rem;
width: 18rem;

.icon {
flex: none;
height: 3.25rem;
width: 3.25rem;
color: var(--primary-foreground-color);
opacity: 0.3;
}

.text {
flex: auto;
font-size: 1.1rem;
font-size: 500;
color: var(--primary-foreground-color);
opacity: 0.9;
}
}
}

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

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

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

.overview {
flex-direction: column;
}
}
}
43 changes: 43 additions & 0 deletions src/routes/Calendar/Placeholder/Placeholder.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright (C) 2017-2024 Smart code 203358507

import React from 'react';
import { useTranslation } from 'react-i18next';
import Icon from '@stremio/stremio-icons/react';
import { Button, Image } from 'stremio/common';
import styles from './Placeholder.less';

const Placeholder = () => {
const { t } = useTranslation();

return (
<div className={styles['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['overview']}>
<div className={styles['point']}>
<Icon className={styles['icon']} name={'megaphone'} />
<div className={styles['text']}>
{t('NOT_LOGGED_IN_NOTIFICATIONS')}
</div>
</div>
<div className={styles['point']}>
<Icon className={styles['icon']} name={'calendar-thin'} />
<div className={styles['text']}>
{t('NOT_LOGGED_IN_CALENDAR')}
</div>
</div>
</div>
<Button className={styles['button']} href={'#/intro'}>
{t('LOG_IN')}
</Button>
</div>
);
};

export default Placeholder;

0 comments on commit c7b3c31

Please sign in to comment.