diff options
| author | bobzel <zzzman@gmail.com> | 2022-06-09 16:59:09 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-06-09 16:59:09 -0400 |
| commit | 140e2f643f97057ba9c89c502cff7843bd738cd6 (patch) | |
| tree | 033330390616fde7a6b3797f2a71153e28939e51 /src/client/views/DashboardView.tsx | |
| parent | 8ef0c6c08bd9c2e3654477b039686bab6b0ff991 (diff) | |
fixed issues with taking dashboard snapshots to update dashboard view
Diffstat (limited to 'src/client/views/DashboardView.tsx')
| -rw-r--r-- | src/client/views/DashboardView.tsx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx index 5fd9b550d..3cfece970 100644 --- a/src/client/views/DashboardView.tsx +++ b/src/client/views/DashboardView.tsx @@ -1,4 +1,5 @@ import { observable } from "mobx"; +import { extname } from 'path'; import { observer } from "mobx-react"; import * as React from 'react'; import { Doc, DocListCast } from "../../fields/Doc"; @@ -33,13 +34,16 @@ export class DashboardView extends React.Component { <div>All Dashboards</div> </div> <div className="all-dashboards"> - {myDashboards.map((dashboard) => - <div className="dashboard-container" key={dashboard[Id]} onClick={(e) => { this.clickDashboard(e, dashboard) }}> - <img src="https://media.istockphoto.com/photos/hot-air-balloons-flying-over-the-botan-canyon-in-turkey-picture-id1297349747?b=1&k=20&m=1297349747&s=170667a&w=0&h=oH31fJty_4xWl_JQ4OIQWZKP8C6ji9Mz7L4XmEnbqRU="></img> + {myDashboards.map((dashboard) => { + const url = ImageCast((dashboard.thumb as Doc)?.data)?.url; + const ext = url ? extname(url.href):""; + const href = url?.href.replace(ext, "_m"+ ext); // need to choose which resolution image to show. options are _s, _m, _l, _o (small/medium/large/original) + return <div className="dashboard-container" key={dashboard[Id]} onClick={e => this.clickDashboard(e, dashboard)}> + <img src={href ?? "https://media.istockphoto.com/photos/hot-air-balloons-flying-over-the-botan-canyon-in-turkey-picture-id1297349747?b=1&k=20&m=1297349747&s=170667a&w=0&h=oH31fJty_4xWl_JQ4OIQWZKP8C6ji9Mz7L4XmEnbqRU="}></img> <div className="title"> {StrCast(dashboard.title)} </div> </div> - )} + })} {myDashboards.map((dashboard) => { console.log(dashboard.thumb) })} |
