diff --git a/app/soapbox/__fixtures__/pleroma-status-with-poll-with-emojis.json b/app/soapbox/__fixtures__/pleroma-status-with-poll-with-emojis.json index 3439ebd8f..76c722a45 100644 --- a/app/soapbox/__fixtures__/pleroma-status-with-poll-with-emojis.json +++ b/app/soapbox/__fixtures__/pleroma-status-with-poll-with-emojis.json @@ -196,7 +196,7 @@ "expired": false, "expires_at": "2022-03-12T01:33:18.000Z", "id": "AHHue67gF2JDqCQGhc", - "multiple": true, + "multiple": false, "options": [ { "title": "Regular emoji 😍 ", diff --git a/app/soapbox/components/relative_timestamp.js b/app/soapbox/components/relative_timestamp.js index f6eda412d..eaffbafe4 100644 --- a/app/soapbox/components/relative_timestamp.js +++ b/app/soapbox/components/relative_timestamp.js @@ -33,8 +33,8 @@ const shortDateFormatOptions = { const SECOND = 1000; const MINUTE = 1000 * 60; -const HOUR = 1000 * 60 * 60; -const DAY = 1000 * 60 * 60 * 24; +const HOUR = 1000 * 60 * 60; +const DAY = 1000 * 60 * 60 * 24; const MAX_DELAY = 2147483647; @@ -160,12 +160,12 @@ class RelativeTimestamp extends React.Component { _scheduleNextUpdate() { clearTimeout(this._timer); - const { timestamp } = this.props; - const delta = (new Date(timestamp)).getTime() - this.state.now; - const unitDelay = getUnitDelay(selectUnits(delta)); - const unitRemainder = Math.abs(delta % unitDelay); + const { timestamp } = this.props; + const delta = (new Date(timestamp)).getTime() - this.state.now; + const unitDelay = getUnitDelay(selectUnits(delta)); + const unitRemainder = Math.abs(delta % unitDelay); const updateInterval = 1000 * 10; - const delay = delta < 0 ? Math.max(updateInterval, unitDelay - unitRemainder) : Math.max(updateInterval, unitRemainder); + const delay = delta < 0 ? Math.max(updateInterval, unitDelay - unitRemainder) : Math.max(updateInterval, unitRemainder); this._timer = setTimeout(() => { this.setState({ now: Date.now() }); @@ -175,7 +175,7 @@ class RelativeTimestamp extends React.Component { render() { const { timestamp, intl, year, futureDate, ...textProps } = this.props; - const date = new Date(timestamp); + const date = new Date(timestamp); const relativeTime = futureDate ? timeRemainingString(intl, date, this.state.now) : timeAgoString(intl, date, this.state.now, year); return ( diff --git a/app/soapbox/features/test_timeline/index.tsx b/app/soapbox/features/test_timeline/index.tsx index c15116a58..024f38204 100644 --- a/app/soapbox/features/test_timeline/index.tsx +++ b/app/soapbox/features/test_timeline/index.tsx @@ -18,9 +18,9 @@ const messages = defineMessages({ * These get embedded into the build, but only in this chunk, so it's okay. */ const MOCK_STATUSES: any[] = [ - require('soapbox/__fixtures__/pleroma-status-with-poll-with-emojis.json'), require('soapbox/__fixtures__/pleroma-status-with-poll.json'), require('soapbox/__fixtures__/pleroma-status-vertical-video-without-metadata.json'), + require('soapbox/__fixtures__/pleroma-status-with-poll-with-emojis.json'), require('soapbox/__fixtures__/pleroma-quote-of-quote-post.json'), require('soapbox/__fixtures__/truthsocial-status-with-external-video.json'), ]; diff --git a/app/soapbox/features/ui/components/poll_preview.tsx b/app/soapbox/features/ui/components/poll_preview.tsx index fcabbe02b..3d3b48408 100644 --- a/app/soapbox/features/ui/components/poll_preview.tsx +++ b/app/soapbox/features/ui/components/poll_preview.tsx @@ -1,44 +1,30 @@ import classNames from 'classnames'; import React from 'react'; -import { Stack } from 'soapbox/components/ui'; import { Poll as PollEntity, PollOption as PollOptionEntity } from 'soapbox/types/entities'; interface IPollPreview { poll: PollEntity, } - -// {/*
  • -// -//
  • */} - const PollPreview: React.FC = ({ poll }) => { const renderOption = (option: PollOptionEntity, index: number) => { const showResults = poll.voted || poll.expired; return ( - +
  • + +
  • ); }; @@ -47,9 +33,11 @@ const PollPreview: React.FC = ({ poll }) => { } return ( - - {poll.options.map((option, i) => renderOption(option, i))} - +
    +
      + {poll.options.map((option, i) => renderOption(option, i))} +
    +
    ); };