Skip to content

Commit

Permalink
✨ Add option to change prepend time setting
Browse files Browse the repository at this point in the history
  • Loading branch information
0x46616c6b committed Apr 4, 2022
1 parent ddf325d commit a6b459e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/Ticker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Button, Card, Confirm, Icon, Label} from 'semantic-ui-react';
import {Button, Card, Confirm, Divider, Icon, Label} from 'semantic-ui-react';
import {deleteTicker} from "../api/Ticker";
import PropTypes from 'prop-types';
import ReactMarkdown from "react-markdown";
Expand Down Expand Up @@ -108,6 +108,13 @@ export default class Ticker extends React.Component {
<Card.Description>
<ReactMarkdown source={this.props.ticker.description}/>
</Card.Description>
<Card.Description>
<Divider />
<Icon color={this.props.ticker.prepend_time ? 'green' : 'gray'}
name={this.props.ticker.prepend_time ? 'toggle on' : 'toggle off'}
/>
Prepend Time
</Card.Description>
</Card.Content>
<Card.Content>
<Button.Group size='tiny' fluid compact>
Expand Down
9 changes: 9 additions & 0 deletions src/components/TickerForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export default class TickerForm extends React.Component {
this.props.ticker.location
);

console.log(formData);

this.updateTicker(formData);
}

Expand Down Expand Up @@ -172,6 +174,13 @@ export default class TickerForm extends React.Component {
onChange={(event, input) => this.form.description = input.value}
required
/>
<Form.Checkbox
toggle
label='Prepend Time'
name='prepend_time'
defaultChecked={this.props.ticker.prepend_time}
onChange={(event, input) => this.form.prepend_time = input.checked}
/>
<Header dividing>Information</Header>
<Form.Group widths='equal'>
<Form.Input label='Author'>
Expand Down

0 comments on commit a6b459e

Please sign in to comment.