pwa-auth 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pwa-auth",
3
3
  "author": "Jacek Markiewicz <jack.solutionbox@gmail.com>(https://www.jackspublishing.com)",
4
- "version": "2.0.5",
4
+ "version": "2.0.6",
5
5
  "description": "User Management Component with 3 HTML Tags, and 1 Boilerplate Function to display user icon, sign up, login, log out, change account details, delete account.",
6
6
  "homepage": "https://pwa-authentic.firebaseapp.com",
7
7
  "main": "pwa-auth.js",
@@ -9,9 +9,12 @@ import { toggleSign } from '../../redux/frontend';
9
9
  @customElement('user-icon')
10
10
  export class UserIcon extends connect(store)(LitElement) {
11
11
 
12
- /** @attr url */
12
+ /** @attr subscribe */
13
13
  @property({type: Boolean, reflect: true}) public subscribe = false;
14
14
 
15
+ /** @attr emptyArtwork */
16
+ @property({type: String, reflect: true}) public emptyArtwork = '';
17
+
15
18
  @state() private _user = false;
16
19
  @state() private _photoURL = '';
17
20
  // @state() private _sign = false;
@@ -50,7 +53,7 @@ export class UserIcon extends connect(store)(LitElement) {
50
53
  alt = "Login"
51
54
  height = "38px"
52
55
  width = "38px"
53
- src = "${this._photoURL}">
56
+ src = "${this._photoURL ? this._photoURL : this.emptyArtwork}">
54
57
  <!-- </div> -->
55
58
  ` : this.subscribe ? 'Subscribe' : 'Login' }
56
59
 
@@ -14,6 +14,9 @@ export class ContactPhoto extends connect(store)(LitElement) {
14
14
  /** @attr photo */
15
15
  @property() public photo : string | void | any = '';
16
16
 
17
+ /** @attr emptyArtwork */
18
+ @property({type: String, reflect: true}) public emptyArtwork = '';
19
+
17
20
  @state() private user : string | void = '';
18
21
  @state() private login : boolean = false;
19
22
  //@state() private uploadProgress = 0;
@@ -122,7 +125,7 @@ export class ContactPhoto extends connect(store)(LitElement) {
122
125
  margin: auto;
123
126
  height: 200px;
124
127
  width: 100%;
125
- background-image: url(${this.photo});
128
+ background-image: url(${this.photo ? this.photo : this.emptyArtwork});
126
129
  background-size: contain;
127
130
  background-repeat: no-repeat;
128
131
  background-position: center;
@@ -1,5 +1,5 @@
1
1
  import { css, html, LitElement } from 'lit';
2
- import { state, customElement } from 'lit/decorators.js';
2
+ import { state, customElement, property } from 'lit/decorators.js';
3
3
  import { connect } from 'pwa-helpers/connect-mixin.js';
4
4
  import { store, AppState } from '../../store';
5
5
  import { navigateAuth } from '../../redux/frontend';
@@ -14,6 +14,9 @@ import { listStyle } from '../../css/form/list';
14
14
  @customElement('user-settings')
15
15
  export class UserSettings extends connect(store)(LitElement) {
16
16
 
17
+ /** @attr emptyArtwork */
18
+ @property({type: String, reflect: true}) public emptyArtwork = '';
19
+
17
20
  @state() private profileTopic = '';
18
21
  @state() private name = '';
19
22
 
@@ -144,7 +147,7 @@ export class UserSettings extends connect(store)(LitElement) {
144
147
  <h2>${this.name}</h2>
145
148
 
146
149
  <!-- Custom Image Element - Display / Upload -->
147
- <contact-photo></contact-photo>
150
+ <contact-photo emptyArtwork="${this.emptyArtwork}"></contact-photo>
148
151
 
149
152
  </section>
150
153
 
@@ -99,15 +99,15 @@ onAuthStateChanged(auth, (user) => {
99
99
  // Backend Data Redux - Firebase User Information - account redux
100
100
  store.dispatch( accID ( user.uid ) );
101
101
  store.dispatch( accName ( user.displayName || 'John Doe' ) );
102
- store.dispatch( accEmail ( user.email || 'Nothing' ) );
103
- store.dispatch( accImage ( user.photoURL || 'images/empty.jpg' ) );
102
+ store.dispatch( accEmail ( user.email || '' ) );
103
+ store.dispatch( accImage ( user.photoURL || '' ) );
104
104
 
105
105
  // store.dispatch( accPhone ( user.phoneNumber || '(000) 000-0000' ) );
106
106
  // store.dispatch( accAnon ( user.isAnonymous ) );
107
107
 
108
108
  // Frontend Data Redux - Firebase User Information - user redux
109
109
  store.dispatch( nameAuth ( user.displayName || 'John Doe' ) );
110
- store.dispatch( iconAuth ( user.photoURL || 'images/empty.jpg' ) );
110
+ store.dispatch( iconAuth ( user.photoURL || '' ) );
111
111
 
112
112
  // Email Change Listener - Custom Event
113
113
  if (pendingEmailVerification && !user.emailVerified) {
@@ -145,15 +145,15 @@ onAuthStateChanged(auth, (user) => {
145
145
  // Backend Data Redux - Firebase User Information - account redux
146
146
  store.dispatch( accID ( '' ) );
147
147
  store.dispatch( accName ( 'John Doe' ) );
148
- store.dispatch( accEmail ( 'Nothing' ) );
149
- store.dispatch( accImage ( 'images/empty.jpg' ) );
148
+ store.dispatch( accEmail ( '' ) );
149
+ store.dispatch( accImage ( '' ) );
150
150
 
151
151
  // store.dispatch( accAnon ( false ) );
152
152
  // store.dispatch( accPhone ( '(000) 000-0000' ) );
153
153
 
154
154
  // Frontend Data Redux - Firebase User Information - user redux
155
155
  store.dispatch( nameAuth ( 'John Doe' ) );
156
- store.dispatch( iconAuth ( 'images/empty.jpg' ) );
156
+ store.dispatch( iconAuth ( '' ) );
157
157
 
158
158
  // Dispatch Information
159
159
 
@@ -23,7 +23,7 @@ export const initialState: frontendAuth = {
23
23
  profileChoice: 'unChosen', // Profile Initialization State
24
24
 
25
25
  name: 'Modern Business', // Customer Name Loaded
26
- photoURL: 'images/empty.jpg', // User Photo Loaded
26
+ photoURL: '', // User Photo Loaded
27
27
 
28
28
  phone: '(...) ... - ....', // User Phone Loaded
29
29
  email: '' // User E-mail Loaded
@@ -16,8 +16,8 @@
16
16
  <link rel="preconnect" href="https://firebasestorage.googleapis.com">
17
17
  <link rel="dns-prefetch" href="https://firebasestorage.googleapis.com">
18
18
 
19
- <link rel="stylesheet" href="/css/styles.css">
20
- <link rel="stylesheet" href="/pwa-styles.css">
19
+ <link rel="stylesheet" href="css/styles.css">
20
+ <link rel="stylesheet" href="pwa-styles.css">
21
21
 
22
22
  <script>
23
23
  window.process = { env: { NODE_ENV: 'production' } };
@@ -39,15 +39,15 @@
39
39
 
40
40
  <header>
41
41
  <!-- Icon Tag -->
42
- <user-icon subscribe></user-icon>
42
+ <user-icon subscribe emptyArtwork="images/empty.jpg"></user-icon>
43
43
  </header>
44
44
 
45
45
  <!-- Drawer Tag-->
46
- <user-drawer subscribe settingsURL="/settings"></user-drawer>
46
+ <user-drawer subscribe settingsURL="settings"></user-drawer>
47
47
 
48
48
  <main>
49
49
  <!-- Settings Tag-->
50
- <user-settings></user-settings>
50
+ <user-settings emptyArtwork="images/empty.jpg"></user-settings>
51
51
  </main>
52
52
 
53
53
  <footer>
@@ -58,7 +58,7 @@
58
58
  </footer>
59
59
 
60
60
  <!-- Application Shell -->
61
- <script src="/js/pwa-auth.js" async></script>
61
+ <script src="js/pwa-auth.js" async></script>
62
62
 
63
63
  </body>
64
64
  </html>