Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button links should be clickable anywhere in the element #703

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions apps/zipper.dev/src/components/gallery/gallery-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import AppAvatar from '../app-avatar';
import { RouterOutputs } from '~/utils/trpc';
import { useState } from 'react';
import NextLink from 'next/link';

type GalleryItemProps = {
app: Unpack<GalleryAppQueryOutput>;
Expand Down Expand Up @@ -63,15 +64,23 @@ const InnerCard: React.FC<GalleryItemProps> = ({ app }) => {
</HStack>
{isHovering ? (
<HStack spacing={2} pt="3">
<Button variant="outline" colorScheme="purple" size="sm">
<Link href={`/${app.resourceOwner.slug}/${app.slug}`}>
Open Applet
</Link>
<Button
as={NextLink}
href={`/${app.resourceOwner.slug}/${app.slug}`}
variant="outline"
colorScheme="purple"
size="sm"
>
Open Applet
</Button>
<Button variant="link" colorScheme="purple" size="sm">
<Link href={`/gallery/${app.resourceOwner.slug}/${app.slug}`}>
Learn more
</Link>
<Button
as={NextLink}
href={`/gallery/${app.resourceOwner.slug}/${app.slug}`}
variant="link"
colorScheme="purple"
size="sm"
>
Learn More
</Button>
</HStack>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { isReadme } from '~/utils/playground.utils';
import type { MonacoEditor } from '~/components/playground/playground-editor';
import { AnalyticsHead } from '@zipper/utils';
import { useUser } from '~/hooks/use-user';
import NextLink from 'next/link';

const EDITOR_OPTIONS = {
fixedOverflowWidgets: true,
Expand Down Expand Up @@ -138,14 +139,14 @@ const AppletLandingPage: NextPageWithLayout = () => {
<HStack spacing={8} pb={6} justifyContent="space-between" w="full">
<Heading>{data.name ?? data.slug}</Heading>
<Button
as={NextLink}
href={`/${data.resourceOwner.slug}/${data.slug}/src/main.ts`}
variant="solid"
colorScheme="purple"
leftIcon={<HiOutlineTemplate size={20} />}
fontSize="sm"
>
<Link href={`/${data.resourceOwner.slug}/${data.slug}/src/main.ts`}>
Open in Playground
</Link>
Open in Playground
</Button>
</HStack>

Expand Down
4 changes: 3 additions & 1 deletion apps/zipper.run/src/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { removeExtension } from '@zipper/utils';
import router from 'next/router';
import { useMemo } from 'react';
import { FiChevronUp, FiChevronDown } from 'react-icons/fi';
import NextLink from 'next/link';

export default function Footer({
entryPoint,
Expand Down Expand Up @@ -58,12 +59,13 @@ export default function Footer({
<MenuList pb={0}>
<Box pb="4" pt="2" px={4}>
<Link
as={NextLink}
fontSize="sm"
fontWeight="medium"
href={`/${entryPoint.filename}`}
onClick={() => {
onClose();
setLoading(true);
router.push(`/${entryPoint.filename}`);
}}
_hover={{ background: 'none' }}
>
Expand Down