Skip to content

Commit

Permalink
feat: added basic homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanMatthias committed Jan 29, 2019
1 parent 3789a8f commit f11302f
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@
"publishConfig": {
"access": "public"
}
}
}
28 changes: 28 additions & 0 deletions packages/admin/src/components/pages/Admin/Home/PageHome.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { customElement, html, LitElement, property } from 'lit-element';
import { connect } from 'pwa-helpers/connect-mixin';
import { titleSet } from '../../../../lib/decorators/titleSet';
import { Me, State, store } from '../../../../store/store';
import CSS from './page-home-css';

@customElement('page-home')
export class PageHome extends titleSet('Home')(connect(store)(LitElement)) {

public static styles = [CSS];

@property()
public me?: Me;

public render() {
return html`${this.me ? html`<h2>Welcome back, ${this.me.fname}</h2>` : null}`;
}

public stateChanged(s: State) {
this.me = s.Me;
}
}

declare global {
interface HTMLElementTagNameMap {
'page-home': PageHome;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {css} from 'lit-element';
// tslint:disable-next-line no-default-export export-name
export default css`:host{position:absolute;top:0;left:0;right:0;bottom:0;overflow-y:auto;padding:var(--size-small);padding-top:0}:host h2{font-size:var(--font-size-super);font-weight:100;margin-top:0}
`;
18 changes: 18 additions & 0 deletions packages/admin/src/components/pages/Admin/Home/page-home.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@import 'zen-css/import';

:host {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow-y: auto;
padding: var(--size-small);
padding-top: 0;

h2 {
font-size: var(--font-size-super);
font-weight: 100;
margin-top: 0;
}
}
3 changes: 2 additions & 1 deletion packages/admin/src/components/pages/Admin/PageAdmin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface PageAdminProps {
_appSelectorOpen: boolean;
}

export * from './Home/PageHome';
export * from './App/PageApp';
export * from './Users/PageUsers';
export * from './Media/PageMedia';
Expand Down Expand Up @@ -42,7 +43,7 @@ export class PageAdmin extends connect(store)(LitElement) implements PageAdminPr
{ path: '/users/(.*)', element: 'page-users' },
{ path: '/media/(.*)', element: 'page-media' },
// { path: '/settings/(.*)', element: 'page-settings' },
{ path: '/', element: 'page-dashboard', exact: true }
{ path: '/', element: 'page-home', exact: true }
];

@property()
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-social-login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
"publishConfig": {
"access": "public"
}
}
}

0 comments on commit f11302f

Please sign in to comment.