Skip to content

Commit

Permalink
Apps now loading, displaying correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed Oct 28, 2022
1 parent 5dbd489 commit 42079ee
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/renderer/homeView/src/DirectoryView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Grid,
} from '@mui/material';
import { TOPICS } from '../../../main/src/constants';
import { DirectoryApp } from '../../../main/src/types/FDC3Data';
import { DirectoryApp } from '../../../main/src/directory/directory';

export class DirectoryView extends React.Component<
{},
Expand All @@ -30,8 +30,8 @@ export class DirectoryView extends React.Component<
//clean up / normalize some of the directory data
apps.forEach((app: DirectoryApp) => {
//put in place holder images and icons if they aren't there...
if (!app.images) {
app.images = [];
if (!app.screenshots) {
app.screenshots = [];
}
if (!app.icons) {
app.icons = [];
Expand Down Expand Up @@ -66,11 +66,11 @@ export class DirectoryView extends React.Component<
{this.state.apps.map((app: DirectoryApp) => (
<Grid item xs={4}>
<Card sx={{ maxWidth: 345, minHeight: 350 }}>
{app.images.length > 0 ? (
app.images.map((image) => (
{app.screenshots!!.length > 0 ? (
app.screenshots!!.map((image) => (
<CardMedia
component="img"
image={image.url}
image={image.src}
height="120"
></CardMedia>
))
Expand All @@ -86,7 +86,7 @@ export class DirectoryView extends React.Component<
<Typography gutterBottom variant="h5" component="div">
{app.icons && app.icons.length > 0 && (
<img
src={app.icons[0].icon}
src={app.icons[0].src}
className="appIcon"
alt={`${app.name} - icon`}
></img>
Expand All @@ -100,7 +100,9 @@ export class DirectoryView extends React.Component<
<CardActions>
<Button
onClick={() => {
openApp(app.name);
if (app.appId) {
openApp(app.name);
}
}}
size="small"
>
Expand Down

0 comments on commit 42079ee

Please sign in to comment.