-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test banding images (rough code sketch) * add log * add fe log for testing * send xkcd comic instead of url (since it's not working properly) * add logs * add content store name log * change logic to directly check CS name * add log to ensure prodstore works * fix prod store * check via name rather than type * ensure s3 logic goes through * check for correct STore type * remove xkcd comic as dummy string * add a few TODOS * create correct Type for url * s3 and other images work now * add logs for testing * cleanup small things * send string instead of object * fix non-img media * add log to check s3 results * add another log * see if url exists * add additoinal logging * check to see if reader is working * put in demo image if * remove logging for reader * ensure only images are sent out of band * change reader to be io.Reader * send evidence preview to determine issue * change logs to prevent failure? * remove other logic to ensure reponse works * use exact same logic * test using terminal reader to see what values are * clean up / new logs * create separate endpoint * Revert "create separate endpoint" This reverts commit b7152d4. * make sure I'm not emptying the buffer * try new reader method * try longer buffer * set length to be lenght of url * add log to see how long url is * try to get it working again * use simpler reader * try ReadAll * try generic read with loop * create url endpoint * add some logs * add additional logging * correct url type * add content type * add log to see specific url * relog url * add additonal logs * check type * parse json * parse further down * fix json error message * follow dto conventions * TODO cleanup * additional cleanup * add back content headers * try another reader method * only send url stream for images * add logs * clean up extraneous endpoint * correct boolean * add logs * remove logs * remove TODO * ensure only images get sendUrl * revert index page * fix spacing * fix spacing agian * revert accidental changes * fix spacing * add lazy load component * lowering s3 url validity to 30 minutes --------- Co-authored-by: John Kennedy <[email protected]>
- Loading branch information
1 parent
4b1c725
commit 5d49edf
Showing
12 changed files
with
118 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2023, Yahoo Inc. | ||
// Licensed under the terms of the MIT. See LICENSE file in project root for terms. | ||
|
||
import React, { useState, useEffect, useRef } from 'react'; | ||
|
||
export default (props: { children: React.ReactNode }) => { | ||
const [isVisible, setIsVisible] = useState(false); | ||
const containerRef = useRef<HTMLDivElement | null>(null); | ||
|
||
useEffect(() => { | ||
const observer = new IntersectionObserver( | ||
([entry]) => { | ||
if (entry.isIntersecting) { | ||
setIsVisible(true); | ||
observer.disconnect(); | ||
} | ||
}, | ||
{ root: null, rootMargin: '0px', threshold: 0.1 } | ||
); | ||
|
||
if (containerRef.current) { | ||
observer.observe(containerRef.current); | ||
} | ||
|
||
return () => { | ||
if (containerRef.current) { | ||
observer.unobserve(containerRef.current); | ||
} | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div ref={containerRef}> | ||
{isVisible ? props.children : null} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters