From bf5bc428492c6ec8731c4bdfeac09223d8df74c1 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 14 Aug 2019 15:31:25 +0300 Subject: cleanup lint warnings / update jsdoc --- vnext/.eslintrc | 2 +- vnext/src/api/index.js | 6 ++++++ vnext/src/ui/Settings.js | 53 ++++++++++++++++++++++++------------------------ 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/vnext/.eslintrc b/vnext/.eslintrc index 62404fed..5ba7add9 100644 --- a/vnext/.eslintrc +++ b/vnext/.eslintrc @@ -61,7 +61,7 @@ "no-unused-vars": "off", "no-useless-escape": "off", - "only-ascii/only-ascii": ["warn", { "allowedChars": "✓←→♡ ·" }], + "only-ascii/only-ascii": ["warn", { "allowedChars": "✓←→♡ ·—" }], "jest/no-disabled-tests": "warn", "jest/no-focused-tests": "error", diff --git a/vnext/src/api/index.js b/vnext/src/api/index.js index f2112dda..31bb3096 100644 --- a/vnext/src/api/index.js +++ b/vnext/src/api/index.js @@ -25,6 +25,12 @@ const apiBaseUrl = 'https://juick.com'; * @typedef {Object} SecureUserProperties * @property {string=} hash * @property {Token[]=} tokens + * @property {string=} telegramName + * @property {string=} twitterName + * @property {string[]=} jids + * @property {string[]=} emails + * @property {string=} activeEmail + * @property {{connected: boolean, crosspostEnabled: boolean}=} facebookStatus */ /** diff --git a/vnext/src/ui/Settings.js b/vnext/src/ui/Settings.js index 72537d86..c16a8289 100644 --- a/vnext/src/ui/Settings.js +++ b/vnext/src/ui/Settings.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useRef } from 'react'; +import React, { useState, useRef } from 'react'; import { me, updateAvatar } from '../api'; @@ -8,7 +8,7 @@ import UploadButton from './UploadButton'; import Avatar from './Avatar'; /** - * @param {{ visitor: import('../api').User, onChange: function }} props + * @param {{ visitor: import('../api').SecureUser, onChange: React.ChangeEvent }} props */ function ChangeAvatarForm({ visitor, onChange }) { const [avatar, setAvatar] = useState(''); @@ -53,7 +53,7 @@ function ChangeAvatarForm({ visitor, onChange }) { } /** - * @param {{ visitor: import('../api').User, onChange: React.ChangeEvent }} props + * @param {{ visitor: import('../api').SecureUser, onChange: React.ChangeEvent }} props */ export default function Settings({ visitor, onChange }) { @@ -105,7 +105,7 @@ export default function Settings({ visitor, onChange }) {
Changing your password
-

Change password: Change password:
(max. length - 16 symbols)

@@ -124,30 +124,31 @@ export default function Settings({ visitor, onChange }) {

)}
- {me.jids && ( - -
- XMPP accounts + { + visitor.jids && ( + +
+ XMPP accounts -

Your accounts:

-

+

Your accounts:

+

+ { + visitor.jids.map(jid => + +
+
+ ) + } +

{ - visitor.jids.map(jid => - -
-
- ) + visitor.jids && visitor.jids.length > 1 && +

} -

- { - visitor.jids && visitor.jids.length > 1 && -

- } -

To add new jabber account: send any text message to juick@juick.com -

-
- - )} +

To add new jabber account: send any text message to juick@juick.com +

+
+ + )}
E-mail
@@ -182,7 +183,7 @@ export default function Settings({ visitor, onChange }) { {/** email_off **/} You can receive notifications to email:
- Sent to { visitor.emails.map(email => -- cgit v1.2.3