Skip to content

Commit 0b1ae7a

Browse files
committed
feat: add suggest pattern
1 parent e56e83d commit 0b1ae7a

File tree

6 files changed

+38
-8
lines changed

6 files changed

+38
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# UX Patterns for Devs
22

3-
UX Patterns for Developers was created by [David Dias](https://thedaviddias.com). It is a free collection of UX patterns towards developers who want to understand how to build effective UI components accessible and usable.
3+
UX Patterns for Developers is a free collection of UX patterns towards developers who want to understand how to build effective UI components accessible and usable.
44

55
![Screenshot of the homepage ofUX Patterns for Devs](./public/img/ux-patterns-developers.webp)
66

app/[lang]/[[...mdxPath]]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable react-hooks/rules-of-hooks -- false positive, useMDXComponents are not react hooks */
22

3+
import { SuggestPattern } from '@/app/_components/suggest-pattern'
34
import { JsonLd, generateArticleSchema } from '@app/_components/json-ld'
45
import { generateStaticParamsFor, importPage } from 'nextra/pages'
56
import { useMDXComponents } from '../../../mdx-components'
@@ -38,6 +39,7 @@ export default async function Page(props: PageProps) {
3839
<JsonLd data={schemaData} />
3940
<Wrapper toc={toc} metadata={metadata}>
4041
<MDXContent {...props} params={params} />
42+
<SuggestPattern />
4143
</Wrapper>
4244
</>
4345
)

app/_components/subscribe.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ export const SubscribeForm = () => {
6161
};
6262

6363
return (
64-
<div className="relative overflow-hidden rounded-xl border border-zinc-700/65 px-4 py-10 sm:px-8 mt-10">
64+
<div className="flex flex-col mt-10 items-center justify-center py-10 px-4 text-center border border-neutral-200 dark:border-neutral-800 rounded-xl">
6565
<h2 className="text-2xl font-bold mb-5 text-foreground">
66-
Get notified when new patterns are added.
66+
Get notified when new patterns are added!
6767
</h2>
6868
<form onSubmit={handleSubmit} className="space-y-4">
6969
<div className="space-y-2">
70-
<div className="flex gap-2">
70+
<div className="flex flex-col md:flex-row gap-2">
7171
<Input
7272
placeholder="[email protected]"
7373
type="email"
74-
className="md:w-2/5"
74+
className="w-full md:w-[300px]"
7575
value={formState.email}
7676
onChange={(e) => setFormState((prev) => ({ ...prev, email: e.target.value }))}
7777
disabled={isLoading}

app/_components/suggest-pattern.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { PROJECT_URL } from '@/app/_constants/project'
2+
import { Button } from './ui/button'
3+
4+
export function SuggestPattern() {
5+
return (
6+
<div className="flex flex-col mt-10 items-center justify-center py-10 px-4 text-center border border-neutral-200 dark:border-neutral-800 rounded-xl">
7+
<h2 className="text-2xl font-bold mb-5 text-foreground">Got a pattern request?</h2>
8+
<p className="text-lg text-muted-foreground mb-6">
9+
Let us know, and we&apos;ll add it!
10+
</p>
11+
<Button
12+
variant="outline"
13+
className="font-medium"
14+
asChild
15+
>
16+
<a
17+
href={`${PROJECT_URL}/discussions/new?category=suggestions`}
18+
target="_blank"
19+
rel="noopener noreferrer"
20+
className="plausible-event-name=Suggest+Pattern"
21+
>
22+
Send Suggestion
23+
</a>
24+
</Button>
25+
</div>
26+
)
27+
}

content/en/about/about.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# About UX Patterns for Devs
22

3-
**UX Patterns for Developers** is a free collection of UX patterns towards developers who want to understand how to build effective UI components accessible and usable.
3+
**UX Patterns for Developers** was created by [David Dias](https://thedaviddias.com). It is a free collection of UX patterns towards developers who want to understand how to build effective UI components accessible and usable.
44

55
It was created by [David Dias](https://thedaviddias.com).
66

content/en/index.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Hero } from "@app/_components/sections/hero";
88
import { OverviewGrid } from "@app/_components/sections/overview-grid";
99
import { Stars } from "@app/_components/stars";
1010
import { SubscribeForm } from "@app/_components/subscribe";
11+
import { SuggestPattern } from "@app/_components/suggest-pattern";
1112
import { Callout, Tabs } from "nextra/components";
1213

1314
# UX Patterns for Devs
@@ -20,6 +21,6 @@ import { Callout, Tabs } from "nextra/components";
2021

2122
<Stars />
2223

23-
<OverviewGrid lang={props.params.lang} />
24-
2524
<SubscribeForm />
25+
26+
<OverviewGrid lang={props.params.lang} />

0 commit comments

Comments
 (0)