Skip to content

Commit 5f0272d

Browse files
committed
chore: clean up hooks
1 parent 5f712aa commit 5f0272d

36 files changed

+79
-352
lines changed

content/components/index.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ description: Copy and paste components for your React app
44
---
55

66
Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source, crafted with Tailwind CSS, fully responsive. We use [shadcn-ui](https://github.com/shadcn-ui/ui) as our core components.
7-
If you want to add your own component (with credits), please [open a pull request](https://github.com/mehdibha/rcopy/pulls).
7+
If you think it's missing a component, please [open an issue](https://github.com/mehdibha/rcopy/issues/new).
8+

content/hooks/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ description: Copy and paste hooks for your React app
44
---
55

66
A collection of modern, server-safe React hooks, most of them are inspired by [usehooks](https://github.com/uidotdev/usehooks), [useHooks-ts](https://github.com/juliencrn/usehooks-ts) and [react-use](https://github.com/streamich/react-use).
7-
If you want to add your own hook (with credits), please [open a pull request](https://github.com/mehdibha/rcopy/pulls).
7+
If you think it's missing a hook, please [open an issue](https://github.com/mehdibha/rcopy/issues/new).

content/hooks/use-continuous-retry.mdx

-6
This file was deleted.

content/hooks/use-continuous-retry.tsx

-3
This file was deleted.

content/hooks/use-debounce.mdx

+10-25
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,13 @@ title: useDebounce
33
description: Delay the execution of function or state update with useDebounce.
44
---
55

6-
<ComponentPreview name="hooks/use-debounce" />
7-
8-
## Installation
9-
10-
Copy this code into your project.
11-
12-
```tsx
13-
import React from "react";
14-
15-
export function useDebounce<T>(value: T, delay: number): T {
16-
const [debouncedValue, setDebouncedValue] = React.useState(value);
17-
18-
React.useEffect(() => {
19-
const handler = setTimeout(() => {
20-
setDebouncedValue(value);
21-
}, delay);
22-
23-
return () => {
24-
clearTimeout(handler);
25-
};
26-
}, [value, delay]);
27-
28-
return debouncedValue;
29-
}
30-
```
6+
## About
7+
Input OTP is built on top of [input-otp](https://github.com/guilhermerodz/input-otp) by [@guilherme_rodz](https://twitter.com/guilherme_rodz).
8+
## About
9+
Input OTP is built on top of [input-otp](https://github.com/guilhermerodz/input-otp) by [@guilherme_rodz](https://twitter.com/guilherme_rodz).
10+
## About
11+
Input OTP is built on top of [input-otp](https://github.com/guilhermerodz/input-otp) by [@guilherme_rodz](https://twitter.com/guilherme_rodz).
12+
## About
13+
Input OTP is built on top of [input-otp](https://github.com/guilhermerodz/input-otp) by [@guilherme_rodz](https://twitter.com/guilherme_rodz).
14+
## About
15+
Input OTP is built on top of [input-otp](https://github.com/guilhermerodz/input-otp) by [@guilherme_rodz](https://twitter.com/guilherme_rodz).

content/hooks/use-debounce.tsx

-53
This file was deleted.

content/hooks/use-fetch.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ title: useFetch
33
description: Fetch data with accurate states, caching, and no stale responses using useFetch.
44
---
55

6-
<ComponentPreview name="hooks/use-fetch" />

content/hooks/use-fetch.tsx

-3
This file was deleted.

content/hooks/use-intersection-observer.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
title: useIntersectionObserver
33
description: Track and manage the visibility of your DOM elements within the viewport with useIntersectionObserver.
44
---
5-
6-
<ComponentPreview name="hooks/use-intersection-observer" />

content/hooks/use-intersection-observer.tsx

-3
This file was deleted.

content/hooks/use-local-storage.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
title: useLocalStorage
33
description: Store, retrieve, and synchronize data from the browser’s localStorage API with useLocalStorage
44
---
5-
6-
<ComponentPreview name="hooks/use-local-storage" />

content/hooks/use-local-storage.tsx

-3
This file was deleted.

content/hooks/use-media-query.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ title: useMediaQuery
33
description: Subscribe and respond to media query changes with useMediaQuery.
44
---
55

6-
<ComponentPreview name="hooks/use-media-query" />

content/hooks/use-media-query.tsx

-3
This file was deleted.

content/hooks/use-network-state.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
title: useNetworkState
33
description: Monitor and adapt to network conditions seamlessly with useNetworkState.
44
---
5-
6-
<ComponentPreview name="hooks/use-network-state" />

content/hooks/use-network-state.tsx

-3
This file was deleted.

content/hooks/use-orientation.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
title: useOrientation
33
description: Manage and respond to changes in device orientation with useOrientation.
44
---
5-
6-
<ComponentPreview name="hooks/use-orientation" />

content/hooks/use-orientation.tsx

-3
This file was deleted.

content/hooks/use-preferred-language.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
title: usePreferredLanguage
33
description: Adapt to user language preferences dynamically with usePreferredLanguage.
44
---
5-
6-
<ComponentPreview name="hooks/use-preferred-language" />

content/hooks/use-preferred-language.tsx

-3
This file was deleted.

content/hooks/use-previous.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
title: usePrevious
33
description: Track the previous value of a variable with usePrevious.
44
---
5-
6-
<ComponentPreview name="hooks/use-previous" />

content/hooks/use-previous.tsx

-3
This file was deleted.

content/hooks/use-session-storage.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ title: useSessionStorage
33
description: Store, retrieve, and synchronize data from the browser’s session storage with useSessionStorage.
44
---
55

6-
<ComponentPreview name="hooks/use-session-storage" />

content/hooks/use-session-storage.tsx

-3
This file was deleted.

content/hooks/use-visibility-change.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
title: useVisibilityChange
33
description: Track document visibility and respond to changes with useVisibilityChange.
44
---
5-
6-
<ComponentPreview name="hooks/use-visibility-change" />

content/hooks/use-visibility-change.tsx

-3
This file was deleted.

content/hooks/use-window-size.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22
title: useWindowSize
33
description: Track the dimensions of the browser window with useWindowSize.
44
---
5-
6-
<ComponentPreview name="hooks/use-window-size" />

content/hooks/use-window-size.tsx

-3
This file was deleted.

content/icons/index.mdx

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: Copy and paste icons for your React app
44
---
55

66
Beautiful icons for your React app. Copy and paste the icons you need. Credits to [Lucide icons](https://github.com/lucide-icons/lucide) and [Simple icons](https://github.com/simple-icons/simple-icons) for brands icons.
7-
If you want to add another icon library, please [open a pull request](https://github.com/mehdibha/rcopy/pulls).
7+
If you think it's missing another icon library, please [open an issue](https://github.com/mehdibha/rcopy/issues/new).
88

9-
<IconsExplorer libraries={["simple-icons","lucide-icons"]} />
9+
10+
<IconsExplorer libraries={["simple-icons", "lucide-icons"]} />

content/pages/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ description: Copy and paste pages for your React app
44
---
55

66
Beautiful React pages, crafted with Tailwind CSS, fully responsive, that you can drop into your React projects.
7-
If you want to add your own page (with credits), please [open a pull request](https://github.com/mehdibha/rcopy/pulls).
7+
If you think it's missing a page, please [open an issue](https://github.com/mehdibha/rcopy/issues/new).

content/templates/index.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ title: Templates
33
description: Ready templates to quick start your project
44
---
55

6-
A collection of open-source React templates curated by rCopy's creator. This list contains React, Next.js, Remix templates. If you think it's missing a template, please [open an issue](https://github.com/mehdibha/rcopy/issues/new).
6+
A collection of open-source React templates curated by rCopy's creator. This list contains React, Next.js, Remix templates.
7+
If you think it's missing a template, please [open an issue](https://github.com/mehdibha/rcopy/issues/new).

0 commit comments

Comments
 (0)