Skip to content

Commit

Permalink
fix: Correct the spelling of words
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbadri committed Jul 8, 2024
1 parent 239a4cf commit 1bebcad
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useController, useWatch } from 'react-hook-form';

import useQueryBuilder from '@mui-builder/utils/useQueryBuilder/useQueryBuilder';
import UseScript from '@mui-builder/utils/useScript/useScript';
import useScript from '@mui-builder/utils/useScript/useScript';

import axios from 'axios';

Expand Down Expand Up @@ -42,7 +42,7 @@ const useAutoComplete = (props: AutoCompleteProps<Option>) => {
forms,
});

// Handle Wtach Fields
// Handle Watch Fields
useWatch({
control: formMethod.control,
name: dependencies ?? [],
Expand All @@ -63,7 +63,7 @@ const useAutoComplete = (props: AutoCompleteProps<Option>) => {
const error = errors?.[restAutoCompleteProps.id];

// Handle Script
const { scriptResult } = UseScript({
const { scriptResult } = useScript({
script,
formMethod,
forms,
Expand All @@ -82,7 +82,7 @@ const useAutoComplete = (props: AutoCompleteProps<Option>) => {
field.onChange(value ?? null);
};

const hanldeHelperText = () =>
const handleHelperText = () =>
(error?.message as string) ?? innerTextFieldProps?.helperText ?? null;

// Props
Expand All @@ -101,7 +101,7 @@ const useAutoComplete = (props: AutoCompleteProps<Option>) => {

const getInnerTextFieldProps = () => ({
...innerTextFieldProps,
helperText: hanldeHelperText(),
helperText: handleHelperText(),
});

return { getFieldProps, show, getInnerTextFieldProps };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useController, useWatch } from 'react-hook-form';

import useQueryBuilder from '@mui-builder/utils/useQueryBuilder/useQueryBuilder';
import UseScript from '@mui-builder/utils/useScript/useScript';
import useScript from '@mui-builder/utils/useScript/useScript';

import axios from 'axios';

Expand Down Expand Up @@ -33,15 +33,15 @@ const useCheckbox = (props: CheckboxProps) => {
const newProps = propsController?.[id] || {};

// Handle Script
const { scriptResult } = UseScript({
const { scriptResult } = useScript({
script,
formMethod,
forms,
formId,
setProps,
});

// Handle Wtach Fields
// Handle Watch Fields
useWatch({
control: formMethod.control,
name: dependencies ?? [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { InputLabelProps, MenuItemProps } from '@mui/material';
import { SelectInputProps } from '@mui/material/Select/SelectInput';

import useQueryBuilder from '@mui-builder/utils/useQueryBuilder/useQueryBuilder';
import UseScript from '@mui-builder/utils/useScript/useScript';
import useScript from '@mui-builder/utils/useScript/useScript';

import axios from 'axios';

Expand Down Expand Up @@ -38,15 +38,16 @@ const useSelect = (props: SelectProps) => {
const newProps = propsController?.[id] || {};

// Handle Script
const { scriptResult } = UseScript({

const { scriptResult } = useScript({
script,
formMethod,
forms,
formId,
setProps,
});

// Handle Wtach Fields
// Handle Watch Fields
useWatch({
control: formMethod.control,
name: dependencies ?? [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useController, useWatch } from 'react-hook-form';

import useQueryBuilder from '@mui-builder/utils/useQueryBuilder/useQueryBuilder';
import UseScript from '@mui-builder/utils/useScript/useScript';
import useScript from '@mui-builder/utils/useScript/useScript';

import axios from 'axios';

Expand Down Expand Up @@ -31,15 +31,15 @@ const UseText = (props: TextProps) => {
const newProps = propsController?.[textFieldProps?.id] || {};

// Handle Script
const { scriptResult } = UseScript({
const { scriptResult } = useScript({
script,
formMethod,
forms,
formId,
setProps,
});

// Handle Wtach Fields
// Handle Watch Fields
useWatch({
control: formMethod.control,
name: dependencies ?? [],
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils/useScript/useScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import convertFn from '@mui-builder/utils/convertFn/convertFn';
import { ScriptFn } from '../../types/script.types';
import { UseScriptProps } from './useScript.types';

const UseScript = ({
const useScript = ({
script,
formMethod,
forms,
Expand Down Expand Up @@ -33,4 +33,4 @@ const UseScript = ({
return { scriptResult: scriptFn(formMethod, forms, formId, setProps) };
};

export default UseScript;
export default useScript;

0 comments on commit 1bebcad

Please sign in to comment.