diff --git a/frontend/app/src/bounties/BountyDescription.tsx b/frontend/app/src/bounties/BountyDescription.tsx index 22fcc3446..a5e1a5716 100644 --- a/frontend/app/src/bounties/BountyDescription.tsx +++ b/frontend/app/src/bounties/BountyDescription.tsx @@ -102,17 +102,17 @@ const CodingLabels = styled.div` const BountyDescription = (props: BountiesDescriptionProps) => { const color = colors['light']; const [dataValue, setDataValue] = useState([]); - // const [replitLink, setReplitLink] = useState(''); + const [replitLink, setReplitLink] = useState(''); const [descriptionImage, setDescriptionImage] = useState(''); useEffect(() => { if (props.description) { - const found = props?.description.match(/(https?:\/\/.*\.(?:png|jpg|jpeg|gif))/); - // setReplitLink( - // props?.description.match( - // /https?:\/\/(www\.)?[replit]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/ - // ) - // ); + const found = props?.description.match(/(https?:\/\/.*\.(?:png|jpg|jpeg|gif))(?![^`]*`)/); + setReplitLink( + props?.description.match( + /https?:\/\/(?:www\.)?(?:replit\.[a-zA-Z0-9()]{1,256}|replit\.it)\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/ + ) + ); setDescriptionImage(found && found.length > 0 && found[0]); } }, [props]); @@ -166,7 +166,7 @@ const BountyDescription = (props: BountiesDescriptionProps) => { {props.title?.length > 80 ? '...' : ''} - {/* {descriptionImage && ( commented out reason-> #1059 + {descriptionImage && (
{ width={'100%'} />
- )} */} + )} - {/* {replitLink && ( commented out reason-> #1059 + {replitLink && (
window.open(replitLink[0])} style={{ display: 'flex' }}> { Replit
- )} */} + )} {dataValue && dataValue?.length > 0 && dataValue?.map((lang: any, index: number) => ( diff --git a/frontend/app/src/bounties/BountyModalButtonSet.tsx b/frontend/app/src/bounties/BountyModalButtonSet.tsx index c309b60ae..50185283d 100644 --- a/frontend/app/src/bounties/BountyModalButtonSet.tsx +++ b/frontend/app/src/bounties/BountyModalButtonSet.tsx @@ -43,7 +43,7 @@ const ButtonSet = ({ showGithubBtn, ...props }: any) => { )} - {/* {props?.replitLink && ( commented out reason-> #1059 + {props?.replitLink && ( { @@ -76,7 +76,7 @@ const ButtonSet = ({ showGithubBtn, ...props }: any) => { /> - )} */} + )} {props.tribe && (