Skip to content

Commit

Permalink
main 🧊 add docs pages
Browse files Browse the repository at this point in the history
  • Loading branch information
debabin committed Jun 2, 2024
1 parent 8c7dbc8 commit 31057eb
Show file tree
Hide file tree
Showing 15 changed files with 240 additions and 233 deletions.
21 changes: 20 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,23 @@ export default async () => {
return;
}
},
head: [
[
'link',
{
rel: 'icon',
href: 'data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🚀</text></svg>'
}
]
],
locales: {
root: {
label: 'English',
lang: 'en',
themeConfig: {
search: {
provider: 'local'
},
editLink: {
pattern: ({ filePath, params }) => {
if (filePath.includes('hooks') && params?.name) {
Expand All @@ -42,10 +54,17 @@ export default async () => {
{ text: 'Home', link: '/' },
{
text: 'Functions',
items: [{ text: 'Hooks', link: '/functions/hooks/' }]
items: [
{ text: 'Get Started', link: '/getting-started' },
{ text: 'Hooks', link: '/functions/hooks/' }
]
}
],
sidebar: [
{
text: 'Getting started',
link: '/getting-started'
},
{
text: 'Hooks',
items: [...sidebarHookItems]
Expand Down
49 changes: 0 additions & 49 deletions docs/api-examples.md

This file was deleted.

7 changes: 7 additions & 0 deletions docs/functions/hooks/[name].paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ export default {
})
);

// const features = params
// .filter(Boolean)
// .map((param) => {
// return `\n- title: ${param?.params.name}\n details: ${param?.params.description}\n link: /functions/hooks/useBattery`;
// })
// .join(' ');

return params.filter(Boolean);
}
};
49 changes: 0 additions & 49 deletions docs/functions/hooks/index.md

This file was deleted.

25 changes: 0 additions & 25 deletions docs/functions/index.md

This file was deleted.

17 changes: 17 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
outline: deep
---

# 🦉 Philosophy

🚀 React Use this is a library that will allow you to easy and simple to use React hooks. Unlike its competitors, this package takes into account the features of React and also contains a huge number of useful hooks.

## Usage

Install **🚀 React Use** with [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/)

```bash
$ npm i @siberiacancode/reactuse --save
# or
$ yarn add @siberiacancode/reactuse
```
137 changes: 122 additions & 15 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,132 @@ hero:
actions:
- theme: brand
text: Get Started
link: /
link: /getting-started
- theme: alt
text: View on GitHub
link: /
link: https://github.com/siberiacancode/reactuse

features:
- title: useBoolean
details: Hook provides a boolean state and a function to toggle the boolean value
link: /functions/hooks/useBoolean
- title: useCounter
details: Hook that manages a counter with increment, decrement, reset, and set functionalities
link: /functions/hooks/useCounter
- title: useDocumentTitle
details: Hook that manages the document title and allows updating it
link: /functions/hooks/useDocumentTitle
- title: useRenderCount
details: Hook returns count component render times
link: /functions/hooks/useRenderCount
- title: useBattery
details: Hook for getting information about battery status
link: /functions/hooks/useBattery
- title: useBoolean
details: Hook provides a boolean state and a function to toggle the boolean value
link: /functions/hooks/useBattery
- title: useClickOutside
details: Hook to handle click events outside the specified target element(s)
link: /functions/hooks/useBattery
- title: useCopyToClipboard
details: Hook that manages a copy to clipboard
link: /functions/hooks/useBattery
- title: useCounter
details: Hook that manages a counter with increment, decrement, reset, and set functionalities
link: /functions/hooks/useBattery
- title: useDefault
details: Hook that returns the default value
link: /functions/hooks/useBattery
- title: useDidUpdate
details: Hook that behaves like useEffect, but skips the effect on the initial render
link: /functions/hooks/useBattery
- title: useDocumentTitle
details: Hook that manages the document title and allows updating it
link: /functions/hooks/useBattery
- title: useDocumentVisibility
details: Hook that provides the current visibility state of the document
link: /functions/hooks/useBattery
- title: useFavicon
details: Hook that manages the favicon
link: /functions/hooks/useBattery
- title: useHash
details: Hook that manages the hash value
link: /functions/hooks/useBattery
- title: useHotkeys
details: Hook that listens for key press events
link: /functions/hooks/useBattery
- title: useHover
details: Hook that defines the logic when hovering an element
link: /functions/hooks/useBattery
- title: useIdle
details: Hook that defines the logic when the user is idle
link: /functions/hooks/useBattery
- title: useIsFirstRender
details: Hook that returns true if the component is first render
link: /functions/hooks/useBattery
- title: useIsomorphicLayoutEffect
details: Hook conditionally selects either `useLayoutEffect` or `useEffect` based on the environment
link: /functions/hooks/useBattery
- title: useKeyPress
details: Hook that listens for key press events
link: /functions/hooks/useBattery
- title: useKeysPressed
details: Hook that listens for key press events
link: /functions/hooks/useBattery
- title: useLocalStorage
details: Hook that manages local storage value
link: /functions/hooks/useBattery
- title: useLogger
details: Hook for debugging lifecycle
link: /functions/hooks/useBattery
- title: useMediaQuery
details: Hook that manages a media query
link: /functions/hooks/useBattery
- title: useMount
details: Hook that executes a callback when the component mounts
link: /functions/hooks/useBattery
- title: useNetwork
details: Hook to track network status
link: /functions/hooks/useBattery
- title: useOnline
details: Hook that manages if the user is online
link: /functions/hooks/useBattery
- title: useOperatingSystem
details: Hook that returns the operating system of the current browser
link: /functions/hooks/useBattery
- title: useOrientation
details: Hook that returns the current screen orientation
link: /functions/hooks/useBattery
- title: usePageLeave
details: Hook what calls given function when mouse leaves the page
link: /functions/hooks/useBattery
- title: usePrevious
details: Hook that returns the previous value
link: /functions/hooks/useBattery
- title: useQueue
details: Hook that manages a queue
link: /functions/hooks/useBattery
- title: useRenderCount
details: Hook returns count component render times
link: /functions/hooks/useBattery
- title: useRerender
details: Hook that defines the logic to force rerender a component
link: /functions/hooks/useBattery
- title: useScript
details: Hook that manages a script with onLoad, onError, and removeOnUnmount functionalities
link: /functions/hooks/useBattery
- title: useSessionStorage
details: Hook that manages session storage value
link: /functions/hooks/useBattery
- title: useSet
details: Hook that manages a set structure
link: /functions/hooks/useBattery
- title: useStep
details: Hook that create stepper
link: /functions/hooks/useBattery
- title: useTimeout
details: that executes a callback function after a specified delay
link: /functions/hooks/useBattery
- title: useToggle
details: Hook that create toggle
link: /functions/hooks/useBattery
- title: useUnmount
details: Hook that defines the logic when unmounting a component
link: /functions/hooks/useBattery
- title: useWindowEvent
details: Hook attaches an event listener to the window object for the specified event
link: /functions/hooks/useBattery
- title: useWindowSize
details: Hook that manages a window size
link: /functions/hooks/useBattery
---



Loading

0 comments on commit 31057eb

Please sign in to comment.