diff --git a/package-old.json b/package-old.json
deleted file mode 100644
index 09e2654..0000000
--- a/package-old.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "scripts": {
- "start": "web-dev-server --app-index index.html --node-resolve",
- "build": "rimraf dist && node fix-open-wc-build.js && rollup -c rollup.config.js",
- "start:build": "web-dev-server --root-dir dist --app-index index.html"
- },
- "dependencies": {
- "@dreamworld/dw-button": "^2.1.2",
- "@dreamworld/dw-dialog": "^3.4.0",
- "@dreamworld/dw-icon": "^2.1.1",
- "@dreamworld/dw-icon-button": "^2.1.3",
- "@dreamworld/dw-list-item": "^2.1.0",
- "@dreamworld/dw-switch": "^2.1.0",
- "@dreamworld/dw-tooltip": "^2.1.1",
- "@dreamworld/hammerjs": "^1.0.1",
- "@dreamworld/material-styles": "^1.3.1",
- "@dreamworld/pwa-helpers": "^1.11.1",
- "@dreamworld/router": "^1.0.0",
- "@dw/i18next-esm": "^15.0.9",
- "i18next-xhr-backend": "^3.2.2",
- "lit": "^2.0.0",
- "redux": "^4.1.1",
- "redux-thunk": "^2.3.0",
- "reselect": "^4.0.0",
- "tippy.js": "^6.3.3"
- },
- "devDependencies": {
- "@open-wc/building-rollup": "^1.10.0",
- "@rollup/plugin-commonjs": "^20.0.0",
- "@semantic-release/gitlab": "^6.0.7",
- "@web/dev-server": "^0.1.18",
- "rimraf": "^2.6.3",
- "rollup": "^2.3.4",
- "rollup-plugin-copy": "^3.4.0",
- "rollup-plugin-minify-html-literals": "^1.2.6",
- "semantic-release": "^17.0.8"
- },
- "engines": {
- "yarn": "1.22.11",
- "node": "14.17.6"
- }
-}
diff --git a/package.json b/package.json
index 7893091..f0f6c6f 100644
--- a/package.json
+++ b/package.json
@@ -10,39 +10,41 @@
"start:build": "web-dev-server --root-dir dist --app-index index.html"
},
"dependencies": {
- "@dreamworld/dw-button": "^2.1.2",
- "@dreamworld/dw-dialog": "^3.4.0",
- "@dreamworld/dw-icon": "^2.1.1",
- "@dreamworld/dw-icon-button": "^2.1.3",
- "@dreamworld/dw-input": "^2.1.6",
- "@dreamworld/dw-list-item": "^2.1.0",
- "@dreamworld/dw-switch": "^2.1.0",
- "@dreamworld/dw-tooltip": "^2.1.1",
+ "@dreamworld/dw-dialog": "^4.1.2",
+ "@dreamworld/dw-list-item": "^3.4.0",
"@dreamworld/hammerjs": "^1.0.1",
- "@dreamworld/material-styles": "^1.3.1",
+ "@dreamworld/material-styles": "^2.5.0",
"@dreamworld/pwa-helpers": "^1.11.1",
"@dreamworld/router": "^1.0.0",
"@dw/i18next-esm": "^15.0.9",
- "@lit-labs/virtualizer": "^0.6.0",
+ "@material/mwc-button": "^0.27.0",
+ "@material/mwc-icon": "^0.27.0",
+ "@material/mwc-icon-button": "^0.27.0",
+ "@material/mwc-textfield": "^0.27.0",
"i18next-xhr-backend": "^3.2.2",
- "lit": "^2.0.0",
+ "lit": "^2.3.1",
"lodash-es": "^4.17.21",
- "moment": "^2.29.1",
- "redux": "^4.1.1",
- "redux-saga": "^1.1.3",
- "redux-thunk": "^2.3.0",
- "reselect": "^4.0.0"
+ "moment": "^2.29.4",
+ "redux": "^4.2.0",
+ "redux-saga": "^1.2.1",
+ "redux-thunk": "^2.4.1",
+ "reselect": "^4.1.6"
},
"devDependencies": {
- "@open-wc/building-rollup": "^2.0.1",
- "@rollup/plugin-commonjs": "^21.0.1",
- "@rollup/plugin-node-resolve": "^13.1.1",
- "@web/dev-server": "^0.1.25",
+ "@open-wc/building-rollup": "^2.0.2",
+ "@rollup/plugin-commonjs": "^22.0.2",
+ "@rollup/plugin-node-resolve": "^14.0.1",
+ "@web/dev-server": "^0.1.34",
"@web/rollup-plugin-copy": "^0.3.0",
- "@web/rollup-plugin-html": "^1.10.1",
- "rollup": "^2.62.0",
+ "@web/rollup-plugin-html": "^1.11.0",
+ "rollup": "^2.79.0",
"rollup-plugin-minify-html-literals": "^1.2.6",
- "rollup-plugin-summary": "^1.3.0",
+ "rollup-plugin-summary": "^1.4.3",
"rollup-plugin-terser": "^7.0.2"
+ },
+ "resolutions": {
+ "@material/mwc-ripple": "^0.27.0",
+ "@material/mwc-icon": "^0.27.0",
+ "@material/mwc-icon-button": "^0.27.0"
}
}
diff --git a/rollup.config.js b/rollup.config.js
index fcdc7fc..1dd6a6a 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,29 +1,37 @@
+// Import rollup plugins
import html from "@web/rollup-plugin-html";
-import {copy} from "@web/rollup-plugin-copy";
+import { copy } from "@web/rollup-plugin-copy";
import resolve from "@rollup/plugin-node-resolve";
-import {terser} from "rollup-plugin-terser";
+import { terser } from "rollup-plugin-terser";
import minifyHTML from "rollup-plugin-minify-html-literals";
import summary from "rollup-plugin-summary";
export default {
plugins: [
+ // Entry point for application build; can specify a glob to build multiple
+ // HTML files for non-SPA app
html({
- input: 'index.html',
+ input: "index.html",
}),
+ // Resolve bare module specifiers to relative paths
resolve(),
+ // Minify HTML template literals
minifyHTML(),
+ // Minify JS
terser({
ecma: 2021,
module: true,
warnings: true,
}),
+ // Print bundle summary
summary(),
+ // Optional: copy any static assets to build directory
copy({
- patterns: ['src/img/**/*', 'src/locales/**/*']
- })
+ patterns: ["src/img/**/*", "src/locales/**/*"],
+ }),
],
output: {
- dir: 'dist',
+ dir: "dist",
},
- preserveEntrySignatures: 'strict',
-};
\ No newline at end of file
+ preserveEntrySignatures: "strict",
+};
diff --git a/src/app-section.js b/src/app-section.js
index 6a7c718..8e23924 100644
--- a/src/app-section.js
+++ b/src/app-section.js
@@ -2,22 +2,21 @@ import { LitElement, html, css } from "lit";
//Redux
import { connect } from "pwa-helpers/connect-mixin.js";
-import { store } from './redux/store';
+import { store } from "./redux/store";
import * as app from "./redux/app";
-import * as router from './redux/router';
+import * as router from "./redux/router";
//Views
-import './views/header/app-header';
+import "./views/header/app-header";
export class AppSection extends connect(store)(LitElement) {
-
static styles = css`
- :host{
+ :host {
flex: 1;
display: flex;
}
- .backdrop{
+ .backdrop {
flex: 1 1 0%;
background-color: rgba(0, 0, 0, 0);
z-index: -9;
@@ -27,12 +26,12 @@ export class AppSection extends connect(store)(LitElement) {
transition: background-color var(--drawer-open-time);
}
- .backdrop[opened]{
+ .backdrop[opened] {
background-color: rgba(0, 0, 0, 0.8);
z-index: 3;
}
- .section{
+ .section {
flex: 1;
position: relative;
display: flex;
@@ -40,15 +39,15 @@ export class AppSection extends connect(store)(LitElement) {
transition: margin-left var(--drawer-open-time);
}
- :host([layout='desktop']) .section{
+ :host([layout="desktop"]) .section {
padding: 4px;
}
- :host([layout='desktop']) .section[opened]{
+ :host([layout="desktop"]) .section[opened] {
margin-left: calc(var(--drawer-width) + 16px);
}
- .body{
+ .body {
display: flex;
margin-top: 56px;
}
@@ -60,15 +59,15 @@ export class AppSection extends connect(store)(LitElement) {
reflect: true,
},
drawerOpened: {
- type: String
+ type: String,
},
_page: {
- type: String
+ type: String,
},
_id: {
- type: Number
+ type: Number,
},
- }
+ };
constructor() {
super();
@@ -79,7 +78,6 @@ export class AppSection extends connect(store)(LitElement) {
}
_getInitView() {
-
return this._getInitView();
}
@@ -88,68 +86,69 @@ export class AppSection extends connect(store)(LitElement) {
${this._getBackdropVew()}
-
- ${this._getPageView()}
-
+
${this._getPageView()}
`;
}
_getBackdropVew() {
- return this.layout === 'mobile'
- ? html``
+ return this.layout === "mobile"
+ ? html``
: html``;
}
_getPageView() {
-
if (this._page === "root" || this._page === "home") {
- import('./views//home/app-home');
- return html``
+ import("./views//home/app-home");
+ return html``;
}
if (this._page === "shows") {
- import('./views/tv-shows/tv-shows.js');
+ import("./views/tv-shows/tv-shows.js");
return html``;
}
if (this._page === "movies" && this._id === undefined) {
- import('./views/movies/app-movies');
+ import("./views/movies/app-movies");
return html``;
}
if (this._page === "movies" && this._id !== undefined) {
- import('./views/movies/movie-details');
+ import("./views/movies/movie-details");
return html``;
}
if (this._page === "person" && this._id === undefined) {
- import('./views/person/app-person');
+ import("./views/person/app-person");
return html``;
}
if (this._page === "person" && this._id !== undefined) {
- import('./views/person/person-view');
+ import("./views/person/person-view");
return html``;
}
if (this._page === "test") {
- import('./views/test/test-page');
+ import("./views/test/test-page");
return html``;
}
if (this._page === "not-found") {
- import('./views/not-found');
- return html``
+ import("./views/not-found");
+ return html``;
}
- import('./views/not-found');
- return html``
+ import("./views/not-found");
+ return html``;
}
_onDrawerToggel() {
store.dispatch({
- type: 'drawerStatusChange',
+ type: "drawerStatusChange",
drawerOpened: this.drawerOpened ? false : true,
});
}
@@ -163,4 +162,4 @@ export class AppSection extends connect(store)(LitElement) {
}
}
-window.customElements.define("app-section", AppSection);
\ No newline at end of file
+window.customElements.define("app-section", AppSection);
diff --git a/src/app.js b/src/app.js
index b4589cc..83892b3 100644
--- a/src/app.js
+++ b/src/app.js
@@ -1,5 +1,6 @@
-if('serviceWorker' in navigator){
- navigator.serviceWorker.register("/service-worker.js")
- .then( (reg) => console.log('service worker registered'))
- .catch( (err) => console.log('service worker not registered'))
-}
\ No newline at end of file
+if ("serviceWorker" in navigator) {
+ navigator.serviceWorker
+ .register("/service-worker.js")
+ .then((reg) => console.log("service worker registered"))
+ .catch((err) => console.log("service worker not registered"));
+}
diff --git a/src/tmdb-app.js b/src/tmdb-app.js
index ae78e29..afac26c 100644
--- a/src/tmdb-app.js
+++ b/src/tmdb-app.js
@@ -1,20 +1,20 @@
import { LitElement, html, css } from "lit";
// Material Theme
-import { ThemeStyle } from '@dreamworld/material-styles/theme.js';
+import { TmdbThemeStyle } from "./views/components/theme";
//Redux
import { connect } from "pwa-helpers/connect-mixin.js";
-import { store } from './redux/store';
+import { store } from "./redux/store";
//Views
-import './views/drawer/app-drawer';
-import './app-section';
+import "./views/drawer/app-drawer";
+import "./app-section";
//i18next
-import i18next from '@dw/i18next-esm';
-import Backend from 'i18next-xhr-backend';
-import { localize } from '@dw/pwa-helpers';
+import i18next from "@dw/i18next-esm";
+import Backend from "i18next-xhr-backend";
+import { localize } from "@dw/pwa-helpers";
//DreamWorld Hammerjs
import Hammer from "@dreamworld/hammerjs/hammer.js";
@@ -22,16 +22,15 @@ import Hammer from "@dreamworld/hammerjs/hammer.js";
import * as app from "./redux/app";
i18next.use(Backend).init({
- fallbackLng: 'en',
- ns: ['app'],
- defaultNS: 'app',
+ fallbackLng: "en",
+ ns: ["app"],
+ defaultNS: "app",
backend: {
- loadPath: './src/locales/{{lng}}/{{ns}}.json'
- }
+ loadPath: "./src/locales/{{lng}}/{{ns}}.json",
+ },
});
export class TmdbApp extends connect(store)(localize(i18next)(LitElement)) {
-
static properties = {
theme: {
type: String,
@@ -40,40 +39,38 @@ export class TmdbApp extends connect(store)(localize(i18next)(LitElement)) {
dark: {
type: Boolean,
reflect: true,
- attribute: 'dark-theme',
+ attribute: "dark-theme",
},
- }
+ };
constructor() {
super();
this.theme;
this.dark;
- this.i18nextNameSpace = ['app'];
+ this.i18nextNameSpace = ["app"];
}
static styles = [
- ThemeStyle,
+ TmdbThemeStyle,
css`
-
- :host{
+ :host {
color: var(--mdc-theme-text-primary);
background-color: var(--mdc-theme-background);
display: flex;
flex: 1;
}
- `
+ `,
];
-
render() {
return this._initView();
}
_initView() {
return html`
-
+
- `
+ `;
}
firstUpdated() {
@@ -83,19 +80,27 @@ export class TmdbApp extends connect(store)(localize(i18next)(LitElement)) {
get _getSwipableDrawer() {
let hammerInstance = new Hammer(document.body);
- hammerInstance.get('swipe').set({ enable: true });
-
- hammerInstance.on('swipe', function (e) {
- if (e.velocity > 0 && store.getState().app.drawerOpened === false && store.getState().app.layout === 'mobile') {
+ hammerInstance.get("swipe").set({ enable: true });
+
+ hammerInstance.on("swipe", function (e) {
+ if (
+ e.velocity > 0 &&
+ store.getState().app.drawerOpened === false &&
+ store.getState().app.layout === "mobile"
+ ) {
store.dispatch({
- type: 'drawerStatusChange',
+ type: "drawerStatusChange",
drawerOpened: true,
});
}
- if (e.velocity < 0 && store.getState().app.drawerOpened && store.getState().app.layout === 'mobile') {
+ if (
+ e.velocity < 0 &&
+ store.getState().app.drawerOpened &&
+ store.getState().app.layout === "mobile"
+ ) {
store.dispatch({
- type: 'drawerStatusChange',
+ type: "drawerStatusChange",
drawerOpened: false,
});
}
@@ -104,9 +109,9 @@ export class TmdbApp extends connect(store)(localize(i18next)(LitElement)) {
stateChanged(state) {
this.theme = app.selectors.getCurrentTheme(state);
- this.dark = this.theme === 'dark' ? true : false;
+ this.dark = this.theme === "dark" ? true : false;
i18next.changeLanguage(app.selectors.getLanguage(state));
}
}
-window.customElements.define('tmdb-app', TmdbApp);
\ No newline at end of file
+window.customElements.define("tmdb-app", TmdbApp);
diff --git a/src/views/components/dw-surface.js b/src/views/components/dw-surface.js
index c1c37b9..e71a5dd 100644
--- a/src/views/components/dw-surface.js
+++ b/src/views/components/dw-surface.js
@@ -8,147 +8,146 @@ Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
-import { Shadow } from '@dreamworld/material-styles/shadow';
-import { LitElement, html, css } from 'lit';
+import { Shadow } from "@dreamworld/material-styles/shadow";
+import { LitElement, html, css } from "lit";
export class DwSurface extends LitElement {
static styles = [
- Shadow,
- css`
- :host {
- display: block;
- outline:none;
- border-radius: 4px;
- background-color: var(--mdc-theme-surface, #fff);
- box-sizing: border-box;
- position: relative;
- }
-
- :host[hidden] {
- display: none;
- }
-
- /* STARTS: background color styles based on bg */
- :host([bg="primary"]){
- background-color: var(--mdc-theme-primary);
- }
-
- :host([bg="secondary"]){
- background-color: var(--mdc-theme-secondary);
- }
-
- :host([bg="error"]){
- background-color: var(--mdc-theme-error);
- }
- /* ENDS: background color styles based on bg */
-
-
- /* STARTS: elevation styles based on elevation */
- :host([elevation="0"]){
- box-shadow: var(--mdc-elevation--z0);
- }
-
- :host([elevation="1"]){
- box-shadow: var(--mdc-elevation--z1);
- }
-
- :host([elevation="2"]){
- box-shadow: var(--mdc-elevation--z2);
- }
-
- :host([elevation="3"]){
- box-shadow: var(--mdc-elevation--z3);
- }
-
- :host([elevation="4"]){
- box-shadow: var(--mdc-elevation--z4);
- }
-
- :host([elevation="6"]){
- box-shadow: var(--mdc-elevation--z6);
- }
-
- :host([elevation="8"]){
- box-shadow: var(--mdc-elevation--z8);
- }
-
- :host([elevation="12"]){
- box-shadow: var(--mdc-elevation--z12);
- }
-
- :host([elevation="16"]){
- box-shadow: var(--mdc-elevation--z16);
- }
-
- :host([elevation="24"]){
- box-shadow: var(--mdc-elevation--z24);
- }
- /* ENDS: elevation styles based on elevation */
-
-
- /* STARTS: overlay styles for dark theme based on evevation */
- :host([elevation="1"]) .overlay{
- opacity: var(--dw-surface-overlay-opacitiy-elevation-1);
- }
-
- :host([elevation="2"]) .overlay{
- opacity: var(--dw-surface-overlay-opacitiy-elevation-2);
- }
-
- :host([elevation="3"]) .overlay{
- opacity: var(--dw-surface-overlay-opacitiy-elevation-3);
- }
-
- :host([elevation="4"]) .overlay{
- opacity: var(--dw-surface-overlay-opacitiy-elevation-4);
- }
-
- :host([elevation="6"]) .overlay{
- opacity: var(--dw-surface-overlay-opacitiy-elevation-6);
- }
-
- :host([elevation="8"]) .overlay{
- opacity: var(--dw-surface-overlay-opacitiy-elevation-8);
- }
-
- :host([elevation="12"]) .overlay{
- opacity: var(--dw-surface-overlay-opacitiy-elevation-12);
- }
-
- :host([elevation="16"]) .overlay{
- opacity: var(--dw-surface-overlay-opacitiy-elevation-16);
- }
-
- :host([elevation="24"]) .overlay{
- opacity: var(--dw-surface-overlay-opacitiy-elevation-24);
- }
- /* STARTS: overlay styles for dark theme based on evevation */
-
- .overlay{
- background-color: var(--dw-surface-overlay-color);
- opacity: 0;
- pointer-events: none;
- }
-
- .fit{
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom:0;
- }
-
- .scroller{
- display: inherit;
- flex: inherit;
- flex-direction: inherit;
- overflow: auto;
- }
-
- ::slotted(*) { z-index: 1; }
- `
- ];
-
+ Shadow,
+ css`
+ :host {
+ display: block;
+ outline: none;
+ border-radius: 4px;
+ background-color: var(--mdc-theme-surface, #fff);
+ box-sizing: border-box;
+ position: relative;
+ }
+
+ :host[hidden] {
+ display: none;
+ }
+
+ /* STARTS: background color styles based on bg */
+ :host([bg="primary"]) {
+ background-color: var(--mdc-theme-primary);
+ }
+
+ :host([bg="secondary"]) {
+ background-color: var(--mdc-theme-secondary);
+ }
+
+ :host([bg="error"]) {
+ background-color: var(--mdc-theme-error);
+ }
+ /* ENDS: background color styles based on bg */
+
+ /* STARTS: elevation styles based on elevation */
+ :host([elevation="0"]) {
+ box-shadow: var(--mdc-elevation--z0);
+ }
+
+ :host([elevation="1"]) {
+ box-shadow: var(--mdc-elevation--z1);
+ }
+
+ :host([elevation="2"]) {
+ box-shadow: var(--mdc-elevation--z2);
+ }
+
+ :host([elevation="3"]) {
+ box-shadow: var(--mdc-elevation--z3);
+ }
+
+ :host([elevation="4"]) {
+ box-shadow: var(--mdc-elevation--z4);
+ }
+
+ :host([elevation="6"]) {
+ box-shadow: var(--mdc-elevation--z6);
+ }
+
+ :host([elevation="8"]) {
+ box-shadow: var(--mdc-elevation--z8);
+ }
+
+ :host([elevation="12"]) {
+ box-shadow: var(--mdc-elevation--z12);
+ }
+
+ :host([elevation="16"]) {
+ box-shadow: var(--mdc-elevation--z16);
+ }
+
+ :host([elevation="24"]) {
+ box-shadow: var(--mdc-elevation--z24);
+ }
+ /* ENDS: elevation styles based on elevation */
+
+ /* STARTS: overlay styles for dark theme based on evevation */
+ :host([elevation="1"]) .overlay {
+ opacity: var(--dw-surface-overlay-opacitiy-elevation-1);
+ }
+
+ :host([elevation="2"]) .overlay {
+ opacity: var(--dw-surface-overlay-opacitiy-elevation-2);
+ }
+
+ :host([elevation="3"]) .overlay {
+ opacity: var(--dw-surface-overlay-opacitiy-elevation-3);
+ }
+
+ :host([elevation="4"]) .overlay {
+ opacity: var(--dw-surface-overlay-opacitiy-elevation-4);
+ }
+
+ :host([elevation="6"]) .overlay {
+ opacity: var(--dw-surface-overlay-opacitiy-elevation-6);
+ }
+
+ :host([elevation="8"]) .overlay {
+ opacity: var(--dw-surface-overlay-opacitiy-elevation-8);
+ }
+
+ :host([elevation="12"]) .overlay {
+ opacity: var(--dw-surface-overlay-opacitiy-elevation-12);
+ }
+
+ :host([elevation="16"]) .overlay {
+ opacity: var(--dw-surface-overlay-opacitiy-elevation-16);
+ }
+
+ :host([elevation="24"]) .overlay {
+ opacity: var(--dw-surface-overlay-opacitiy-elevation-24);
+ }
+ /* STARTS: overlay styles for dark theme based on evevation */
+
+ .overlay {
+ background-color: var(--dw-surface-overlay-color);
+ opacity: 0;
+ pointer-events: none;
+ }
+
+ .fit {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ }
+
+ .scroller {
+ display: inherit;
+ flex: inherit;
+ flex-direction: inherit;
+ overflow: auto;
+ }
+
+ ::slotted(*) {
+ z-index: 1;
+ }
+ `,
+ ];
static properties = {
/**
@@ -158,38 +157,36 @@ export class DwSurface extends LitElement {
*/
bg: {
type: String,
- reflect: true
+ reflect: true,
},
-
+
/**
* The z-depth of the card. Default is `0`.
*/
elevation: {
type: Number,
- reflect: true
- }
+ reflect: true,
+ },
};
render() {
return html`
-
+
`;
}
- constructor() {
+ constructor() {
super();
- this.bg = 'surface';
+ this.bg = "surface";
this.elevation = 0;
}
- get _getContentTemplate() {
+ get _getContentTemplate() {
return html``;
}
}
-window.customElements.define('dw-surface', DwSurface);
\ No newline at end of file
+window.customElements.define("dw-surface", DwSurface);
diff --git a/src/views/components/my-loader.js b/src/views/components/my-loader.js
index 3d554ac..3d5d213 100644
--- a/src/views/components/my-loader.js
+++ b/src/views/components/my-loader.js
@@ -1,10 +1,8 @@
import { LitElement, html, css } from "lit";
export class MyLoader extends LitElement {
-
static styles = css`
-
- :host{
+ :host {
flex: 1;
display: flex;
justify-content: center;
@@ -94,7 +92,6 @@ export class MyLoader extends LitElement {
transform: rotate(360deg);
}
}
-
`;
render() {
@@ -113,4 +110,4 @@ export class MyLoader extends LitElement {
}
}
-window.customElements.define("my-loader", MyLoader);
\ No newline at end of file
+window.customElements.define("my-loader", MyLoader);
diff --git a/src/views/components/theme.js b/src/views/components/theme.js
new file mode 100644
index 0000000..065cce5
--- /dev/null
+++ b/src/views/components/theme.js
@@ -0,0 +1,29 @@
+import { ThemeStyle } from "@dreamworld/material-styles";
+import { css } from "lit-element";
+
+export const TmdbThemeStyle = css`
+ ${ThemeStyle}
+
+ :host {
+ --mdc-theme-primary: #17368c;
+ --mdc-theme-secondary: #c12a5d;
+
+ --mdc-theme-text-primary: var(--mdc-theme-text-primary-on-background);
+
+ /** text field custom CSS */
+ --mdc-text-field-outlined-idle-border-color: var(
+ --mdc-theme-text-hint-on-background
+ );
+ --mdc-text-field-outlined-hover-border-color: var(
+ --mdc-theme-text-primary-on-background
+ );
+ --mdc-text-field-label-ink-color: var(
+ --mdc-theme-text-secondary-on-background
+ );
+ --mdc-text-field-disabled-ink-color: var(
+ --mdc-theme-text-disabled-on-background
+ );
+ --mdc-text-field-ink-color: var(--mdc-theme-text-primary-on-background);
+ /** text field custom CSS */
+ }
+`;
diff --git a/src/views/drawer/app-drawer.js b/src/views/drawer/app-drawer.js
index 0b25213..864f9de 100644
--- a/src/views/drawer/app-drawer.js
+++ b/src/views/drawer/app-drawer.js
@@ -4,26 +4,24 @@ import { LitElement, html, css } from "lit";
import { connect } from "pwa-helpers/connect-mixin";
import { store } from "../../redux/store";
-import * as app from '../../redux/app';
-import * as router from '../../redux/router';
+import * as app from "../../redux/app";
+import * as router from "../../redux/router";
//Dw Components
-import '@dreamworld/dw-list-item/dw-list-item';
-import '@dreamworld/dw-icon-button';
+import "@dreamworld/dw-list-item/dw-list-item";
//i18next
-import i18next from '@dw/i18next-esm';
-import { localize } from '@dw/pwa-helpers';
+import i18next from "@dw/i18next-esm";
+import { localize } from "@dw/pwa-helpers";
//Custom Components
import { DwSurface } from "../components/dw-surface";
export class AppDrawer extends connect(store)(localize(i18next)(DwSurface)) {
-
static styles = [
DwSurface.styles,
css`
- :host{
+ :host {
position: fixed;
z-index: 4;
overflow-y: auto;
@@ -36,39 +34,30 @@ export class AppDrawer extends connect(store)(localize(i18next)(DwSurface)) {
transition: left var(--drawer-open-time);
}
- :host([opened]){
- left:0;
+ :host([opened]) {
+ left: 0;
}
- :host([layout='mobile']){
+ :host([layout="mobile"]) {
padding: 0;
margin: 0;
height: 100vh;
border-radius: 0;
}
- .header{
+ .header {
display: flex;
justify-content: end;
align-items: center;
}
-
- dw-switch{
- margin: 8px;
- }
-
- dw-icon-button{
- width: max-content;
- height: max-content;
- }
- `
- ]
+ `,
+ ];
static properties = {
opened: {
type: Boolean,
reflect: true,
- attribute: 'opened',
+ attribute: "opened",
},
_page: {
type: String,
@@ -79,26 +68,52 @@ export class AppDrawer extends connect(store)(localize(i18next)(DwSurface)) {
layout: {
type: String,
reflect: true,
- }
- }
+ },
+ };
constructor() {
super();
this.opened = true;
this._page;
- this.i18nextNameSpace = ['app'];
+ this.i18nextNameSpace = ["app"];
}
get _getContentTemplate() {
return html`
-
-
-
-
-
+
+
+
+
-
`;
}
@@ -106,7 +121,7 @@ export class AppDrawer extends connect(store)(localize(i18next)(DwSurface)) {
if (this._page !== e.target.getAttribute("lable")) {
router.navigatePage(e.target.getAttribute("lable"), true);
- if (this.layout === 'mobile') {
+ if (this.layout === "mobile") {
this._onDrawerClose();
}
}
@@ -121,7 +136,7 @@ export class AppDrawer extends connect(store)(localize(i18next)(DwSurface)) {
_onDrawerClose() {
store.dispatch({
- type: 'drawerStatusChange',
+ type: "drawerStatusChange",
drawerOpened: false,
});
}
@@ -135,4 +150,4 @@ export class AppDrawer extends connect(store)(localize(i18next)(DwSurface)) {
}
}
-window.customElements.define("app-drawer", AppDrawer);
\ No newline at end of file
+window.customElements.define("app-drawer", AppDrawer);
diff --git a/src/views/header/app-header.js b/src/views/header/app-header.js
index 1f42783..789585b 100644
--- a/src/views/header/app-header.js
+++ b/src/views/header/app-header.js
@@ -8,9 +8,8 @@ import { store } from "../../redux/store";
import i18next from "@dw/i18next-esm";
import { localize } from "@dw/pwa-helpers";
-//Dw-Components
-import "@dreamworld/dw-switch";
-import "@dreamworld/dw-icon-button";
+// Material Components
+import "@material/mwc-icon-button";
//Custom Components
import { DwSurface } from "../components/dw-surface";
@@ -59,7 +58,7 @@ export class AppHeader extends connect(store)(localize(i18next)(DwSurface)) {
align-items: center;
}
- dw-icon-button {
+ mwc-icon-button {
width: max-content;
height: max-content;
}
@@ -96,11 +95,11 @@ export class AppHeader extends connect(store)(localize(i18next)(DwSurface)) {
return html`