refactor: Add h1 headers to all pages missing it (#137)

* refactor: Add h1 headers to all pages missing it

* refactor: missed example h3

* change hooks example heading to bold text

---------

Co-authored-by: Luke <[email protected]>
This commit is contained in:
JagandLuke authored and GitHub committed 2023-07-08 11:08:43 +02:00
1 parent 74227cc262
commit 1d2c490b26
95 files changed
+2167 -2289

No files matched your search

+62 -76
View File
@@ -5,45 +5,39 @@ title: Alert Dialog
import { Tabs, Tab } from 'nextra-theme-docs';
import { Callout } from 'nextra/components';
# Alert Dialog
Simple alert dialog that can display a message to the player.
Returns whether the player pressed the confirm button or canceled the dialog.
### lib.alertDialog
## lib.alertDialog
<Tabs items={["Lua", "JS"]}>
<Tab>
<Tab>
<Tabs items={["Client", "Server"]}>
<Tab>
```lua
lib.alertDialog(data)
```
</Tab>
<Tab>
```lua
TriggerClientEvent('ox_lib:alertDialog', source, data)
```
</Tab>
</Tabs>
</Tab>
<Tab>
<Callout>
This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
</Callout>
<Tabs items={["Client", "Server"]}>
<Tab>
```ts
import lib from '@overextended/ox_lib/client';
```lua
lib.alertDialog(data)
```
</Tab>
<Tab>
```lua
TriggerClientEvent('ox_lib:alertDialog', source, data)
```
</Tab>
</Tabs>
</Tab>
<Tab>
<Callout>
This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`.
</Callout>
```ts
import lib from '@overextended/ox_lib/client';
lib.alertDialog(data);
```
</Tab>
lib.alertDialog(data);
```
</Tab>
</Tabs>
- data: `table` (`object`)
@@ -65,62 +59,54 @@ lib.alertDialog(data);
Returns `'confirm'` if the player pressed the confirm button, otherwise if the player pressed the cancel button
or has exited the dialog with ESC the return will be `'cancel'`.
### lib.closeAlertDialog
## lib.closeAlertDialog
Force closes the active alert dialog and sets its return data as `nil`
<Tabs items={["Lua", "JS"]}>
<Tab>
<Tab>
```lua
lib.closeAlertDialog()
```
</Tab>
<Tab>
```ts
import lib from '@overextended/ox_lib/client';
```lua
lib.closeAlertDialog()
```
</Tab>
<Tab>
```ts
import lib from '@overextended/ox_lib/client';
lib.closeAlertDialog();
```
</Tab>
lib.closeAlertDialog();
```
</Tab>
</Tabs>
**Example:**
## Example
<Tabs items={["Lua", "JS"]}>
<Tab>
<Tab>
```lua
local alert = lib.alertDialog({
header = 'Hello there',
content = 'General Kenobi \n Markdown support!',
centered = true,
cancel = true
})
```lua
local alert = lib.alertDialog({
header = 'Hello there',
content = 'General Kenobi \n Markdown support!',
centered = true,
cancel = true
})
print(alert)
```
</Tab>
<Tab>
```ts
import lib from '@overextended/ox_lib/client';
print(alert)
```
const alert = await lib.alertDialog({
header: 'Hello there',
content: 'General Kenobi \n Markdown support!',
centered: true,
cancel: true,
});
</Tab>
<Tab>
```ts
import lib from '@overextended/ox_lib/client';
const alert = await lib.alertDialog({
header: 'Hello there',
content: 'General Kenobi \n Markdown support!',
centered: true,
cancel: true,
});
console.log(alert);
```
</Tab>
console.log(alert);
```
</Tab>
</Tabs>
![alert_dialog](https://i.imgur.com/Xlx86aK.png)