Skip to content

Commit

Permalink
fix audio
Browse files Browse the repository at this point in the history
  • Loading branch information
kchenturtles committed Jul 22, 2024
1 parent b2ab7a3 commit 6ea4c05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/IonicCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
IonIcon,
IonLabel,
} from "@ionic/react";
import React, { useState } from "react";
import React, { useEffect, useState } from "react";
import CardModal from "./CardModal";
import { playCircle, playCircleOutline } from "ionicons/icons";
import Button from "./Button";
Expand Down Expand Up @@ -49,6 +49,10 @@ export default function IonicCard({
const [hover, setHover] = useState(false);
const [playCircleColor, setPlayCircleColor] = useState("invert(1.0)");

useEffect(() => {
setSentences(body.split("."));
} , [body]);

return (
<div
style={{
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Discover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const Discover: React.FC = () => {
tag: "article".concat(
resource.attributes.speech_generated === 1 ? " audio" : ""
),
manual_id: resource.attributes.manual_id,
speech_generated: resource.attributes.speech_generated,
body: resource.attributes.body,
date: new Date(resource.attributes.published_date),
Expand Down Expand Up @@ -144,7 +145,7 @@ const Discover: React.FC = () => {
tag: "video",
speech_generated: 0,
author: resp.items[0].snippet.channelID,
manual_id: videoURL.id,
manual_id: "10000",
backgroundVideo: null,
imageURL: resp.items[0].snippet.thumbnails.high.url,
date: videoURL.attributes.site_published_date
Expand Down

0 comments on commit 6ea4c05

Please sign in to comment.