chore: Update dependencies and add sync-fetch for theme API

This commit is contained in:
Mauro Balades
2024-08-16 10:29:22 +02:00
parent b16302ba24
commit 58857925d0
3 changed files with 24 additions and 21 deletions

View File

@@ -12,18 +12,17 @@ export default function ThemeCard({
theme: ZenTheme;
}) {
return (
<ThemeCardWrapepr onClick={() => {
<ThemeCardWrapepr onClick={(event) => {
if (event.target instanceof HTMLAnchorElement) return;
window.open(`/themes/${theme.id}`, "_self");
}} className="flex flex-col justify-start p-6 rounded-lg shadow-md bg-muted/50 border border-muted w-full hover:shadow-lg transition duration-300 ease-in-out hover:bg-muted/100 hover:border-blue-500 cursor-pointer select-none hover:border-blue-500 hover:shadow-lg">
<img src={theme.image} alt={theme.name} className="w-full h-32 object-cover rounded-md" />
<div className="flex">
<h2 className="text-xl font-bold mt-4 overflow-ellipsis text-start">{theme.name}</h2>
{theme.homepage && (
<a href={theme.homepage} className="text-blue-500 text-md ml-4" target="_blank" rel="noopener noreferrer">
Visit Homepage
</a>
)}
</div>
}} className="flex flex-col justify-start p-5 rounded-lg shadow-md bg-muted/50 border border-muted w-full hover:shadow-lg transition duration-300 ease-in-out hover:bg-muted/100 hover:border-blue-500 cursor-pointer select-none hover:border-blue-500 hover:shadow-lg">
<img src={theme.image} alt={theme.name} className="w-full h-32 object-cover rounded-lg border shadow" />
<h2 className="text-xl font-bold mt-4 overflow-ellipsis text-start">{theme.name}</h2>
{theme.homepage && (
<a href={theme.homepage} className="text-blue-500 text-md mt-2" target="_blank" rel="noopener noreferrer">
Homepage
</a>
)}
<p className="text-md mt-2 overflow-ellipsis text-muted-foreground text-start">{theme.description}</p>
</ThemeCardWrapepr>
);