mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 15:52:02 +00:00
Library dropdowns added to view
This commit is contained in:
parent
e905de7ffd
commit
5b22240220
2 changed files with 48 additions and 10 deletions
|
|
@ -1,16 +1,22 @@
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
const { MainNavBar } = require('stremio/common');
|
const { Dropdown, MainNavBar } = require('stremio/common');
|
||||||
|
const useLibrary = require('./useLibrary');
|
||||||
const styles = require('./styles');
|
const styles = require('./styles');
|
||||||
|
|
||||||
class Library extends React.Component {
|
const Library = ({ urlParams, queryParams }) => {
|
||||||
render() {
|
const [items, dropdowns] = useLibrary(urlParams.type, queryParams.get('sort'));
|
||||||
return (
|
return (
|
||||||
<div className={styles['library-container']}>
|
<div className={styles['library-container']}>
|
||||||
<MainNavBar />
|
<MainNavBar className={styles['nav-bar']} />
|
||||||
<div className={styles['library-content']} />
|
<div className={styles['library-content']}>
|
||||||
|
<div className={styles['dropdowns-container']}>
|
||||||
|
{dropdowns.map((dropdown) => (
|
||||||
|
<Dropdown {...dropdown} key={dropdown.name} className={styles['dropdown']} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
</div>
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Library;
|
module.exports = Library;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,43 @@
|
||||||
|
@import (reference) 'common/screen-sizes.less';
|
||||||
|
|
||||||
.library-container {
|
.library-container {
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
background-color: var(--color-background);
|
background-color: var(--color-background);
|
||||||
|
|
||||||
|
.nav-bar {
|
||||||
|
flex: none;
|
||||||
|
align-self: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
.library-content {
|
.library-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr auto;
|
||||||
|
grid-template-rows: auto 1fr;
|
||||||
|
grid-template-areas:
|
||||||
|
"dropdowns-area switch-view-area"
|
||||||
|
"meta-items-area meta-items-area";
|
||||||
|
|
||||||
|
.dropdowns-container {
|
||||||
|
grid-area: dropdowns-area;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
margin: 2rem;
|
||||||
|
|
||||||
|
.dropdown {
|
||||||
|
flex-grow: 0;
|
||||||
|
flex-shrink: 1;
|
||||||
|
flex-basis: 17rem;
|
||||||
|
height: 3rem;
|
||||||
|
|
||||||
|
&:not(:last-child) {
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue