diff --git a/src/components/MessageForm.js b/src/components/MessageForm.js
index f9619873..14e54a48 100644
--- a/src/components/MessageForm.js
+++ b/src/components/MessageForm.js
@@ -17,6 +17,8 @@ const initialState = {
formErrorMessage: '',
};
+const MESSAGE_LIMIT = 280;
+
export default class MessageForm extends React.Component {
constructor(props) {
super(props);
@@ -26,19 +28,15 @@ export default class MessageForm extends React.Component {
this.state = initialState;
}
- counterLimit() {
- return this.props.ticker.prepend_time ? 274 : 280
- }
-
handleInput(event, input) {
let color;
let errorMessage = '';
let error = false;
//TODO: Calculate length for Twitter (cutting links to 20 characters)
- if (input.value.length > this.counterLimit()) {
+ if (input.value.length > MESSAGE_LIMIT) {
color = 'red';
- errorMessage = `The message is too long. You must remove ${input.value.length - this.counterLimit()} characters.`;
+ errorMessage = `The message is too long. You must remove ${input.value.length - MESSAGE_LIMIT} characters.`;
error = true;
} else if (input.value.length >= 260) {
color = 'orange';
@@ -61,7 +59,7 @@ export default class MessageForm extends React.Component {
let message = this.state.message, id = this.props.ticker.id, geoInformation = this.state.geoInformation,
attachments = [];
const {length} = message;
- if (length === 0 || length > this.counterLimit()) {
+ if (length === 0 || length > MESSAGE_LIMIT) {
return;
}
@@ -218,7 +216,7 @@ export default class MessageForm extends React.Component {
onChange={this.uploadAttachment.bind(this)}
/>
diff --git a/src/components/Ticker.js b/src/components/Ticker.js
index 27a1385e..0803332b 100644
--- a/src/components/Ticker.js
+++ b/src/components/Ticker.js
@@ -1,5 +1,5 @@
import React from 'react';
-import {Button, Card, Confirm, Divider, Icon, Label, Popup} from 'semantic-ui-react';
+import {Button, Card, Confirm, Icon, Label} from 'semantic-ui-react';
import {deleteTicker} from "../api/Ticker";
import PropTypes from 'prop-types';
import ReactMarkdown from "react-markdown";
@@ -108,15 +108,6 @@ export default class Ticker extends React.Component {
-
-
-
- Prepend Time
- }/>
-
@@ -147,7 +138,6 @@ Ticker.propTypes = {
domain: PropTypes.string,
description: PropTypes.string,
active: PropTypes.bool,
- prepend_time: PropTypes.bool,
information: PropTypes.shape({
author: PropTypes.string,
url: PropTypes.string,
diff --git a/src/components/TickerForm.js b/src/components/TickerForm.js
index e26073a5..ac457d41 100644
--- a/src/components/TickerForm.js
+++ b/src/components/TickerForm.js
@@ -33,7 +33,7 @@ export default class TickerForm extends React.Component {
}
let formData = CommonUtils.mapValueArray(
- ['title', 'domain', 'description', 'active', 'prepend_time'],
+ ['title', 'domain', 'description', 'active'],
this.form,
this.props.ticker
);
@@ -172,13 +172,6 @@ export default class TickerForm extends React.Component {
onChange={(event, input) => this.form.description = input.value}
required
/>
- this.form.prepend_time = input.checked}
- />
diff --git a/src/models/Ticker.js b/src/models/Ticker.js
index 01e9ad9d..626ce2fa 100644
--- a/src/models/Ticker.js
+++ b/src/models/Ticker.js
@@ -13,7 +13,6 @@ export default class Ticker {
this.domain = undefined !== props.domain ? props.domain : null;
this.description = undefined !== props.description ? props.description : null;
this.active = undefined !== props.active ? props.active : false;
- this.prepend_time = undefined !== props.prepend_time ? props.prepend_time : false;
if (undefined !== props.information) {
this.information = {
@@ -69,7 +68,6 @@ Ticker.propTypes = {
domain: PropTypes.string,
description: PropTypes.string,
active: PropTypes.bool,
- prepend_time: PropTypes.bool,
information: PropTypes.shape({
author: PropTypes.string,
url: PropTypes.string,