Skip to content

Commit

Permalink
fix(apps): cms - slideshow component query.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnycrich committed May 17, 2024
1 parent d4e92c2 commit ebf8f37
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/cms/admin/components/component-blocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ export const componentBlocks = {
listKey: 'Slideshow',
label: 'Select:',
selection:
'key name slides { image {publicId} altText caption video {file} order }',
'key name slides { image {publicId publicUrl} altText caption video {file} order }',
}),
},
}),
Expand Down
23 changes: 21 additions & 2 deletions apps/cms/admin/components/video-field/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,27 @@ export function Field({
}

export const Cell: CellComponent = ({ item, field, linkTo }) => {
let value = item[field.path] + '';
return <CellContainer>{value}</CellContainer>;
let value = item[field.path];
return (
<CellContainer>
{value.file && value.file.length > 5 && value.thumbSmUrl.length > 5 ? (
<a
href={value.file}
target="_blank"
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
>
<img src={value.thumbSmUrl} width={35} height={35} />
<p>{value.label}</p>
</a>
) : (
<em>None</em>
)}
</CellContainer>
);
};

export const CardValue: CardValueComponent = ({ item, field }) => {
Expand Down

0 comments on commit ebf8f37

Please sign in to comment.