Undo some accidental changes

This commit is contained in:
Justin 2022-06-16 07:56:16 -04:00
parent b124705bfd
commit 06888b8ebc
4 changed files with 20 additions and 32 deletions

View file

@ -196,7 +196,7 @@
"expired": false,
"expires_at": "2022-03-12T01:33:18.000Z",
"id": "AHHue67gF2JDqCQGhc",
"multiple": true,
"multiple": false,
"options": [
{
"title": "Regular emoji 😍 ",

View file

@ -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'),
];

View file

@ -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,
}
// {/* <li key={index}>
// <label className={classNames('poll__text', { selectable: !showResults })}>
// <input
// name='vote-options'
// type={poll.multiple ? 'checkbox' : 'radio'}
// disabled
// />
// <span className={classNames('poll__input', { checkbox: poll.multiple })} />
// <span dangerouslySetInnerHTML={{ __html: option.title_emojified }} />
// </label>
// </li> */}
const PollPreview: React.FC<IPollPreview> = ({ poll }) => {
const renderOption = (option: PollOptionEntity, index: number) => {
const showResults = poll.voted || poll.expired;
return (
<label className='rounded-tl-md rounded-tr-md relative border p-4 flex flex-col cursor-pointer md:pl-4 md:pr-6 md:grid md:grid-cols-3 focus:outline-none'>
<span className='flex items-center text-sm'>
<input type='radio' name='pricing-plan' value='Startup' className='h-4 w-4 text-indigo-600 border-gray-300 focus:ring-indigo-500' aria-labelledby='pricing-plans-0-label' aria-describedby='pricing-plans-0-description-0 pricing-plans-0-description-1' />
<span id='pricing-plans-0-label' className='ml-3 font-medium'>Startup</span>
</span>
<span id='pricing-plans-0-description-0' className='ml-6 pl-1 text-sm md:ml-0 md:pl-0 md:text-center'>
<span className='font-medium'>$29 / mo</span>
<span>($290 / yr)</span>
</span>
<span id='pricing-plans-0-description-1' className='ml-6 pl-1 text-sm md:ml-0 md:pl-0 md:text-right'>Up to 5 active job postings</span>
<li key={index}>
<label className={classNames('poll__text', { selectable: !showResults })}>
<input
name='vote-options'
type={poll.multiple ? 'checkbox' : 'radio'}
disabled
/>
<span className={classNames('poll__input', { checkbox: poll.multiple })} />
<span dangerouslySetInnerHTML={{ __html: option.title_emojified }} />
</label>
</li>
);
};
@ -47,9 +33,11 @@ const PollPreview: React.FC<IPollPreview> = ({ poll }) => {
}
return (
<Stack>
<div className='poll'>
<ul>
{poll.options.map((option, i) => renderOption(option, i))}
</Stack>
</ul>
</div>
);
};