Skip to content

Commit a0d1dba

Browse files
committed
Merge pull request #14 from MeTaNoV/issue-8
Fixes Issue #8
2 parents a4cc09e + 35de008 commit a0d1dba

File tree

4 files changed

+56
-29
lines changed

4 files changed

+56
-29
lines changed

bower.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebase-element-extended",
3-
"version": "1.0.4",
3+
"version": "1.1.0",
44
"authors": [
55
"Pascal Gula aka MeTaNoV <[email protected]>"
66
],
@@ -45,7 +45,8 @@
4545
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
4646
"iron-iconset-svg": "PolymerElements/iron-iconset-svg#^1.0.0",
4747
"iron-image": "PolymerElements/iron-image#^1.0.0",
48-
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
48+
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
49+
"iron-media-query": "PolymerElements/iron-media-query#^1.0.0",
4950
"paper-dialog-behavior": "PolymerElements/paper-dialog-behavior#^1.0.0",
5051
"paper-button": "PolymerElements/paper-button#^1.0.0",
5152
"paper-input": "PolymerElements/paper-input#^1.0.0",
@@ -55,9 +56,9 @@
5556
"paper-menu": "PolymerElements/paper-menu#^1.0.0",
5657
"paper-toast": "PolymerElements/paper-toast#^1.0.0",
5758
"neon-animation": "PolymerElements/neon-animation#^1.0.0",
58-
"firebase-element": "GoogleWebComponents/firebase-element#^1.0.0",
5959
"gold-email-input": "PolymerElements/gold-email-input#^1.0.0",
6060
"gold-password-input": "gold-password-input#^1.0.0",
61+
"firebase-element": "GoogleWebComponents/firebase-element#^1.0.0",
6162
"akc-meta": "akc42/akc-meta#^v1.0.0"
6263
},
6364
"devDependencies": {
@@ -66,6 +67,7 @@
6667
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
6768
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
6869
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
70+
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
6971
"paper-toolbar": "PolymerElements/paper-toolbar#^1.0.0",
7072
"paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0"
7173
}

demo/index.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@
5555
background-color: #3f51b5;
5656
color: white;
5757
};
58-
}
59-
60-
/* Provied mobile friendly view */
61-
@media (max-width: 600px) {
58+
--paper-toolbar-content: {
59+
padding: 0;
60+
};
6261
}
6362

6463
</style>
@@ -87,7 +86,6 @@ <h2 title-sign-in>Sign-In Dialog</h2>
8786
<!-- App Toolbar -->
8887
<paper-toolbar>
8988
<paper-icon-button icon="menu"></paper-icon-button>
90-
<paper-icon-button icon="info"></paper-icon-button>
9189
<span class="title">Firebase Element eXtended Demo</span>
9290
<firebase-account-menu></firebase-account-menu>
9391
</paper-toolbar>

firebase-account-menu.html

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,62 @@
22

33
<link rel="import" href="../iron-icon/iron-icon.html">
44
<link rel="import" href="../iron-image/iron-image.html">
5+
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
6+
<link rel="import" href="../iron-media-query/iron-media-query.html">
7+
58
<link rel="import" href="../paper-button/paper-button.html">
69
<link rel="import" href="../paper-menu-button/paper-menu-button.html">
710
<link rel="import" href="../paper-menu/paper-menu.html">
811
<link rel="import" href="../paper-item/paper-item.html">
12+
913
<link rel="import" href="../neon-animation/animations/scale-up-animation.html">
1014
<link rel="import" href="../neon-animation/animations/fade-out-animation.html">
1115

12-
<link rel="import" href="./firebase-auth-dialog.html">
13-
<link rel="import" href="./firebase-icons.html">
1416
<link rel="import" href="./firebase-state.html">
1517

1618
<!--
1719
`<firebase-account-menu>` is a navigation menu to be placed inside a `<paper-toolbar>` that provides and hook the authentication functionnality of `<firebase-auth-manager>`.
18-
Signing up and signing in is done thanks to a self-registered `<firebase-auth-dialog>` declared somewhere else.
20+
Signing Up and Signing In is done thanks to a self-registered `<firebase-auth-dialog>` declared somewhere else.
1921
It also provides access to the menu dedicated to account actions with a default logout action.
2022
2123
Example:
2224
2325
<firebase-account-menu>
24-
TODO PG: add paper-item item
26+
<paper-item on-tap="menu1Open">Menu 1</paper-item>
27+
<paper-item on-tap="menu2Open">Menu 2</paper-item>
2528
</firebase-account-menu>
2629
27-
@group GoogleWebComponents Elements
28-
@element firebase-account-menu
30+
### Styling
31+
32+
The following custom properties and mixins are available for styling:
33+
34+
Custom property | Description | Default
35+
----------------|-------------|----------
36+
`--firebase-account-menu` | Mixin applied to the account menu | `{}`
37+
`--firebase-account-menu-image` | Mixin applied to the iron-image | `{}`
38+
2939
@demo demo/index.html
30-
@hero hero.svg
3140
-->
3241
<dom-module id="firebase-account-menu">
3342
<template>
3443
<style>
35-
/* TODO PG: beautify and provide styling hook? */
3644
:host {
3745
display: block;
46+
47+
@apply(--firebase-account-menu);
3848
}
3949

4050
#signedIn, #signedOut {
41-
display: flex;
42-
align-items: center;
51+
@apply(--layout-horizontal);
52+
@apply(--layout-center-center);
4353
}
4454

4555
iron-image {
46-
width: 45px;
47-
height: 45px;
48-
border-radius: 10px;
56+
width: 40px;
57+
height: 40px;
58+
border-radius: 20px;
59+
60+
@apply(--firebase-account-menu-image);
4961
}
5062

5163
#profileLabel {
@@ -57,24 +69,26 @@
5769
}
5870
</style>
5971

60-
<firebase-state logged="{{logged}}" profile="{{profile}}"></firebase-state>
72+
<firebase-state logged="{{_logged}}" profile="{{_profile}}"></firebase-state>
73+
74+
<iron-media-query query="(max-width: 600px)" query-matches="{{_isMobile}}"></iron-media-query>
6175

62-
<paper-menu-button hidden$="[[!logged]]"
76+
<paper-menu-button hidden$="[[!_logged]]"
6377
vertical-offset="72"
6478
horizontal-align="right"
6579
horizontal-offset="12">
6680
<paper-button id="signedIn" class="dropdown-trigger">
67-
<iron-image src="[[profile.picture]]" sizing="cover"></iron-image>
68-
<span id="profileLabel">[[profile.displayName]]</span>
81+
<iron-image src="[[_profile.picture]]" sizing="cover"></iron-image>
82+
<span id="profileLabel" hidden$="[[_isMobile]]">[[_profile.displayName]]</span>
6983
<iron-icon icon="expand-more"></iron-icon>
7084
</paper-button>
7185
<paper-menu class="dropdown-content">
72-
<!-- TODO PG: here comes the user specific menu... -->
7386
<content></content>
7487
<paper-item on-tap="signOutButton">Sign Out</paper-item>
7588
</paper-menu>
7689
</paper-menu-button>
77-
<div id="signedOut" hidden$="[[logged]]">
90+
91+
<div id="signedOut" hidden$="[[_logged]]">
7892
<paper-button on-tap="signUpButton">Sign-Up</paper-button>
7993
<paper-button on-tap="signInButton">Sign-In</paper-button>
8094
</div>
@@ -85,9 +99,15 @@
8599
is: 'firebase-account-menu',
86100

87101
properties: {
88-
profile: {
102+
_logged: {
103+
type: Boolean
104+
},
105+
_profile: {
89106
type: Object
90-
}
107+
},
108+
_isMobile: {
109+
type: Boolean
110+
},
91111
},
92112

93113
get _firebaseAuthDialog() {

firebase-auth-dialog.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
<link rel="import" href="../iron-meta/iron-meta.html">
44
<link rel="import" href="../iron-icon/iron-icon.html">
5+
56
<link rel="import" href="../paper-dialog-behavior/paper-dialog-behavior.html">
67
<link rel="import" href="../paper-dialog-behavior/paper-dialog-shared-styles.html">
78
<link rel="import" href="../paper-button/paper-button.html">
9+
810
<link rel="import" href="../neon-animation/neon-animation-runner-behavior.html">
11+
912
<link rel="import" href="../gold-email-input/gold-email-input.html">
1013
<link rel="import" href="../gold-password-input/gold-password-input.html">
1114
<link rel="import" href="../gold-password-input/gold-password-input-validator.html">
@@ -75,6 +78,10 @@ <h2 title-sign-in>Sign-In Dialog</h2>
7578
display: block;
7679
}
7780

81+
:host > ::content > *:first-child {
82+
margin-top: 0;
83+
}
84+
7885
.facebook {
7986
color: white;
8087
--iron-icon-fill-color: white;

0 commit comments

Comments
 (0)