@autobusal/providers 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,14 +4,14 @@ import { useSystemTheme } from '@autobusal/hooks';
4
4
  import { getLanguage } from '../Setup/languages';
5
5
  import errors from '@lang/errors';
6
6
  import { Background, Container, Logo, Description } from './styles';
7
- import { GetSettings } from '../services';
7
+ import { useGetSettings } from '../services';
8
8
 
9
9
  interface Props {
10
10
  type: 'error' | 'not_found'
11
11
  }
12
12
 
13
13
  const Message = ({ type }: Props): JSX.Element => {
14
- const { data } = GetSettings();
14
+ const { data } = useGetSettings();
15
15
 
16
16
  const theme = useSystemTheme();
17
17
 
@@ -1,13 +1,13 @@
1
1
  import { Toaster } from 'react-hot-toast';
2
2
  import { useSystemTheme } from '@autobusal/hooks';
3
- import { GetSettings } from '../services';
3
+ import { useGetSettings } from '../services';
4
4
 
5
5
  interface Props {
6
6
  children: JSX.Element
7
7
  }
8
8
 
9
9
  export const Provider = ({ children }: Props): JSX.Element => {
10
- const { data } = GetSettings();
10
+ const { data } = useGetSettings();
11
11
 
12
12
  const mode = useSystemTheme();
13
13
 
package/Setup/Setup.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import Preload from './Preload';
2
2
  import languages from './languages';
3
3
  import analytics from './analytics';
4
- import { GetSettings, GetMenu } from '../services';
4
+ import { useGetSettings, useGetMenu } from '../services';
5
5
 
6
6
  interface Props {
7
7
  type: 'normal' | 'whitelabel'
@@ -9,9 +9,9 @@ interface Props {
9
9
  }
10
10
 
11
11
  const Setup = ({ type, children }: Props): JSX.Element => {
12
- const { data } = GetSettings();
12
+ const { data } = useGetSettings();
13
13
 
14
- GetMenu();
14
+ useGetMenu();
15
15
 
16
16
  languages(type, data.preferences.languages.default);
17
17
 
package/Styles/Styles.tsx CHANGED
@@ -1,14 +1,14 @@
1
1
  import { ThemeProvider } from 'styled-components';
2
2
  import { useSystemTheme } from '@autobusal/hooks';
3
3
  import GlobalStyles from './GlobalStyles';
4
- import { GetSettings } from '../services';
4
+ import { useGetSettings } from '../services';
5
5
 
6
6
  interface Props {
7
7
  children: JSX.Element
8
8
  }
9
9
 
10
10
  const Styles = ({ children }: Props): JSX.Element => {
11
- const { data } = GetSettings();
11
+ const { data } = useGetSettings();
12
12
 
13
13
  const mode = useSystemTheme();
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "main": "index.ts"
6
6
  }
package/services.ts CHANGED
@@ -3,7 +3,7 @@ import apiClient from './Queries/apiClient';
3
3
  import { SettingsData, MenuData } from './types/settings';
4
4
  import useMenuStore from './stores/menu';
5
5
 
6
- export const GetSettings = (): UseSuspenseQueryResult<SettingsData> => (
6
+ export const useGetSettings = (): UseSuspenseQueryResult<SettingsData> => (
7
7
  useSuspenseQuery({
8
8
  queryKey: ['get-settings'],
9
9
  queryFn: async () => (
@@ -17,7 +17,7 @@ export const GetSettings = (): UseSuspenseQueryResult<SettingsData> => (
17
17
  })
18
18
  );
19
19
 
20
- export const GetMenu = (): UseSuspenseQueryResult<MenuData> => {
20
+ export const useGetMenu = (): UseSuspenseQueryResult<MenuData> => {
21
21
  const menuStore = useMenuStore();
22
22
 
23
23
  return useSuspenseQuery({