Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

Commit 6b56832

Browse files
committed
docs: Add description for all pages
1 parent 0d24808 commit 6b56832

23 files changed

Lines changed: 43 additions & 19 deletions

docs/src/docs/examples/checkbox.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Checkbox
3+
description: How to create a Checkbox with Unform
34
---
45

56
> ⚠️ All examples below are using **TypeScript**, if you're not using it you can simply remove all type definitions as the `React.FC<Props>` from component definition.

docs/src/docs/examples/file-input.mdx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: File Input
3+
description: How to create a File Input with Unform
34
---
45

56
Enable your users to upload images or another files using Unform.
@@ -11,7 +12,13 @@ Enable your users to upload images or another files using Unform.
1112
Simple image input with preview before upload.
1213

1314
```tsx
14-
import React, { ChangeEvent, useRef, useEffect, useCallback, useState } from 'react';
15+
import React, {
16+
ChangeEvent,
17+
useRef,
18+
useEffect,
19+
useCallback,
20+
useState,
21+
} from 'react';
1522

1623
import { useField } from '@unform/core';
1724

@@ -50,19 +57,14 @@ const ImageInput: React.FC<InputProps> = ({ name, ...rest }) => {
5057
},
5158
setValue(_: HTMLInputElement, value: string) {
5259
setPreview(value);
53-
}
54-
})
60+
},
61+
});
5562
}, [fieldName, registerField]);
5663

5764
return (
5865
<>
59-
{ preview && <img src={preview} alt="Preview" width="100" /> }
60-
<input
61-
type="file"
62-
ref={inputRef}
63-
onChange={handlePreview}
64-
{...rest}
65-
/>
66+
{preview && <img src={preview} alt="Preview" width="100" />}
67+
<input type="file" ref={inputRef} onChange={handlePreview} {...rest} />
6668
</>
6769
);
6870
};

docs/src/docs/examples/react-datepicker.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: React DatePicker
3+
description: Learn how to use React DatePicker with Unform
34
---
45

56
[React DatePicker](https://reactdatepicker.com/) is a very simple library that provides a fully customizable Date & Time input with a cool picker.

docs/src/docs/examples/react-input-mask.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: React Input Mask
3+
description: Learn how to use React Input Mask with Unform
34
---
45

56
[React Input Mask](https://github.com/sanniassin/react-input-mask) offers an easy way to add masks to inputs.

docs/src/docs/examples/react-native-input-mask.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: React Native Input Mask
3+
description: Learn how to use React Native Input Mask with Unform
34
---
45

56
[React Native Masked Text](https://github.com/benhurott/react-native-masked-text) offers an easy way to add masks to inputs.

docs/src/docs/examples/react-select.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: React Select
3+
description: Learn how to use React Select with Unform
34
---
45

56
[React Select](https://react-select.com/) is the coolest ReactJS custom `<select>` library.

docs/src/docs/examples/react-simple-code-editor.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: React Simple Code Editor
3+
description: Learn how to use React Simple Code Editor with Unform
34
---
45

56
[React Simple Code Editor](http://satya164.xyz/react-simple-code-editor/) is a cool library focused on providing a simple way to add a code input source to user.

docs/src/docs/guides/basic-form.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Basic form
3+
description: Creating a basic form using Unform
34
---
45

56
Let's suppose you're creating a sign in form with two fields, `email` and `password`.

docs/src/docs/guides/complex-structures.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Complex structures
3+
description: Learn to create complex form structures using Unform
34
---
45

56
Most of the time, the form structure is based on how data is received or restored from the back-end including relationships and complex data structures.

docs/src/docs/guides/get-set-field-error.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Get/set field error
3+
description: Using the get/set field error on Unform
34
---
45

56
Unform provides an easy way to set or access input error using form reference.

0 commit comments

Comments
 (0)