Skip to content

Commit

Permalink
Update Links, Tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
adamplesnik committed Sep 30, 2024
1 parent e32e55e commit 5db852a
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 40 deletions.
6 changes: 5 additions & 1 deletion src/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const Link = ({
) : (
''
)}
<a href={href} target={target} className="hover:text-pink-700 print:text-gray-700">
<a
href={href}
target={target}
className="text-cyan-700 hover:text-zinc-700 print:text-gray-700"
>
{children}
</a>
</div>
Expand Down
10 changes: 9 additions & 1 deletion src/components/Tile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ import { HTMLAttributes, PropsWithChildren, ReactNode } from 'react'
import { addWithSpace } from '../utils/addWithSpace'
import Heading from './Heading'

const Tile = ({ children, className, title, badge }: PropsWithChildren<TileWrapperProps>) => {
const Tile = ({
children,
className,
title,
badge,
links,
}: PropsWithChildren<TileWrapperProps>) => {
return (
<div className={'' + addWithSpace(className)}>
<div className="flex gap-1">
<Heading size={4}>{title}</Heading>
{badge && badge}
</div>
{children}
{links && <div className="flex flex-col gap-2 pt-2">{links}</div>}
</div>
)
}
Expand All @@ -19,6 +26,7 @@ export type TileWrapperProps = {
title: string
className?: string | '' | undefined
badge?: ReactNode
links?: ReactNode
} & HTMLAttributes<HTMLDivElement>

export default Tile
6 changes: 3 additions & 3 deletions src/components/__snapshots__/Link.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`Link with href 1`] = `
onMouseLeave={[Function]}
>
<a
className="hover:text-pink-700 print:text-gray-700"
className="text-cyan-700 hover:text-zinc-700 print:text-gray-700"
href="url/"
target="_blank"
>
Expand All @@ -23,7 +23,7 @@ exports[`Link with href and custom target 1`] = `
onMouseLeave={[Function]}
>
<a
className="hover:text-pink-700 print:text-gray-700"
className="text-cyan-700 hover:text-zinc-700 print:text-gray-700"
href="url/"
target="_self"
>
Expand Down Expand Up @@ -103,7 +103,7 @@ exports[`Link with href, custom target and icon 1`] = `
</svg>
</div>
<a
className="hover:text-pink-700 print:text-gray-700"
className="text-cyan-700 hover:text-zinc-700 print:text-gray-700"
href="url/"
target="_self"
>
Expand Down
34 changes: 21 additions & 13 deletions src/content/KolbordTile.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
import Link from '../components/Link'
import Link from '@/components/Link'
import Paragraph from '../components/Paragraph'
import Tile from '../components/Tile'

const Badge = () => {
return (
<span className="flex h-fit -rotate-6 rounded border border-white bg-zinc-800 p-1 text-xs text-white">
Beta
</span>
)
}

const Links = () => {
return (
<>
<Link href="https://github.com/adamplesnik/kolbord">@adamplesnik/kolbord</Link>
<Link href="https://github.com/adamplesnik/kolbord-payload">
@adamplesnik/kolbord-payload
</Link>
</>
)
}

const KolbordTile = () => {
return (
<Tile
title="Kolbord: the smoothest space booking"
badge={
<span className="flex h-fit -rotate-6 rounded border border-white bg-zinc-800 p-1 text-xs text-white">
Beta
</span>
}
>
<Tile title="Kolbord: the smoothest space booking" badge={<Badge />} links={<Links />}>
<Paragraph>
Opinionated, free to use, and open source app for one-click reservation of anything.
</Paragraph>
<Paragraph>Built in React, Payload CMS with user management in Clerk.</Paragraph>
<Link href="https://github.com/adamplesnik/kolbord">@adamplesnik/kolbord</Link>
<Link href="https://github.com/adamplesnik/kolbord-payload">
@adamplesnik/kolbord-payload
</Link>
</Tile>
)
}
Expand Down
26 changes: 13 additions & 13 deletions src/content/PluginTile.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { Github, NotepadText } from 'lucide-react'
import Link from '../components/Link'
import Paragraph from '../components/Paragraph'
import Tile from '../components/Tile'

const Links = () => {
return (
<>
<Link href="https://scrolldriven.dev">scrolldriven.dev</Link>
<Link href="https://github.com/adamplesnik/tailwindcss-scroll-driven-animations">
@adamplesnik/tailwindcss-scroll-driven-animations
</Link>
</>
)
}

const PluginTile = () => {
return (
<Tile title="Scroll-driven animations plugin for Tailwind CSS">
<Tile title="Scroll-driven animations plugin for Tailwind CSS" links={<Links />}>
<Paragraph>
A plugin for Tailwind CSS v3.4+ that provides utilities for scroll-driven animations.
</Paragraph>
<div className="flex flex-col gap-2 pt-2">
<Link Icon={NotepadText} href="https://scrolldriven.dev">
scrolldriven.dev
</Link>
<Link
Icon={Github}
href="https://github.com/adamplesnik/tailwindcss-scroll-driven-animations"
>
@adamplesnik/tailwindcss-scroll-driven-animations
</Link>
</div>
<div className="flex flex-col gap-2 pt-2"></div>
</Tile>
)
}
Expand Down
19 changes: 10 additions & 9 deletions src/content/WebUmeniaTile.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import { Github } from 'lucide-react'
import Link from '../components/Link'
import Link from '@/components/Link'
import Paragraph from '../components/Paragraph'
import Tile from '../components/Tile'

const Links = () => {
return (
<Link href="https://github.com/adamplesnik/webumenia.sk/tree/feature/css-refactoring">
@adamplesnik/webumenia.sk
</Link>
)
}

const WebUmeniaTile = () => {
return (
<Tile title="CSS refactoring for webumenia.sk">
<Tile title="CSS refactoring for webumenia.sk" links={<Links />}>
<Paragraph>
Web umenia features almost 180k artworks from the collections of Slovak galleries. I forked
their dev branch and started the process of removing old code, reorganizing dependencies and
eventually creating the dark mode.
</Paragraph>
<Link
href="https://github.com/adamplesnik/webumenia.sk/tree/feature/css-refactoring"
Icon={Github}
>
@adamplesnik/webumenia.sk
</Link>
</Tile>
)
}
Expand Down

0 comments on commit 5db852a

Please sign in to comment.