Skip to content

Commit

Permalink
[docs] Fix typo (mantinedev#3721)
Browse files Browse the repository at this point in the history
* [docs] Fix typos

* [@mantine/hooks] Fix typos

* [@mantine/core] Fix capitalization

* [@mantine/demos] Fix capitalization
  • Loading branch information
hllmtl authored Mar 14, 2023
1 parent 34d43a1 commit 26d2c32
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/src/docs/hooks/use-local-storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ When state changes in one tab, it automatically updates value in all other opene
You can test this feature by opening 2 tabs with Mantine docs side by side and changing color scheme
(button on the top right or `⌘ + J` on MacOS and `Ctrl + J` on Windows and Linux).

## Serialize/deserialize json
## Serialize/deserialize JSON

By default, hook will serialize/deserialize data with `JSON.stringify`/`JSON.parse`.
If you need to store data in local storage that cannot be serialized with `JSON.stringify`
Expand Down Expand Up @@ -133,10 +133,10 @@ interface UseLocalStorage<T> {
/** Default value that will be set if value is not found in local storage */
defaultValue?: T;

/** If set to true, value will be update in useEffect after mount */
/** If set to true, value will be updated in useEffect after mount */
getInitialValueInEffect: boolean;

/** Function to serialize value into string to be saved in local storage */
/** Function to serialize value into a string to be saved in local storage */
serialize?(value: T): string;

/** Function to deserialize string value from local storage to value */
Expand Down
8 changes: 4 additions & 4 deletions src/mantine-core/src/JsonInput/JsonInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ export interface JsonInputProps
/** Called when value changes */
onChange?(value: string): void;

/** Format json on blur */
/** Format JSON on blur */
formatOnBlur?: boolean;

/** Error message shown when json is not valid */
/** Error message shown when JSON is not valid */
validationError?: React.ReactNode;

/** Function to serialize value into string, used for value formatting, JSON.stringify by default */
/** Function to serialize value into a string, used for value formatting, JSON.stringify by default */
serialize?: typeof JSON.stringify;

/** Function to deserialize string value, used for value formatting and input json validation, must throw error if string cannot be processed, JSON.parse by default */
/** Function to deserialize string value, used for value formatting and input JSON validation, must throw error if string cannot be processed, JSON.parse by default */
deserialize?: typeof JSON.parse;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Demo() {
<JsonInput
label="Your package.json"
placeholder="Textarea will autosize to fit the content"
validationError="Invalid json"
validationError="Invalid JSON"
formatOnBlur
autosize
minRows={4}
Expand All @@ -26,7 +26,7 @@ function Demo() {
mx="auto"
label="Your package.json"
placeholder="Textarea will autosize to fit the content"
validationError="Invalid json"
validationError="Invalid JSON"
formatOnBlur
autosize
minRows={4}
Expand Down
4 changes: 2 additions & 2 deletions src/mantine-hooks/src/use-local-storage/create-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export interface IStorageProperties<T> {
/** Default value that will be set if value is not found in storage */
defaultValue?: T;

/** If set to true, value will be update is useEffect after mount */
/** If set to true, value will be updated in useEffect after mount */
getInitialValueInEffect?: boolean;

/** Function to serialize value into string to be save in storage */
/** Function to serialize value into a string to be saved in storage */
serialize?(value: T): string;

/** Function to deserialize string value from storage to value */
Expand Down

0 comments on commit 26d2c32

Please sign in to comment.