Skip to content

Commit

Permalink
Add “Open in IDX” as primary link on astro.new
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis committed Nov 23, 2024
1 parent 29735bf commit 8d2cacb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
19 changes: 14 additions & 5 deletions src/components/RepoCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type Props = Example & { aboveTheFold: boolean };
const {
title,
sourceUrl,
idxUrl,
stackblitzUrl,
codesandboxUrl,
gitpodUrl,
Expand Down Expand Up @@ -46,26 +47,34 @@ const headingId = `template-${createAstroTemplate}`;
</p>
<hr class="border-astro-gray-100/10" />
<div
class="flex h-10 w-max min-w-0 max-w-full divide-x divide-astro-gray-600 rounded-full bg-blue-purple-gradient"
class="relative flex h-10 w-max min-w-0 max-w-full divide-x divide-astro-gray-600 rounded-full bg-blue-purple-gradient"
>
<a
href={stackblitzUrl}
href={idxUrl}
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-2 rounded-l-full bg-black/15 px-4 text-sm transition hover:backdrop-brightness-75"
>
<Icon name="stackblitz" size={16} aria-hidden="true" /> Open in StackBlitz
<Icon name="idx" size={16} aria-hidden="true" /> Open in IDX
</a>
<details class="relative z-10" data-card-options>
<details class="z-10" data-card-options>
<summary
class="flex h-full cursor-pointer list-none items-center rounded-r-full bg-black/15 px-2 transition hover:backdrop-brightness-75"
>
<span class="sr-only">More options</span>
<Icon name="chevron-down" size={20} aria-hidden="true" />
</summary>
<ul
class="absolute right-0 top-full mt-2 flex w-max flex-col rounded bg-white p-2 text-astro-gray-700 shadow-md"
class="absolute left-0 top-full mt-2 flex w-max flex-col rounded bg-white p-2 text-astro-gray-700 shadow-md"
>
<li>
<a
href={stackblitzUrl}
class="flex flex-row items-center gap-2 rounded-sm px-3 py-2 hover:bg-blue-purple-gradient hover:text-white"
>
<Icon name="stackblitz" size={20} aria-hidden="true" /> Open in StackBlitz
</a>
</li>
<li>
<a
href={gitpodUrl}
Expand Down
3 changes: 3 additions & 0 deletions src/icons/idx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/icons/stackblitz.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8d2cacb

Please sign in to comment.