Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6618 | Rev 6624 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6618 Rev 6623
Línea 35... Línea 35...
35
 
35
 
36
import FeedModal from './FeedModal'
36
import FeedModal from './FeedModal'
37
import withReactions from './withReaction'
37
import withReactions from './withReaction'
38
import IconButton from '../UI/IconButton'
38
import IconButton from '../UI/IconButton'
-
 
39
import ConfirmModal from '../modals/ConfirmModal'
Línea 39... Línea 40...
39
import ConfirmModal from '../modals/ConfirmModal'
40
import SurveyForm from '../survey-form/SurveyForm'
40
 
41
 
41
const Feed = ({ feed, owner_shared, image }) => {
42
const Feed = ({ feed, owner_shared, image }) => {
42
  const {
43
  const {
Línea 199... Línea 200...
199
            setShow(true)
200
            setShow(true)
200
          }
201
          }
201
        >
202
        >
202
          <Feed.Content
203
          <Feed.Content
203
            isShare={!!feed.shared_name}
204
            isShare={!!feed.shared_name}
204
            ownerFileImage={feed.owner_file_image}
205
            image={feed.owner_file_image}
205
            ownerFileVideo={feed.owner_file_video}
206
            fileVideo={feed.owner_file_video}
206
            ownerFileImagePreview={feed.owner_file_image_preview}
207
            imagePreview={feed.owner_file_image_preview}
207
            ownerFileDocument={feed.owner_file_document}
208
            document={feed.owner_file_document}
208
            ownerDescription={feed.owner_description}
209
            description={feed.owner_description}
-
 
210
            type={feed.feed_content_type}
-
 
211
            voteUrl={feed.feed_vote_url}
209
            sharedItem={{
212
            sharedItem={{
210
              name: feed.shared_name,
213
              name: feed.shared_name,
211
              image: feed.shared_image,
214
              image: feed.shared_image,
212
              time_elapse: feed.shared_time_elapse,
215
              time_elapse: feed.shared_time_elapse,
213
              description: feed.shared_description,
216
              description: feed.shared_description,
Línea 317... Línea 320...
317
  )
320
  )
318
}
321
}
Línea 319... Línea 322...
319
 
322
 
320
export const FeedContent = ({
323
export const FeedContent = ({
321
  showDescription = true,
324
  showDescription = true,
322
  ownerFileImage,
325
  image,
323
  ownerFileVideo,
326
  video,
324
  ownerFileImagePreview,
327
  imagePreview,
325
  ownerFileDocument,
328
  document,
326
  ownerDescription,
329
  description,
327
  isShare,
330
  isShare,
-
 
331
  sharedItem,
-
 
332
  type,
328
  sharedItem,
333
  voteUrl,
329
}) => {
334
}) => {
Línea 330... Línea 335...
330
  const labels = useSelector((state) => state.labels)
335
  const labels = useSelector((state) => state.labels)
331
 
336
 
332
  return (
337
  return (
333
    <div className="job_descp">
338
    <div className="job_descp">
334
      {showDescription && (
339
      {type !== 'fast-survey' && showDescription ? (
335
        <Feed.Description ownerDescription={ownerDescription} />
340
        <Feed.Description description={description} />
-
 
341
      ) : (
336
      )}
342
        <SurveyForm
-
 
343
          active={description.active}
-
 
344
          question={description.question}
-
 
345
          answers={[
-
 
346
            description.answer1,
-
 
347
            description.answer2,
-
 
348
            description.answer3,
337
      {ownerFileImage && (
349
            description.answer4,
-
 
350
            description.answer5,
338
        <img src={ownerFileImage} className="Entradas" loading="lazy" />
351
          ]}
-
 
352
          votes={
-
 
353
            description.votes1 && [
-
 
354
              description.votes1,
339
      )}
355
              description.votes2,
340
      {ownerFileVideo && (
356
              description.votes3,
341
        <video
357
              description.votes4,
-
 
358
              description.votes5,
342
          src={ownerFileVideo}
359
            ]
343
          controls
360
          }
-
 
361
          time={description.time_remaining}
344
          poster={ownerFileImagePreview}
362
          voteUrl={voteUrl}
345
          preload="none"
363
          resultType={description.result_type}
-
 
364
        />
-
 
365
      )}
-
 
366
 
-
 
367
      {image && <img src={image} className="Entradas" loading="lazy" />}
-
 
368
      {video && (
346
        />
369
        <video src={video} controls poster={imagePreview} preload="none" />
347
      )}
370
      )}
348
      {ownerFileDocument && (
371
      {document && (
349
        <a href={ownerFileDocument} target="_blank" rel="noreferrer">
372
        <a href={document} target="_blank" rel="noreferrer">
350
          {labels.DOWNLOAD}
373
          {labels.DOWNLOAD}
351
        </a>
374
        </a>
352
      )}
375
      )}
353
      {isShare && (
376
      {isShare && (
354
        <Feed.Shared
377
        <Feed.Shared
355
          name={sharedItem.name}
378
          name={sharedItem.name}
356
          image={sharedItem.image}
379
          image={sharedItem.image}
357
          timeElapse={sharedItem.time_elapse}
380
          timeElapse={sharedItem.time_elapse}
358
          description={sharedItem.description}
381
          description={sharedItem.description}
359
          fileVideo={sharedItem.file_video}
-
 
360
          fileImagePreview={sharedItem.file_image_preview}
382
          video={sharedItem.file_video}
361
          fileImage={sharedItem.file_image}
383
          imagePreview={sharedItem.file_image_preview}
362
          fileDocument={sharedItem.file_document}
384
          document={sharedItem.file_document}
363
        />
385
        />
364
      )}
386
      )}
365
    </div>
387
    </div>
366
  )
388
  )
367
}
389
}
368
export const FeedDescription = ({ ownerDescription }) => {
390
export const FeedDescription = ({ description }) => {
Línea 369... Línea 391...
369
  const [isReadMoreActive, setIsReadMoreActive] = useState(false)
391
  const [isReadMoreActive, setIsReadMoreActive] = useState(false)
Línea 386... Línea 408...
386
      )
408
      )
387
    }
409
    }
388
    return <p>{fullText}</p>
410
    return <p>{fullText}</p>
389
  }
411
  }
Línea 390... Línea -...
390
 
-
 
391
  return (
412
 
392
    <div className="show-read-more">{htmlParsedText(ownerDescription)}</div>
-
 
393
  )
413
  return <div className="show-read-more">{htmlParsedText(description)}</div>
Línea 394... Línea 414...
394
}
414
}
395
 
415
 
396
export const FeedShared = ({
416
export const FeedShared = ({
397
  name,
417
  name,
398
  image,
418
  image,
399
  timeElapse,
419
  timeElapse,
400
  description,
420
  description,
401
  fileVideo,
-
 
402
  fileImagePreview,
421
  video,
403
  fileImage,
422
  imagePreview,
404
  fileDocument,
423
  document,
405
}) => {
424
}) => {
Línea 406... Línea 425...
406
  const [isReadMoreActive, setIsReadMoreActive] = useState(false)
425
  const [isReadMoreActive, setIsReadMoreActive] = useState(false)
Línea 437... Línea 456...
437
            </div>
456
            </div>
438
          </div>
457
          </div>
439
        </div>
458
        </div>
440
        <div className="job_descp">
459
        <div className="job_descp">
441
          <div className="show-read-more">{htmlParsedText(description)}</div>
460
          <div className="show-read-more">{htmlParsedText(description)}</div>
442
          {fileImage && (
-
 
443
            <img src={fileImage} className="Entradas" loading="lazy" />
461
          {image && <img src={image} className="Entradas" loading="lazy" />}
444
          )}
-
 
445
          {fileVideo && (
462
          {video && (
446
            <video
-
 
447
              src={fileVideo}
-
 
448
              controls
-
 
449
              poster={fileImagePreview}
463
            <video src={video} controls poster={imagePreview} preload="none" />
450
              preload="none"
-
 
451
            />
-
 
452
          )}
464
          )}
453
          {fileDocument && (
465
          {document && (
454
            <a href={fileDocument} target="_blank" rel="noreferrer">
466
            <a href={document} target="_blank" rel="noreferrer">
455
              {labels.DOWNLOAD}
467
              {labels.DOWNLOAD}
456
            </a>
468
            </a>
457
          )}
469
          )}
458
        </div>
470
        </div>
459
      </div>
471
      </div>