diff --git a/src/App.css b/src/App.css index 6529d74..1657b93 100644 --- a/src/App.css +++ b/src/App.css @@ -32,8 +32,11 @@ body { max-width: calc(100vw - 2em); } -.GalleryItem > p { +.GalleryItem > a { + color: inherit; + margin: 0.5em; + overflow: clip; } .GalleryItem > img, video { diff --git a/src/App.tsx b/src/App.tsx index 7962027..36a0c70 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -28,6 +28,7 @@ function App() { interface galleryItemInfo { is_dir: boolean; url: string; + thumbnail_url: string; } function getContents( @@ -59,7 +60,7 @@ function getContents( return getDir == item.is_dir; }) .map((item: galleryItemInfo, index: number) => { - const url = item.url; + const url = item.thumbnail_url === null ? item.url : item.thumbnail_url; let onClick = () => {}; if (item.is_dir) { onClick = () => { @@ -89,7 +90,9 @@ interface galleryItem { function ImageItem({ url }: galleryItem) { return (
{getFileName(url)}
+ + {getFileName(url)} +{getFileName(url)}
+ + {getFileName(url)} + @@ -125,7 +130,7 @@ function getFileName(string: string): string { } function post(category: string, callback: (text: string) => void) { - fetch('http://localhost/react-photo-viewer/php/get.php', { + fetch('http://localhost/photo-viewer-backend/php/get.php', { method: 'POST', headers: { 'Content-Type': 'application/json',