diff --git a/public/resources/no_image_available.png b/public/resources/no_image_available.png
new file mode 100644
index 0000000..55d1980
Binary files /dev/null and b/public/resources/no_image_available.png differ
diff --git a/public/resources/no_thumb_available.png b/public/resources/no_thumb_available.png
new file mode 100644
index 0000000..55d1980
Binary files /dev/null and b/public/resources/no_thumb_available.png differ
diff --git a/src/PhotoTableLine.css b/src/PhotoTableLine.css
new file mode 100644
index 0000000..5a5702e
--- /dev/null
+++ b/src/PhotoTableLine.css
@@ -0,0 +1,32 @@
+.PhotoTableLine_body {
+ border: 2px solid black;
+ background-color: lightgrey;
+ height:80px;
+}
+
+.PhotoTableLine_thumb {
+ height: inherit;
+}
+
+.PhotoTableLine_field {
+ border: 2px solid black;
+ float: left;
+ height: inherit;
+}
+
+.PhotoTableLine_textsubfield {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: inherit;
+}
+
+.PhotoTableLine_textsubsubfield {
+ margin: 8px;
+ border: 0 solid black;
+}
+
+a {
+ height: inherit;
+ display: block;
+}
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index 04083eb..e13a848 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,7 +2,8 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { Fetch } from './fetch.js';
import { ProvideDB, DBQueryConsole, DBTypeEnum, DBSourceEnum } from './database.js';
-import { Photo, PhotoView } from './media.js';
+import { PhotoView, PhotoThumbView, PhotoTableLine } from './media.js';
+import { find_photos } from './queries.js';
import './index.css';
@@ -33,19 +34,15 @@ export class PhotoFromDB extends React.Component {
}
componentDidMount() {
- this.props.database.queries_async(["SELECT Images.uniqueHash FROM Images;"])
- .then(res => {
- var photo = new Photo;
- var imagepath = process.env.PUBLIC_URL + "/test_photos_thumbs/" + res[0]["uniqueHash"] + ".jpg";
- photo.state.path = imagepath;
- this.setState({ done: true, photo: photo });
- });
+ find_photos("", this.props.database, "/test_photos", "/test_photos_thumbs").then(photos => {
+ this.setState({ done: true, photo: photos[0] });
+ });
}
render() {
return (
<>
- {this.state.done &&
{photo.state.name ? photo.state.name : "Unknown"}