From d2b8ee34e4142886222568a3f6913c318c031457 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 21 Jun 2018 11:36:11 +0300 Subject: Inital settings page --- vnext/src/components/Settings.js | 215 +++++++++++++++++++++++++++++++++++++++ vnext/src/index.js | 10 +- 2 files changed, 223 insertions(+), 2 deletions(-) create mode 100644 vnext/src/components/Settings.js (limited to 'vnext/src') diff --git a/vnext/src/components/Settings.js b/vnext/src/components/Settings.js new file mode 100644 index 00000000..fc28c3b5 --- /dev/null +++ b/vnext/src/components/Settings.js @@ -0,0 +1,215 @@ +import React from 'react'; + +export default class Settings extends React.Component { + constructor(props) { + super(props) + this.state = { + settings: {}, + userinfo: {}, + facebook: {} + } + } + render() { + const { settings, userinfo, facebook } = this.state; + return ( +
+
+

Settings

+
+

Avatar:
+ Recommendations: PNG, 96x96, <50Kb. Also, JPG and GIF supported.

+

+

Full name:

+

Country:

+

URL:
+ Please, start with "http://"

+

About:
+
+ Max. 255 symbols

+
+
+ Changing your password +
+ +

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

+
+
+ + +
+
+ Notification options +

+ +  Reply notifications ("Message posted") +

+

+  Subscriptions notifications ("@user subscribed...") +

+

+  Posts recommendations ("Recommended by @user") +

+

+
+
+
+ Telegram + {settings.telegramName ? ( +
+
Telegram: {{ telegram_name }} — + + +
+
+ ) : ( +

To connect Telegram account: send any text message to @Juick_bot +

+ )} +
+ {settings.jids && ( +
+
+ XMPP accounts + +

Your accounts:

+

+ { + settings.jids.map(jid => + +
+
+ ) + } + {settings.auths.map(auth => + + + — Confirm
+
+ )} +

+ {settings.jids && settings.jids.length > 1( +

+ )} +

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

+
+
+ )} +
+ E-mail +
+

Add account:
+ + + +

+
+
+

Your accounts:

+

+ { + settings.emails ? settings.emails.map(email => + + +
+ {settings.emails.length > 1 && +

+ } + + ) : `-` + } +

+
+ {settings.emails && + + {/** email_off **/} +
+ You can receive notifications to email:
+ Sent to + + +
+ {/** /email_off **/} +

 

+

You can post to Juick via e-mail. Send your plain text + messages to juick@juick.com. You can attach one photo or video file.

+
+ } +
+
+ + Facebook + + {facebook.connected ? ( + facebook.crosspostEnabled ? +
+
+ Facebook: Enabled — + + +
+
+ : +
+
+ Facebook: Disabled — + + +
+
+ ) : ( +

Cross-posting to Facebook: + + Connect to Facebook + +

+ )} +
+
+ + Twitter + { settings.twitter_name ? +
+
Twitter: { settings.twitter_name } — + + +
+
+ : +

Cross-posting to Twitter: Connect to Twitter

+ } +
+ +
+
+ ) + } +} \ No newline at end of file diff --git a/vnext/src/index.js b/vnext/src/index.js index 5bf7c021..492b569e 100644 --- a/vnext/src/index.js +++ b/vnext/src/index.js @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom'; import { BrowserRouter as Router, Route, Link, Switch } from 'react-router-dom'; import Icon from './components/Icon'; import { Discover, Discussions, Blog, Tag, Home } from './components/Feeds'; +import Settings from './components/Settings'; import Post from './components/Post'; import Thread from './components/Thread'; import LoginButton from './components/LoginButton'; @@ -91,7 +92,7 @@ class App extends React.Component {
{this.state.visitor.uid > 0 ?
- { this.state.visitor.uname ? : } + {this.state.visitor.uname ? : }
: @@ -126,7 +127,12 @@ class App extends React.Component { } /> } /> - } /> + + + } /> + + + } /> } /> } /> } /> -- cgit v1.2.3