Scss #471
28 changed files with 759 additions and 252 deletions
34
client/build/components/ChannelSelectDropdown/index.js
Normal file
34
client/build/components/ChannelSelectDropdown/index.js
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _publish_channel_select_states = require("../../constants/publish_channel_select_states");
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var ChannelSelectDropdown = function ChannelSelectDropdown(_ref) {
|
||||||
|
var selectedChannel = _ref.selectedChannel,
|
||||||
|
handleSelection = _ref.handleSelection,
|
||||||
|
loggedInChannelName = _ref.loggedInChannelName;
|
||||||
|
return _react.default.createElement("select", {
|
||||||
|
id: "channel-name-select",
|
||||||
|
className: "select select--arrow",
|
||||||
|
value: selectedChannel,
|
||||||
|
onChange: handleSelection
|
||||||
|
}, loggedInChannelName && _react.default.createElement("option", {
|
||||||
|
value: loggedInChannelName,
|
||||||
|
id: "publish-channel-select-channel-option"
|
||||||
|
}, loggedInChannelName), _react.default.createElement("option", {
|
||||||
|
value: _publish_channel_select_states.LOGIN
|
||||||
|
}, "Existing"), _react.default.createElement("option", {
|
||||||
|
value: _publish_channel_select_states.CREATE
|
||||||
|
}, "New"));
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = ChannelSelectDropdown;
|
||||||
|
exports.default = _default;
|
30
client/build/components/ChooseAnonymousPublishRadio/index.js
Normal file
30
client/build/components/ChooseAnonymousPublishRadio/index.js
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var ChooseAnonymousPublishRadio = function ChooseAnonymousPublishRadio(_ref) {
|
||||||
|
var publishInChannel = _ref.publishInChannel,
|
||||||
|
toggleAnonymousPublish = _ref.toggleAnonymousPublish;
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement("input", {
|
||||||
|
type: "radio",
|
||||||
|
name: "anonymous-or-channel",
|
||||||
|
id: "anonymous-radio",
|
||||||
|
className: "input-radio",
|
||||||
|
value: "anonymous",
|
||||||
|
checked: !publishInChannel,
|
||||||
|
onChange: toggleAnonymousPublish
|
||||||
|
}), _react.default.createElement("label", {
|
||||||
|
className: "label label--pointer",
|
||||||
|
htmlFor: "anonymous-radio"
|
||||||
|
}, "Anonymous"));
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = ChooseAnonymousPublishRadio;
|
||||||
|
exports.default = _default;
|
30
client/build/components/ChooseChannelPublishRadio/index.js
Normal file
30
client/build/components/ChooseChannelPublishRadio/index.js
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var ChooseChannelPublishRadio = function ChooseChannelPublishRadio(_ref) {
|
||||||
|
var publishInChannel = _ref.publishInChannel,
|
||||||
|
toggleAnonymousPublish = _ref.toggleAnonymousPublish;
|
||||||
|
return _react.default.createElement("div", null, _react.default.createElement("input", {
|
||||||
|
type: "radio",
|
||||||
|
name: "anonymous-or-channel",
|
||||||
|
id: "channel-radio",
|
||||||
|
className: "input-radio",
|
||||||
|
value: "in a channel",
|
||||||
|
checked: publishInChannel,
|
||||||
|
onChange: toggleAnonymousPublish
|
||||||
|
}), _react.default.createElement("label", {
|
||||||
|
className: "label label--pointer",
|
||||||
|
htmlFor: "channel-radio"
|
||||||
|
}, "In a channel"));
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = ChooseChannelPublishRadio;
|
||||||
|
exports.default = _default;
|
23
client/build/components/ErrorDisplay/index.js
Normal file
23
client/build/components/ErrorDisplay/index.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var ErrorDisplay = function ErrorDisplay(_ref) {
|
||||||
|
var errorMessage = _ref.errorMessage,
|
||||||
|
defaultMessage = _ref.defaultMessage;
|
||||||
|
return _react.default.createElement("div", null, errorMessage ? _react.default.createElement("p", {
|
||||||
|
className: "info-message--failure"
|
||||||
|
}, errorMessage) : _react.default.createElement("p", {
|
||||||
|
className: "info-message"
|
||||||
|
}, defaultMessage));
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = ErrorDisplay;
|
||||||
|
exports.default = _default;
|
20
client/build/components/Label/index.js
Normal file
20
client/build/components/Label/index.js
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var Label = function Label(_ref) {
|
||||||
|
var value = _ref.value;
|
||||||
|
return _react.default.createElement("label", {
|
||||||
|
className: "label"
|
||||||
|
}, value);
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = Label;
|
||||||
|
exports.default = _default;
|
42
client/build/components/PublishDescriptionInput/index.js
Normal file
42
client/build/components/PublishDescriptionInput/index.js
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _PublishDetailsRow = _interopRequireDefault(require("@components/PublishDetailsRow"));
|
||||||
|
|
||||||
|
var _Label = _interopRequireDefault(require("@components/Label"));
|
||||||
|
|
||||||
|
var _ExpandingTextArea = _interopRequireDefault(require("@components/ExpandingTextArea"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var PublishDescriptionInput = function PublishDescriptionInput(_ref) {
|
||||||
|
var description = _ref.description,
|
||||||
|
handleInput = _ref.handleInput;
|
||||||
|
return _react.default.createElement(_PublishDetailsRow.default, {
|
||||||
|
label: _react.default.createElement(_Label.default, {
|
||||||
|
value: 'Description:'
|
||||||
|
}),
|
||||||
|
content: _react.default.createElement(_ExpandingTextArea.default, {
|
||||||
|
id: "publish-description",
|
||||||
|
className: "textarea textarea--primary textarea--full-width",
|
||||||
|
rows: 1,
|
||||||
|
maxLength: 2000,
|
||||||
|
style: {
|
||||||
|
maxHeight: 200
|
||||||
|
},
|
||||||
|
name: "description",
|
||||||
|
placeholder: "Optional description",
|
||||||
|
value: description,
|
||||||
|
onChange: handleInput
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = PublishDescriptionInput;
|
||||||
|
exports.default = _default;
|
58
client/build/components/PublishDetailsRow/index.js
Normal file
58
client/build/components/PublishDetailsRow/index.js
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
|
||||||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||||
|
|
||||||
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||||
|
|
||||||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||||
|
|
||||||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||||
|
|
||||||
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||||
|
|
||||||
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
|
||||||
|
|
||||||
|
var PublishDetailsRow =
|
||||||
|
/*#__PURE__*/
|
||||||
|
function (_React$Component) {
|
||||||
|
function PublishDetailsRow() {
|
||||||
|
_classCallCheck(this, PublishDetailsRow);
|
||||||
|
|
||||||
|
return _possibleConstructorReturn(this, _getPrototypeOf(PublishDetailsRow).apply(this, arguments));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createClass(PublishDetailsRow, [{
|
||||||
|
key: "render",
|
||||||
|
value: function render() {
|
||||||
|
return _react.default.createElement("div", {
|
||||||
|
className: 'publish-details-row'
|
||||||
|
}, _react.default.createElement("div", {
|
||||||
|
className: 'publish-details-label'
|
||||||
|
}, this.props.label), _react.default.createElement("div", {
|
||||||
|
className: 'publish-details-content'
|
||||||
|
}, this.props.content));
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
|
||||||
|
_inherits(PublishDetailsRow, _React$Component);
|
||||||
|
|
||||||
|
return PublishDetailsRow;
|
||||||
|
}(_react.default.Component);
|
||||||
|
|
||||||
|
var _default = PublishDetailsRow;
|
||||||
|
exports.default = _default;
|
39
client/build/components/PublishLicenseInput/index.js
Normal file
39
client/build/components/PublishLicenseInput/index.js
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _PublishDetailsRow = _interopRequireDefault(require("@components/PublishDetailsRow"));
|
||||||
|
|
||||||
|
var _Label = _interopRequireDefault(require("@components/Label"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var PublishLicenseInput = function PublishLicenseInput(_ref) {
|
||||||
|
var handleSelect = _ref.handleSelect;
|
||||||
|
return _react.default.createElement(_PublishDetailsRow.default, {
|
||||||
|
label: _react.default.createElement(_Label.default, {
|
||||||
|
value: 'License:'
|
||||||
|
}),
|
||||||
|
content: _react.default.createElement("select", {
|
||||||
|
type: "text",
|
||||||
|
name: "license",
|
||||||
|
id: "publish-license",
|
||||||
|
className: "select select--primary",
|
||||||
|
onChange: handleSelect
|
||||||
|
}, _react.default.createElement("option", {
|
||||||
|
value: " "
|
||||||
|
}, "Unspecified"), _react.default.createElement("option", {
|
||||||
|
value: "Public Domain"
|
||||||
|
}, "Public Domain"), _react.default.createElement("option", {
|
||||||
|
value: "Creative Commons"
|
||||||
|
}, "Creative Commons"))
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = PublishLicenseInput;
|
||||||
|
exports.default = _default;
|
35
client/build/components/PublishNsfwInput/index.js
Normal file
35
client/build/components/PublishNsfwInput/index.js
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Object.defineProperty(exports, "__esModule", {
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
exports.default = void 0;
|
||||||
|
|
||||||
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
|
var _PublishDetailsRow = _interopRequireDefault(require("@components/PublishDetailsRow"));
|
||||||
|
|
||||||
|
var _Label = _interopRequireDefault(require("@components/Label"));
|
||||||
|
|
||||||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
var PublishNsfwInput = function PublishNsfwInput(_ref) {
|
||||||
|
var nsfw = _ref.nsfw,
|
||||||
|
handleInput = _ref.handleInput;
|
||||||
|
return _react.default.createElement(_PublishDetailsRow.default, {
|
||||||
|
label: _react.default.createElement(_Label.default, {
|
||||||
|
value: 'Mature:'
|
||||||
|
}),
|
||||||
|
content: _react.default.createElement("input", {
|
||||||
|
className: "input-checkbox",
|
||||||
|
type: "checkbox",
|
||||||
|
id: "publish-nsfw",
|
||||||
|
name: "nsfw",
|
||||||
|
value: nsfw,
|
||||||
|
onChange: handleInput
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var _default = PublishNsfwInput;
|
||||||
|
exports.default = _default;
|
|
@ -9,6 +9,12 @@ var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
var _request = _interopRequireDefault(require("../../utils/request"));
|
var _request = _interopRequireDefault(require("../../utils/request"));
|
||||||
|
|
||||||
|
var _ErrorDisplay = _interopRequireDefault(require("@components/ErrorDisplay"));
|
||||||
|
|
||||||
|
var _PublishDetailsRow = _interopRequireDefault(require("@components/PublishDetailsRow"));
|
||||||
|
|
||||||
|
var _Label = _interopRequireDefault(require("@components/Label"));
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||||
|
@ -31,6 +37,48 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || functio
|
||||||
|
|
||||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||||
|
|
||||||
|
var ChannelLoginNameInput = function ChannelLoginNameInput(_ref) {
|
||||||
|
var channelName = _ref.channelName,
|
||||||
|
handleInput = _ref.handleInput;
|
||||||
|
return _react.default.createElement(_PublishDetailsRow.default, {
|
||||||
|
label: _react.default.createElement(_Label.default, {
|
||||||
|
value: 'Name:'
|
||||||
|
}),
|
||||||
|
content: _react.default.createElement("div", {
|
||||||
|
className: "input-area--primary"
|
||||||
|
}, _react.default.createElement("span", null, "@"), _react.default.createElement("input", {
|
||||||
|
type: "text",
|
||||||
|
id: "channel-login-name-input",
|
||||||
|
className: "input-text",
|
||||||
|
name: "name",
|
||||||
|
placeholder: "Your Channel Name",
|
||||||
|
value: channelName,
|
||||||
|
onChange: handleInput
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var ChannelLoginPasswordInput = function ChannelLoginPasswordInput(_ref2) {
|
||||||
|
var channelPassword = _ref2.channelPassword,
|
||||||
|
handleInput = _ref2.handleInput;
|
||||||
|
return _react.default.createElement(_PublishDetailsRow.default, {
|
||||||
|
label: _react.default.createElement(_Label.default, {
|
||||||
|
value: 'Password:'
|
||||||
|
}),
|
||||||
|
content: _react.default.createElement("div", {
|
||||||
|
className: "input-area--primary"
|
||||||
|
}, _react.default.createElement("input", {
|
||||||
|
type: "password",
|
||||||
|
id: "channel-login-password-input",
|
||||||
|
name: "password",
|
||||||
|
className: "input-text",
|
||||||
|
placeholder: "",
|
||||||
|
value: channelPassword,
|
||||||
|
onChange: handleInput
|
||||||
|
}))
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var ChannelLoginForm =
|
var ChannelLoginForm =
|
||||||
/*#__PURE__*/
|
/*#__PURE__*/
|
||||||
function (_React$Component) {
|
function (_React$Component) {
|
||||||
|
@ -74,12 +122,12 @@ function (_React$Component) {
|
||||||
}),
|
}),
|
||||||
credentials: 'include'
|
credentials: 'include'
|
||||||
};
|
};
|
||||||
(0, _request.default)('login', params).then(function (_ref) {
|
(0, _request.default)('login', params).then(function (_ref3) {
|
||||||
var success = _ref.success,
|
var success = _ref3.success,
|
||||||
channelName = _ref.channelName,
|
channelName = _ref3.channelName,
|
||||||
shortChannelId = _ref.shortChannelId,
|
shortChannelId = _ref3.shortChannelId,
|
||||||
channelClaimId = _ref.channelClaimId,
|
channelClaimId = _ref3.channelClaimId,
|
||||||
message = _ref.message;
|
message = _ref3.message;
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
_this2.props.onChannelLogin(channelName, shortChannelId, channelClaimId);
|
_this2.props.onChannelLogin(channelName, shortChannelId, channelClaimId);
|
||||||
|
@ -105,56 +153,19 @@ function (_React$Component) {
|
||||||
}, {
|
}, {
|
||||||
key: "render",
|
key: "render",
|
||||||
value: function render() {
|
value: function render() {
|
||||||
return _react.default.createElement("form", {
|
return _react.default.createElement("div", null, _react.default.createElement(ChannelLoginNameInput, {
|
||||||
id: "channel-login-form"
|
channelName: this.state.channelName,
|
||||||
}, _react.default.createElement("div", {
|
handleInput: this.handleInput
|
||||||
className: "row row--wide row--short"
|
}), _react.default.createElement(ChannelLoginPasswordInput, {
|
||||||
}, _react.default.createElement("div", {
|
channelPassword: this.state.channelPassword,
|
||||||
className: "column column--3 column--sml-10"
|
handleInput: this.handleInput
|
||||||
}, _react.default.createElement("label", {
|
}), _react.default.createElement(_ErrorDisplay.default, {
|
||||||
className: "label",
|
errorMessage: this.state.error,
|
||||||
htmlFor: "channel-login-name-input"
|
defaultMessage: 'Enter the name and password for your channel'
|
||||||
}, "Name:")), _react.default.createElement("div", {
|
}), _react.default.createElement("button", {
|
||||||
className: "column column--6 column--sml-10"
|
|
||||||
}, _react.default.createElement("div", {
|
|
||||||
className: "input-text--primary flex-container--row flex-container--left-bottom"
|
|
||||||
}, _react.default.createElement("span", null, "@"), _react.default.createElement("input", {
|
|
||||||
type: "text",
|
|
||||||
id: "channel-login-name-input",
|
|
||||||
className: "input-text",
|
|
||||||
name: "name",
|
|
||||||
placeholder: "Your Channel Name",
|
|
||||||
value: this.state.channelName,
|
|
||||||
onChange: this.handleInput
|
|
||||||
})))), _react.default.createElement("div", {
|
|
||||||
className: "row row--wide row--short"
|
|
||||||
}, _react.default.createElement("div", {
|
|
||||||
className: "column column--3 column--sml-10"
|
|
||||||
}, _react.default.createElement("label", {
|
|
||||||
className: "label",
|
|
||||||
htmlFor: "channel-login-password-input"
|
|
||||||
}, "Password:")), _react.default.createElement("div", {
|
|
||||||
className: "column column--6 column--sml-10"
|
|
||||||
}, _react.default.createElement("div", {
|
|
||||||
className: "input-text--primary"
|
|
||||||
}, _react.default.createElement("input", {
|
|
||||||
type: "password",
|
|
||||||
id: "channel-login-password-input",
|
|
||||||
name: "password",
|
|
||||||
className: "input-text",
|
|
||||||
placeholder: "",
|
|
||||||
value: this.state.channelPassword,
|
|
||||||
onChange: this.handleInput
|
|
||||||
})))), this.state.error ? _react.default.createElement("p", {
|
|
||||||
className: "info-message--failure"
|
|
||||||
}, this.state.error) : _react.default.createElement("p", {
|
|
||||||
className: "info-message"
|
|
||||||
}, "Enter the name and password for your channel"), _react.default.createElement("div", {
|
|
||||||
className: "row row--wide"
|
|
||||||
}, _react.default.createElement("button", {
|
|
||||||
className: "button--primary",
|
className: "button--primary",
|
||||||
onClick: this.loginToChannel
|
onClick: this.loginToChannel
|
||||||
}, "Authenticate")));
|
}, "Authenticate"));
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,19 @@ var _ChannelLoginForm = _interopRequireDefault(require("@containers/ChannelLogin
|
||||||
|
|
||||||
var _ChannelCreateForm = _interopRequireDefault(require("@containers/ChannelCreateForm"));
|
var _ChannelCreateForm = _interopRequireDefault(require("@containers/ChannelCreateForm"));
|
||||||
|
|
||||||
var states = _interopRequireWildcard(require("../../constants/publish_channel_select_states"));
|
var _publish_channel_select_states = require("../../constants/publish_channel_select_states");
|
||||||
|
|
||||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
var _PublishDetailsRow = _interopRequireDefault(require("@components/PublishDetailsRow"));
|
||||||
|
|
||||||
|
var _ChooseAnonymousPublishRadio = _interopRequireDefault(require("@components/ChooseAnonymousPublishRadio"));
|
||||||
|
|
||||||
|
var _ChooseChannelPublishRadio = _interopRequireDefault(require("@components/ChooseChannelPublishRadio"));
|
||||||
|
|
||||||
|
var _ErrorDisplay = _interopRequireDefault(require("@components/ErrorDisplay"));
|
||||||
|
|
||||||
|
var _Label = _interopRequireDefault(require("@components/Label"));
|
||||||
|
|
||||||
|
var _ChannelSelectDropdown = _interopRequireDefault(require("@components/ChannelSelectDropdown"));
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
@ -69,49 +79,27 @@ function (_React$Component) {
|
||||||
}, {
|
}, {
|
||||||
key: "render",
|
key: "render",
|
||||||
value: function render() {
|
value: function render() {
|
||||||
return _react.default.createElement("div", null, _react.default.createElement("form", null, _react.default.createElement("div", null, _react.default.createElement("input", {
|
return _react.default.createElement("div", null, _react.default.createElement(_PublishDetailsRow.default, {
|
||||||
type: "radio",
|
label: _react.default.createElement(_ChooseAnonymousPublishRadio.default, {
|
||||||
name: "anonymous-or-channel",
|
publishInChannel: this.props.publishInChannel,
|
||||||
id: "anonymous-radio",
|
toggleAnonymousPublish: this.toggleAnonymousPublish
|
||||||
className: "input-radio",
|
}),
|
||||||
value: "anonymous",
|
content: _react.default.createElement(_ChooseChannelPublishRadio.default, {
|
||||||
checked: !this.props.publishInChannel,
|
publishInChannel: this.props.publishInChannel,
|
||||||
onChange: this.toggleAnonymousPublish
|
toggleAnonymousPublish: this.toggleAnonymousPublish
|
||||||
}), _react.default.createElement("label", {
|
})
|
||||||
className: "label label--pointer",
|
}), _react.default.createElement(_ErrorDisplay.default, {
|
||||||
htmlFor: "anonymous-radio"
|
errorMessage: this.props.channelError,
|
||||||
}, "Anonymous")), _react.default.createElement("div", null, _react.default.createElement("input", {
|
defaultMessage: 'Publish anonymously or in a channel'
|
||||||
type: "radio",
|
}), this.props.publishInChannel && _react.default.createElement("div", null, _react.default.createElement(_PublishDetailsRow.default, {
|
||||||
name: "anonymous-or-channel",
|
label: _react.default.createElement(_Label.default, {
|
||||||
id: "channel-radio",
|
value: 'Channel:'
|
||||||
className: "input-radio",
|
}),
|
||||||
value: "in a channel",
|
content: _react.default.createElement(_ChannelSelectDropdown.default, {
|
||||||
checked: this.props.publishInChannel,
|
selectedChannel: this.props.selectedChannel,
|
||||||
onChange: this.toggleAnonymousPublish
|
handleSelection: this.handleSelection
|
||||||
}), _react.default.createElement("label", {
|
}, "loggedInChannelName=", this.props.loggedInChannelName)
|
||||||
className: "label label--pointer",
|
}), this.props.selectedChannel === _publish_channel_select_states.LOGIN && _react.default.createElement(_ChannelLoginForm.default, null), this.props.selectedChannel === _publish_channel_select_states.CREATE && _react.default.createElement(_ChannelCreateForm.default, null)));
|
||||||
htmlFor: "channel-radio"
|
|
||||||
}, "In a channel")), this.props.channelError ? _react.default.createElement("p", {
|
|
||||||
className: "info-message--failure"
|
|
||||||
}, this.props.channelError) : _react.default.createElement("p", {
|
|
||||||
className: "info-message"
|
|
||||||
}, "Publish anonymously or in a channel")), this.props.publishInChannel && _react.default.createElement("div", null, _react.default.createElement("div", null, _react.default.createElement("label", {
|
|
||||||
className: "label",
|
|
||||||
htmlFor: "channel-name-select"
|
|
||||||
}, "Channel:")), _react.default.createElement("div", null, _react.default.createElement("select", {
|
|
||||||
type: "text",
|
|
||||||
id: "channel-name-select",
|
|
||||||
className: "select select--arrow",
|
|
||||||
value: this.props.selectedChannel,
|
|
||||||
onChange: this.handleSelection
|
|
||||||
}, this.props.loggedInChannelName && _react.default.createElement("option", {
|
|
||||||
value: this.props.loggedInChannelName,
|
|
||||||
id: "publish-channel-select-channel-option"
|
|
||||||
}, this.props.loggedInChannelName), _react.default.createElement("option", {
|
|
||||||
value: states.LOGIN
|
|
||||||
}, "Existing"), _react.default.createElement("option", {
|
|
||||||
value: states.CREATE
|
|
||||||
}, "New"))), this.props.selectedChannel === states.LOGIN && _react.default.createElement(_ChannelLoginForm.default, null), this.props.selectedChannel === states.CREATE && _react.default.createElement(_ChannelCreateForm.default, null)));
|
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,11 @@ exports.default = void 0;
|
||||||
|
|
||||||
var _react = _interopRequireDefault(require("react"));
|
var _react = _interopRequireDefault(require("react"));
|
||||||
|
|
||||||
var _ExpandingTextArea = _interopRequireDefault(require("@components/ExpandingTextArea"));
|
var _PublishDescriptionInput = _interopRequireDefault(require("@components/PublishDescriptionInput"));
|
||||||
|
|
||||||
|
var _PublishLicenseInput = _interopRequireDefault(require("@components/PublishLicenseInput"));
|
||||||
|
|
||||||
|
var _PublishNsfwInput = _interopRequireDefault(require("@components/PublishNsfwInput"));
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
|
@ -67,47 +71,15 @@ function (_React$Component) {
|
||||||
}, {
|
}, {
|
||||||
key: "render",
|
key: "render",
|
||||||
value: function render() {
|
value: function render() {
|
||||||
return _react.default.createElement("div", null, this.props.showMetadataInputs && _react.default.createElement("div", null, _react.default.createElement("div", null, _react.default.createElement("div", null, _react.default.createElement("label", {
|
return _react.default.createElement("div", null, this.props.showMetadataInputs && _react.default.createElement("div", null, _react.default.createElement(_PublishDescriptionInput.default, {
|
||||||
htmlFor: "publish-license",
|
description: this.props.description,
|
||||||
className: "label"
|
handleInput: this.handleInput
|
||||||
}, "Description:")), _react.default.createElement("div", null, _react.default.createElement(_ExpandingTextArea.default, {
|
}), _react.default.createElement(_PublishLicenseInput.default, {
|
||||||
id: "publish-description",
|
handleSelect: this.handleSelect
|
||||||
className: "textarea textarea--primary textarea--full-width",
|
}), _react.default.createElement(_PublishNsfwInput.default, {
|
||||||
rows: 1,
|
nsfw: this.props.nsfw,
|
||||||
maxLength: 2000,
|
handleInput: this.handleInput
|
||||||
style: {
|
})), _react.default.createElement("button", {
|
||||||
maxHeight: 200
|
|
||||||
},
|
|
||||||
name: "description",
|
|
||||||
placeholder: "Optional description",
|
|
||||||
value: this.props.description,
|
|
||||||
onChange: this.handleInput
|
|
||||||
}))), _react.default.createElement("div", null, _react.default.createElement("div", null, _react.default.createElement("label", {
|
|
||||||
htmlFor: "publish-license",
|
|
||||||
className: "label"
|
|
||||||
}, "License:")), _react.default.createElement("div", null, _react.default.createElement("select", {
|
|
||||||
type: "text",
|
|
||||||
name: "license",
|
|
||||||
id: "publish-license",
|
|
||||||
className: "select select--primary",
|
|
||||||
onChange: this.handleSelect
|
|
||||||
}, _react.default.createElement("option", {
|
|
||||||
value: " "
|
|
||||||
}, "Unspecified"), _react.default.createElement("option", {
|
|
||||||
value: "Public Domain"
|
|
||||||
}, "Public Domain"), _react.default.createElement("option", {
|
|
||||||
value: "Creative Commons"
|
|
||||||
}, "Creative Commons")))), _react.default.createElement("div", null, _react.default.createElement("div", null, _react.default.createElement("label", {
|
|
||||||
htmlFor: "publish-nsfw",
|
|
||||||
className: "label"
|
|
||||||
}, "Mature:")), _react.default.createElement("div", null, _react.default.createElement("input", {
|
|
||||||
className: "input-checkbox",
|
|
||||||
type: "checkbox",
|
|
||||||
id: "publish-nsfw",
|
|
||||||
name: "nsfw",
|
|
||||||
value: this.props.nsfw,
|
|
||||||
onChange: this.handleInput
|
|
||||||
})))), _react.default.createElement("button", {
|
|
||||||
className: "button--secondary",
|
className: "button--secondary",
|
||||||
onClick: this.toggleShowInputs
|
onClick: this.toggleShowInputs
|
||||||
}, this.props.showMetadataInputs ? 'less' : 'more'));
|
}, this.props.showMetadataInputs ? 'less' : 'more'));
|
||||||
|
|
|
@ -50,7 +50,7 @@ option {
|
||||||
padding-right: 1.5em;
|
padding-right: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-text--primary, .select--primary {
|
.input-area--primary {
|
||||||
border-bottom: 1px solid #9b9b9b;
|
border-bottom: 1px solid #9b9b9b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,8 +62,8 @@ option {
|
||||||
border-bottom: 1px solid #9b9b9b;
|
border-bottom: 1px solid #9b9b9b;
|
||||||
}
|
}
|
||||||
|
|
||||||
.textarea--primary:focus {
|
.input-area--primary:focus {
|
||||||
border-bottom: 1px solid #9b9b9b;
|
border-bottom: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-text--full-width, .textarea--full-width {
|
.input-text--full-width, .textarea--full-width {
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
@import 'components/_column';
|
@import 'components/_column';
|
||||||
@import 'components/_row';
|
@import 'components/_row';
|
||||||
@import 'components/_nav-bar';
|
@import 'components/_nav-bar';
|
||||||
|
@import 'components/_publish-details-row';
|
||||||
@import 'containers/_dropzone';
|
@import 'containers/_dropzone';
|
||||||
@import 'containers/_publish-url-input';
|
@import 'containers/_publish-url-input';
|
||||||
@import 'containers/_site-description';
|
@import 'containers/_site-description';
|
||||||
|
|
14
client/scss/components/_publish-details-row.scss
Normal file
14
client/scss/components/_publish-details-row.scss
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
.publish-details-row {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.publish-details-label {
|
||||||
|
width: 30%;
|
||||||
|
}
|
||||||
|
.publish-details-content {
|
||||||
|
width: 70%;
|
||||||
|
}
|
25
client/src/components/ChannelSelectDropdown/index.jsx
Normal file
25
client/src/components/ChannelSelectDropdown/index.jsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { LOGIN, CREATE } from '../../constants/publish_channel_select_states';
|
||||||
|
|
||||||
|
const ChannelSelectDropdown = ({ selectedChannel, handleSelection, loggedInChannelName }) => {
|
||||||
|
return (
|
||||||
|
<select
|
||||||
|
id='channel-name-select'
|
||||||
|
className='select select--arrow'
|
||||||
|
value={selectedChannel}
|
||||||
|
onChange={handleSelection}>
|
||||||
|
{ loggedInChannelName && (
|
||||||
|
<option
|
||||||
|
value={loggedInChannelName}
|
||||||
|
id='publish-channel-select-channel-option'
|
||||||
|
>
|
||||||
|
{loggedInChannelName}
|
||||||
|
</option>
|
||||||
|
)}
|
||||||
|
<option value={LOGIN}>Existing</option>
|
||||||
|
<option value={CREATE}>New</option>
|
||||||
|
</select>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ChannelSelectDropdown;
|
25
client/src/components/ChooseAnonymousPublishRadio/index.jsx
Normal file
25
client/src/components/ChooseAnonymousPublishRadio/index.jsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const ChooseAnonymousPublishRadio = ({ publishInChannel, toggleAnonymousPublish }) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<input
|
||||||
|
type='radio'
|
||||||
|
name='anonymous-or-channel'
|
||||||
|
id='anonymous-radio'
|
||||||
|
className='input-radio'
|
||||||
|
value='anonymous'
|
||||||
|
checked={!publishInChannel}
|
||||||
|
onChange={toggleAnonymousPublish}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className='label label--pointer'
|
||||||
|
htmlFor='anonymous-radio'
|
||||||
|
>
|
||||||
|
Anonymous
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ChooseAnonymousPublishRadio;
|
25
client/src/components/ChooseChannelPublishRadio/index.jsx
Normal file
25
client/src/components/ChooseChannelPublishRadio/index.jsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const ChooseChannelPublishRadio = ({ publishInChannel, toggleAnonymousPublish }) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<input
|
||||||
|
type='radio'
|
||||||
|
name='anonymous-or-channel'
|
||||||
|
id='channel-radio'
|
||||||
|
className='input-radio'
|
||||||
|
value='in a channel'
|
||||||
|
checked={publishInChannel}
|
||||||
|
onChange={toggleAnonymousPublish}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
className='label label--pointer'
|
||||||
|
htmlFor='channel-radio'
|
||||||
|
>
|
||||||
|
In a channel
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ChooseChannelPublishRadio;
|
15
client/src/components/ErrorDisplay/index.jsx
Normal file
15
client/src/components/ErrorDisplay/index.jsx
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const ErrorDisplay = ({ errorMessage, defaultMessage }) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{ errorMessage ? (
|
||||||
|
<p className='info-message--failure'>{errorMessage}</p>
|
||||||
|
) : (
|
||||||
|
<p className='info-message'>{defaultMessage}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ErrorDisplay;
|
12
client/src/components/Label/index.jsx
Normal file
12
client/src/components/Label/index.jsx
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const Label = ({ value }) => {
|
||||||
|
return (
|
||||||
|
<label
|
||||||
|
className='label'
|
||||||
|
>
|
||||||
|
{value}
|
||||||
|
</label>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default Label;
|
29
client/src/components/PublishDescriptionInput/index.jsx
Normal file
29
client/src/components/PublishDescriptionInput/index.jsx
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
import React from 'react';
|
||||||
|
import PublishDetailsRow from '@components/PublishDetailsRow';
|
||||||
|
import Label from '@components/Label';
|
||||||
|
import ExpandingTextArea from '@components/ExpandingTextArea';
|
||||||
|
|
||||||
|
const PublishDescriptionInput = ({ description, handleInput }) => {
|
||||||
|
return (
|
||||||
|
<PublishDetailsRow
|
||||||
|
label={
|
||||||
|
<Label value={'Description:'} />
|
||||||
|
}
|
||||||
|
content={
|
||||||
|
<ExpandingTextArea
|
||||||
|
id='publish-description'
|
||||||
|
className='textarea textarea--primary textarea--full-width'
|
||||||
|
rows={1}
|
||||||
|
maxLength={2000}
|
||||||
|
style={{ maxHeight: 200 }}
|
||||||
|
name='description'
|
||||||
|
placeholder='Optional description'
|
||||||
|
value={description}
|
||||||
|
onChange={handleInput}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PublishDescriptionInput;
|
14
client/src/components/PublishDetailsRow/index.jsx
Normal file
14
client/src/components/PublishDetailsRow/index.jsx
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
class PublishDetailsRow extends React.Component {
|
||||||
|
render () {
|
||||||
|
return (
|
||||||
|
<div className={'publish-details-row'}>
|
||||||
|
<div className={'publish-details-label'}>{this.props.label}</div>
|
||||||
|
<div className={'publish-details-content'}>{this.props.content}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PublishDetailsRow;
|
28
client/src/components/PublishLicenseInput/index.jsx
Normal file
28
client/src/components/PublishLicenseInput/index.jsx
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
import React from 'react';
|
||||||
|
import PublishDetailsRow from '@components/PublishDetailsRow';
|
||||||
|
import Label from '@components/Label';
|
||||||
|
|
||||||
|
const PublishLicenseInput = ({ handleSelect }) => {
|
||||||
|
return (
|
||||||
|
<PublishDetailsRow
|
||||||
|
label={
|
||||||
|
<Label value={'License:'} />
|
||||||
|
}
|
||||||
|
content={
|
||||||
|
<select
|
||||||
|
type='text'
|
||||||
|
name='license'
|
||||||
|
id='publish-license'
|
||||||
|
className='select select--primary'
|
||||||
|
onChange={handleSelect}
|
||||||
|
>
|
||||||
|
<option value=' '>Unspecified</option>
|
||||||
|
<option value='Public Domain'>Public Domain</option>
|
||||||
|
<option value='Creative Commons'>Creative Commons</option>
|
||||||
|
</select>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PublishLicenseInput;
|
25
client/src/components/PublishNsfwInput/index.jsx
Normal file
25
client/src/components/PublishNsfwInput/index.jsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import React from 'react';
|
||||||
|
import PublishDetailsRow from '@components/PublishDetailsRow';
|
||||||
|
import Label from '@components/Label';
|
||||||
|
|
||||||
|
const PublishNsfwInput = ({ nsfw, handleInput }) => {
|
||||||
|
return (
|
||||||
|
<PublishDetailsRow
|
||||||
|
label={
|
||||||
|
<Label value={'Mature:'} />
|
||||||
|
}
|
||||||
|
content={
|
||||||
|
<input
|
||||||
|
className='input-checkbox'
|
||||||
|
type='checkbox'
|
||||||
|
id='publish-nsfw'
|
||||||
|
name='nsfw'
|
||||||
|
value={nsfw}
|
||||||
|
onChange={handleInput}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PublishNsfwInput;
|
|
@ -1,5 +1,55 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import request from '../../utils/request';
|
import request from '../../utils/request';
|
||||||
|
import ErrorDisplay from '@components/ErrorDisplay';
|
||||||
|
import PublishDetailsRow from '@components/PublishDetailsRow';
|
||||||
|
import Label from '@components/Label';
|
||||||
|
|
||||||
|
const ChannelLoginNameInput = ({ channelName, handleInput }) => {
|
||||||
|
return (
|
||||||
|
<PublishDetailsRow
|
||||||
|
label={
|
||||||
|
<Label value={'Name:'} />
|
||||||
|
}
|
||||||
|
content={
|
||||||
|
<div className='input-area--primary'>
|
||||||
|
<span>@</span>
|
||||||
|
<input
|
||||||
|
type='text'
|
||||||
|
id='channel-login-name-input'
|
||||||
|
className='input-text'
|
||||||
|
name='name'
|
||||||
|
placeholder='Your Channel Name'
|
||||||
|
value={channelName}
|
||||||
|
onChange={handleInput}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ChannelLoginPasswordInput = ({ channelPassword, handleInput }) => {
|
||||||
|
return (
|
||||||
|
<PublishDetailsRow
|
||||||
|
label={
|
||||||
|
<Label value={'Password:'} />
|
||||||
|
}
|
||||||
|
content={
|
||||||
|
<div className='input-area--primary'>
|
||||||
|
<input
|
||||||
|
type='password'
|
||||||
|
id='channel-login-password-input'
|
||||||
|
name='password'
|
||||||
|
className='input-text'
|
||||||
|
placeholder=''
|
||||||
|
value={channelPassword}
|
||||||
|
onChange={handleInput}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
class ChannelLoginForm extends React.Component {
|
class ChannelLoginForm extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
|
@ -45,35 +95,21 @@ class ChannelLoginForm extends React.Component {
|
||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<form id='channel-login-form'>
|
<div>
|
||||||
<div className='row row--wide row--short'>
|
<ChannelLoginNameInput
|
||||||
<div className='column column--3 column--sml-10'>
|
channelName={this.state.channelName}
|
||||||
<label className='label' htmlFor='channel-login-name-input'>Name:</label>
|
handleInput={this.handleInput}
|
||||||
</div><div className='column column--6 column--sml-10'>
|
/>
|
||||||
<div className='input-text--primary flex-container--row flex-container--left-bottom'>
|
<ChannelLoginPasswordInput
|
||||||
<span>@</span>
|
channelPassword={this.state.channelPassword}
|
||||||
<input type='text' id='channel-login-name-input' className='input-text' name='name' placeholder='Your Channel Name' value={this.state.channelName} onChange={this.handleInput} />
|
handleInput={this.handleInput}
|
||||||
</div>
|
/>
|
||||||
</div>
|
<ErrorDisplay
|
||||||
</div>
|
errorMessage={this.state.error}
|
||||||
<div className='row row--wide row--short'>
|
defaultMessage={'Enter the name and password for your channel'}
|
||||||
<div className='column column--3 column--sml-10'>
|
/>
|
||||||
<label className='label' htmlFor='channel-login-password-input' >Password:</label>
|
|
||||||
</div><div className='column column--6 column--sml-10'>
|
|
||||||
<div className='input-text--primary'>
|
|
||||||
<input type='password' id='channel-login-password-input' name='password' className='input-text' placeholder='' value={this.state.channelPassword} onChange={this.handleInput} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{ this.state.error ? (
|
|
||||||
<p className='info-message--failure'>{this.state.error}</p>
|
|
||||||
) : (
|
|
||||||
<p className='info-message'>Enter the name and password for your channel</p>
|
|
||||||
)}
|
|
||||||
<div className='row row--wide'>
|
|
||||||
<button className='button--primary' onClick={this.loginToChannel}>Authenticate</button>
|
<button className='button--primary' onClick={this.loginToChannel}>Authenticate</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ChannelLoginForm from '@containers/ChannelLoginForm';
|
import ChannelLoginForm from '@containers/ChannelLoginForm';
|
||||||
import ChannelCreateForm from '@containers/ChannelCreateForm';
|
import ChannelCreateForm from '@containers/ChannelCreateForm';
|
||||||
import * as states from '../../constants/publish_channel_select_states';
|
import { LOGIN, CREATE } from '../../constants/publish_channel_select_states';
|
||||||
|
import PublishDetailsRow from '@components/PublishDetailsRow';
|
||||||
|
import ChooseAnonymousPublishRadio from '@components/ChooseAnonymousPublishRadio';
|
||||||
|
import ChooseChannelPublishRadio from '@components/ChooseChannelPublishRadio';
|
||||||
|
import ErrorDisplay from '@components/ErrorDisplay';
|
||||||
|
import Label from '@components/Label';
|
||||||
|
import ChannelSelectDropdown from '@components/ChannelSelectDropdown';
|
||||||
|
|
||||||
class ChannelSelect extends React.Component {
|
class ChannelSelect extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
|
@ -24,35 +30,41 @@ class ChannelSelect extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<form>
|
<PublishDetailsRow
|
||||||
<div>
|
label={
|
||||||
<input type='radio' name='anonymous-or-channel' id='anonymous-radio' className='input-radio' value='anonymous' checked={!this.props.publishInChannel} onChange={this.toggleAnonymousPublish} />
|
<ChooseAnonymousPublishRadio
|
||||||
<label className='label label--pointer' htmlFor='anonymous-radio'>Anonymous</label>
|
publishInChannel={this.props.publishInChannel}
|
||||||
</div>
|
toggleAnonymousPublish={this.toggleAnonymousPublish}
|
||||||
<div>
|
/>
|
||||||
<input type='radio' name='anonymous-or-channel' id='channel-radio' className='input-radio' value='in a channel' checked={this.props.publishInChannel} onChange={this.toggleAnonymousPublish} />
|
}
|
||||||
<label className='label label--pointer' htmlFor='channel-radio'>In a channel</label>
|
content={
|
||||||
</div>
|
<ChooseChannelPublishRadio
|
||||||
{ this.props.channelError ? (
|
publishInChannel={this.props.publishInChannel}
|
||||||
<p className='info-message--failure'>{this.props.channelError}</p>
|
toggleAnonymousPublish={this.toggleAnonymousPublish}
|
||||||
) : (
|
/>
|
||||||
<p className='info-message'>Publish anonymously or in a channel</p>
|
}
|
||||||
)}
|
/>
|
||||||
</form>
|
<ErrorDisplay
|
||||||
|
errorMessage={this.props.channelError}
|
||||||
|
defaultMessage={'Publish anonymously or in a channel'}
|
||||||
|
/>
|
||||||
|
|
||||||
{ this.props.publishInChannel && (
|
{ this.props.publishInChannel && (
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<PublishDetailsRow
|
||||||
<label className='label' htmlFor='channel-name-select'>Channel:</label>
|
label={
|
||||||
</div>
|
<Label value={'Channel:'} />
|
||||||
<div>
|
}
|
||||||
<select type='text' id='channel-name-select' className='select select--arrow' value={this.props.selectedChannel} onChange={this.handleSelection}>
|
content={
|
||||||
{ this.props.loggedInChannelName && <option value={this.props.loggedInChannelName} id='publish-channel-select-channel-option'>{this.props.loggedInChannelName}</option> }
|
<ChannelSelectDropdown
|
||||||
<option value={states.LOGIN}>Existing</option>
|
selectedChannel={this.props.selectedChannel}
|
||||||
<option value={states.CREATE}>New</option>
|
handleSelection={this.handleSelection}>
|
||||||
</select>
|
loggedInChannelName={this.props.loggedInChannelName}
|
||||||
</div>
|
</ChannelSelectDropdown>
|
||||||
{ (this.props.selectedChannel === states.LOGIN) && <ChannelLoginForm /> }
|
}
|
||||||
{ (this.props.selectedChannel === states.CREATE) && <ChannelCreateForm /> }
|
/>
|
||||||
|
{ (this.props.selectedChannel === LOGIN) && <ChannelLoginForm /> }
|
||||||
|
{ (this.props.selectedChannel === CREATE) && <ChannelCreateForm /> }
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ExpandingTextArea from '@components/ExpandingTextArea';
|
import PublishDescriptionInput from '@components/PublishDescriptionInput';
|
||||||
|
import PublishLicenseInput from '@components/PublishLicenseInput';
|
||||||
|
import PublishNsfwInput from '@components/PublishNsfwInput';
|
||||||
|
|
||||||
class PublishMetadataInputs extends React.Component {
|
class PublishMetadataInputs extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
|
@ -27,58 +29,19 @@ class PublishMetadataInputs extends React.Component {
|
||||||
<div>
|
<div>
|
||||||
{this.props.showMetadataInputs && (
|
{this.props.showMetadataInputs && (
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<PublishDescriptionInput
|
||||||
<div>
|
description={this.props.description}
|
||||||
<label htmlFor='publish-license' className='label'>Description:</label>
|
handleInput={this.handleInput}
|
||||||
</div>
|
/>
|
||||||
<div>
|
|
||||||
<ExpandingTextArea
|
<PublishLicenseInput
|
||||||
id='publish-description'
|
handleSelect={this.handleSelect}
|
||||||
className='textarea textarea--primary textarea--full-width'
|
/>
|
||||||
rows={1}
|
|
||||||
maxLength={2000}
|
<PublishNsfwInput
|
||||||
style={{ maxHeight: 200 }}
|
nsfw={this.props.nsfw}
|
||||||
name='description'
|
handleInput={this.handleInput}
|
||||||
placeholder='Optional description'
|
|
||||||
value={this.props.description}
|
|
||||||
onChange={this.handleInput} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<label htmlFor='publish-license' className='label'>License:</label>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<select
|
|
||||||
type='text'
|
|
||||||
name='license'
|
|
||||||
id='publish-license'
|
|
||||||
className='select select--primary'
|
|
||||||
onChange={this.handleSelect}
|
|
||||||
>
|
|
||||||
<option value=' '>Unspecified</option>
|
|
||||||
<option value='Public Domain'>Public Domain</option>
|
|
||||||
<option value='Creative Commons'>Creative Commons</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<label htmlFor='publish-nsfw' className='label'>Mature:</label>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input
|
|
||||||
className='input-checkbox'
|
|
||||||
type='checkbox'
|
|
||||||
id='publish-nsfw'
|
|
||||||
name='nsfw'
|
|
||||||
value={this.props.nsfw}
|
|
||||||
onChange={this.handleInput}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<button
|
<button
|
||||||
|
|
1
index.js
1
index.js
|
@ -85,6 +85,7 @@ function Server () {
|
||||||
// sync sequelize
|
// sync sequelize
|
||||||
createDatabaseIfNotExists()
|
createDatabaseIfNotExists()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
logger.info('getting LBC balance from lbrynet...');
|
||||||
return getWalletBalance();
|
return getWalletBalance();
|
||||||
})
|
})
|
||||||
.then(balance => {
|
.then(balance => {
|
||||||
|
|
Loading…
Reference in a new issue