Skip to content

Commit

Permalink
🍁 [Frontend] The Broadcast isn't appearing in correct format Fixed (#956
Browse files Browse the repository at this point in the history
)

* Boardcast

* all
  • Loading branch information
Hemu21 authored May 24, 2024
1 parent fa0368e commit f0a7bd7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export function Card(props) {
setFlipped(!flipped);
};

const handleOpen = (s, h, i) => {
const handleOpen = (s, h, i, l) => {
setOpen(true);
setData({ head: h, desc: s, img: i });
setData({ head: h, desc: s, img: i, link: l });
};

const handleClose = () => {
Expand Down Expand Up @@ -53,9 +53,7 @@ export function Card(props) {
>
<div className={style["clickable-card"]}>
<div className={style["card-title"]}>{props.project.title}</div>
<div className={style["card-content"]}>
{props.project.content.substring(0, 400)}...
</div>
<div className={style["card-content"]} dangerouslySetInnerHTML={{__html: props.project.content}} />
<div className={style["card-date"]}>
{months[date.getMonth()]},{date.getFullYear()}
</div>
Expand Down Expand Up @@ -86,7 +84,8 @@ export function Card(props) {
handleOpen(
props.project.content,
props.project.title,
props.project.imageUrl[0]
props.project.imageUrl[0],
props.project.link
)
}
className={
Expand Down
10 changes: 4 additions & 6 deletions frontend/src/pages/Broadcast/Component/Carousel/Carousel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export function Carousel(props) {
const [open, setOpen] = useState(false);
const [dataa, setDataa] = useState([]);
const [isLoaded, setLoaded] = useState(false);
const handleOpen = (s, h, i) => {
const handleOpen = (s, h, i, l) => {
setOpen(true);
setData({ head: h, desc: s, img: i });
setData({ head: h, desc: s, img: i, link: l });
};

const handleClose = () => {
Expand Down Expand Up @@ -131,17 +131,15 @@ export function Carousel(props) {
: `${style["slide-card-light"]} ${style["slide-card"]}`
}
onClick={() =>
handleOpen(item.content, item.title, item.imageUrl[0])
handleOpen(item.content, item.title, item.imageUrl[0], item?.link)
}
>
<div
style={dark ? cardImageArrayDark[i] : cardImageArrayLight[i]}
></div>

<h3 className={style["card-head"]}>{item.title}</h3>
<div className={style["card-text"]}>
{item.content.substring(0, 210)}...
</div>
<div className={style["card-text"]} dangerouslySetInnerHTML={{__html: item.content}} />
</div>
))}
</OwlCarousel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import style from "./modals.module.scss";

export function Modals(props) {
let dark = props.theme;
console.log(props)
return (
<div>
<Modal
Expand Down Expand Up @@ -53,14 +54,15 @@ export function Modals(props) {
className={style["image"]}
alt="dummy_img"
/>
<div className={style["cont"]}>{props.data.desc}</div>
<div className={style["cont"]} dangerouslySetInnerHTML={{__html:props.data.desc}} />
</div>
<h1
className={
dark
? `${style["link-dark"]} ${style["link"]}`
: `${style["link-light"]} ${style["link"]}`
}
onClick={()=>window.open(props.data.link,"_blank")}
>
Link
</h1>
Expand Down

0 comments on commit f0a7bd7

Please sign in to comment.