Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit d95e4d4

Browse files
committed
add libraries to home page
1 parent 62b5811 commit d95e4d4

File tree

16 files changed

+195
-46
lines changed

16 files changed

+195
-46
lines changed

docs/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ It's what's missing between applications and infrastructure automation.
1818

1919
Oh, and it supports basically any language, like JavaScript, TypeScript, Python, Go, you name it.
2020

21-
<div className="">{/* <Libraries minimal /> */}</div>
21+
<div className="">
22+
<Libraries minimal />
23+
</div>
2224

2325
If you're familiar Nitric already, you might want to jump to the [Installation](/getting-started/installation), [Guides](/guides) or [Resources](/apis) sections. Otherwise, keep reading to learn more about Nitric.
2426

src/components/Libraries.tsx

Lines changed: 76 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,111 @@
11
import Image from 'next/image'
22

3-
import { Button } from '@/components/Button'
4-
import { Heading } from '@/components/ui/heading'
5-
import logoGo from '@/images/logos/go.svg'
63
import logoNode from '@/images/logos/node.svg'
7-
import logoPhp from '@/images/logos/php.svg'
84
import logoPython from '@/images/logos/python.svg'
9-
import logoRuby from '@/images/logos/ruby.svg'
5+
import logoCsharp from '@/images/logos/csharp.svg'
6+
import logoGo from '@/images/logos/go.svg'
7+
import logoJava from '@/images/logos/java.svg'
8+
import logoDart from '@/images/logos/dart.svg'
9+
import Link from 'next/link'
10+
import { ArrowRightIcon } from '@heroicons/react/24/outline'
11+
import { Heading } from './ui/heading'
1012

1113
const libraries = [
1214
{
13-
href: '#',
14-
name: 'PHP',
15-
description:
16-
'A popular general-purpose scripting language that is especially suited to web development.',
17-
logo: logoPhp,
18-
},
19-
{
20-
href: '#',
21-
name: 'Ruby',
22-
description:
23-
'A dynamic, open source programming language with a focus on simplicity and productivity.',
24-
logo: logoRuby,
25-
},
26-
{
27-
href: '#',
15+
href: '/reference/nodejs',
2816
name: 'Node.js',
29-
description:
30-
'Node.js® is an open-source, cross-platform JavaScript runtime environment.',
17+
description: 'View full API for Node.js',
3118
logo: logoNode,
3219
},
3320
{
34-
href: '#',
21+
href: '/reference/python',
3522
name: 'Python',
36-
description:
37-
'Python is a programming language that lets you work quickly and integrate systems more effectively.',
23+
description: 'View full API for Python',
3824
logo: logoPython,
3925
},
4026
{
41-
href: '#',
27+
href: '/reference/go',
4228
name: 'Go',
43-
description:
44-
'An open-source programming language supported by Google with built-in concurrency.',
29+
description: 'View full API for Go',
4530
logo: logoGo,
4631
},
32+
{
33+
href: '/reference/dart',
34+
name: 'Dart',
35+
description: 'View full API for Dart',
36+
logo: logoDart,
37+
},
38+
{
39+
href: '/reference/csharp/v0',
40+
name: 'C# .NET',
41+
description: 'View full API for C# .NET',
42+
logo: logoCsharp,
43+
},
44+
{
45+
href: '/reference/jvm/v0',
46+
name: 'JVM',
47+
description: 'View full API for JVM',
48+
logo: logoJava,
49+
},
4750
]
4851

49-
export function Libraries() {
52+
export interface LibrariesProps {
53+
minimal?: boolean
54+
}
55+
56+
export function Libraries({ minimal = false }: LibrariesProps) {
57+
if (minimal) {
58+
return (
59+
<div className="flex h-fit w-fit items-center gap-2">
60+
{libraries.map((library) => (
61+
<Link
62+
href={library.href}
63+
key={library.name}
64+
className="opacity-90 grayscale transition-opacity hover:opacity-100 hover:grayscale-0"
65+
target="_blank"
66+
>
67+
<Image
68+
src={library.logo}
69+
alt={library.name + ' Logo'}
70+
className="h-12 w-12"
71+
unoptimized
72+
/>
73+
</Link>
74+
))}
75+
</div>
76+
)
77+
}
78+
5079
return (
5180
<div className="my-16 xl:max-w-none">
52-
<Heading level={2} id="official-libraries">
53-
Official libraries
81+
<Heading level={2} id="libraries">
82+
Libraries
5483
</Heading>
5584
<div className="not-prose mt-4 grid grid-cols-1 gap-x-6 gap-y-10 border-t border-zinc-900/5 pt-10 dark:border-white/5 sm:grid-cols-2 xl:max-w-none xl:grid-cols-3">
5685
{libraries.map((library) => (
57-
<div key={library.name} className="flex flex-row-reverse gap-6">
86+
<Link
87+
href={library.href}
88+
key={library.name}
89+
className="group relative flex items-center gap-4 rounded-2xl bg-zinc-50 p-4 transition-shadow hover:shadow-md hover:shadow-zinc-900/5 dark:bg-white/2.5 dark:hover:shadow-black/5"
90+
>
91+
<div className="absolute inset-0 rounded-2xl ring-1 ring-inset ring-zinc-900/7.5 group-hover:ring-zinc-900/10 dark:ring-white/10 dark:group-hover:ring-white/20" />
92+
93+
<Image
94+
src={library.logo}
95+
alt={library.name + ' Logo'}
96+
className="h-12 w-12"
97+
unoptimized
98+
/>
5899
<div className="flex-auto">
59-
<h3 className="text-sm font-semibold text-zinc-900 dark:text-white">
100+
<h3 className="text-lg font-semibold text-zinc-900 dark:text-white">
60101
{library.name}
61102
</h3>
62103
<p className="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
63104
{library.description}
64105
</p>
65-
<p className="mt-4">
66-
<Button href={library.href} variant="text" arrow="right">
67-
Read more
68-
</Button>
69-
</p>
70106
</div>
71-
<Image
72-
src={library.logo}
73-
alt=""
74-
className="h-12 w-12"
75-
unoptimized
76-
/>
77-
</div>
107+
<ArrowRightIcon className="h-5 w-5 -translate-x-1 transition-transform group-hover:translate-x-0" />
108+
</Link>
78109
))}
79110
</div>
80111
</div>

src/components/mdx.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,5 @@ export { InstallNitric } from '@/components/InstallNitric'
159159
export { HomeHeader } from '@/components/HomeHeader'
160160

161161
export { ShowIfLang } from '@/components/ShowIfLang'
162+
163+
export { Libraries } from '@/components/Libraries'

src/images/logos/aws-dark-text.svg

Lines changed: 24 additions & 0 deletions
Loading

src/images/logos/aws.svg

Lines changed: 24 additions & 0 deletions
Loading

src/images/logos/azure.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)