Skip to content

Commit 815e644

Browse files
committed
Merge main
1 parent 72f551d commit 815e644

File tree

7 files changed

+46
-18
lines changed

7 files changed

+46
-18
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 ui.dev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
![useHooks](https://usehooks.com/meta/og.jpg)
2+
13
# useHooks
24

3-
A collection of Server Component safe React Hooks – from the ui.dev team
5+
A collection of modern, server-safe React hooks – from the ui.dev team
46

57
## Standard
68

@@ -46,7 +48,7 @@ A collection of Server Component safe React Hooks – from the ui.dev team
4648
- [useToggle](https://usehooks.com/usetoggle)
4749
- [useVisibilityChange](https://usehooks.com/usevisibilitychange)
4850
- [useWindowScroll](https://usehooks.com/usewindowscroll)
49-
- [useWindowSize](https://usehooks.com/usewindowSize)
51+
- [useWindowSize](https://usehooks.com/usewindowsize)
5052

5153
## Experimental
5254

usehooks.com/public/meta/og.jpg

173 KB
Loading

usehooks.com/src/content/hooks/useGeolocation.mdx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: useGeolocation
33
rank: 36
4-
tagline: Add undo / redo functionality with useHistoryState.
4+
tagline: Access and monitor a user's geolocation (after they give permission) with useGeolocation.
55
sandboxId: usegeolocation-3f1d0f
66
previewHeight: 900px
77
relatedHooks:
@@ -14,24 +14,30 @@ import HookDescription from "../../components/HookDescription.astro";
1414
import StaticCodeContainer from "../../components/StaticCodeContainer.astro";
1515

1616
<HookDescription name={frontmatter.name}>
17-
The useHistoryState hook is useful for managing state with undo and redo
18-
capabilities in React components. The hook offers functions like undo, redo,
19-
set, and clear to interact with the state as well as other state related
20-
values like canUndo and canRedo.
17+
The useGeolocation hook is useful for accessing and monitoring the user's
18+
geolocation (after they give permission) in a React application. By utilizing
19+
the hook, developers can easily retrieve the user's current position,
20+
including latitude, longitude, altitude, accuracy, heading, speed, and
21+
timestamp.
2122
</HookDescription>
2223

2324
<div class="reference">
2425
### Parameters
2526

26-
<div class="table-container">
27-
| Name | Type | Description |
28-
| ------- | ------ | ----------- |
29-
| options | object | This is an optional configuration object provided when calling `useGeolocation`. It is used when calling `navigator.geolocation.getCurrentPosition()` and `navigator.geolocation.watchPosition()`. Some of the attributes it accepts are `enableHighAccuracy`, `timeout`, and `maximumAge`. |
30-
</div>
27+
{" "}
3128

32-
### Return Values
29+
<div class="table-container">
30+
| Name | Type | Description | | ------- | ------ | ----------- | | options |
31+
object | This is an optional configuration object provided when calling
32+
`useGeolocation`. It is used when calling
33+
`navigator.geolocation.getCurrentPosition()` and
34+
`navigator.geolocation.watchPosition()`. Some of the attributes it accepts are
35+
`enableHighAccuracy`, `timeout`, and `maximumAge`. |
36+
</div>
3337

34-
The hook returns an object containing the following properties:
38+
### Return Values
39+
40+
The hook returns an object containing the following properties:
3541

3642
<div class="table-container">
3743
| Name | Type | Description |
@@ -83,7 +89,6 @@ function Location() {
8389

8490
return <Demo state={state} />;
8591
}
86-
8792
```
8893

8994
</StaticCodeContainer>

usehooks.com/src/pages/404.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Footer from '../sections/Footer.astro';
66

77
<Layout
88
title="Page not found."
9-
description="A collection of Server Component safe React Hooks – from the ui.dev team."
9+
description="A collection of modern, server-safe React hooks – from the ui.dev team"
1010
>
1111
<NavInternal />
1212
<main>

usehooks.com/src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const hooks = await getCollection("hooks");
1111

1212
<Layout
1313
title="useHooks"
14-
description="A collection of Server Component safe React Hooks – from the ui.dev team"
14+
description="A collection of modern, server-safe React hooks – from the ui.dev team"
1515
>
1616
<NavMain />
1717
<HomeHero />

usehooks.com/src/sections/HomeHero.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const hooksMarquee2 = (await getCollection('hooks')).slice(25,50);
77

88
<header class="hero">
99
<img src="/img/logo-useHooks.svg" width="546" height="80" alt="useHooks" />
10-
<h1>A collection of Server Component safe React Hooks – from the ui.dev team</h1>
10+
<h1>A collection of modern, server-safe React hooks – from the ui.dev team</h1>
1111
<Install text="npm i @uidotdev/usehooks" />
1212

1313
<div class="marquee marquee-left">

0 commit comments

Comments
 (0)