@homefile/components-v2 2.6.3 → 2.6.4

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.
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { t } from 'i18next';
2
3
  import { Box, Flex, Image } from '@chakra-ui/react';
3
4
  import { Flag } from '../../assets/images';
4
5
  export const TourButton = ({ label, onClick }) => {
5
- return (_jsx(Box, { as: "button", boxShadow: "none", borderRadius: "full", bg: "lightGreen.5", fontFamily: "secondary", transition: "all 0.2s ease-in-out", _hover: { bg: 'lightGreen.4' }, onClick: onClick, flexShrink: 0, overflow: "hidden", children: _jsxs(Flex, { align: "center", pr: "base", py: "1", children: [_jsx(Image, { src: Flag, w: "40px", h: "auto", alt: "tour", position: "relative", bottom: "-4px" }), label] }) }));
6
+ return (_jsx(Box, { as: "button", boxShadow: "none", borderRadius: "full", bg: "lightGreen.5", fontFamily: "secondary", transition: "all 0.2s ease-in-out", _hover: { bg: 'lightGreen.4' }, onClick: onClick, flexShrink: 0, overflow: "hidden", children: _jsxs(Flex, { align: "center", pr: "base", py: "1", children: [_jsx(Image, { src: Flag, w: "40px", h: "auto", alt: "tour", position: "relative", bottom: "-4px" }), label !== null && label !== void 0 ? label : t('help.buttonTour')] }) }));
6
7
  };
@@ -6,10 +6,11 @@ import { useHelpContent } from '../../hooks';
6
6
  export const HelpContent = ({ categories, formSent, onClose, onFeedback, isLoading, tutorials, }) => {
7
7
  var _a;
8
8
  const { handlePlay, handleSearchChange, isModalOpen, onModalClose, search, filteredTutorials, videoToPlay, } = useHelpContent(tutorials);
9
+ const categoriesDefault = t('feedback.categories').split(',');
9
10
  const tabs = [
10
11
  {
11
12
  label: t('help.tabs.tab1'),
12
- component: (_jsx(HelpFeedback, { categories: categories, formSent: formSent, isLoading: isLoading, onClick: onFeedback })),
13
+ component: (_jsx(HelpFeedback, { categories: categories !== null && categories !== void 0 ? categories : categoriesDefault, formSent: formSent, isLoading: isLoading, onClick: onFeedback })),
13
14
  },
14
15
  {
15
16
  label: t('help.tabs.tab2'),
@@ -65,5 +65,5 @@ export const AppBarComponent = ({ setActiveTour = (value) => { }, onClick = (pan
65
65
  };
66
66
  const { windowDimensions: { width }, } = useWindowDimensions();
67
67
  const isMobile = width <= 768;
68
- return (_jsxs(AppBar, { onLogoClick: () => null, user: userMock, children: [!isMobile && (_jsxs(_Fragment, { children: [_jsx(TourButton, { onClick: handleTour, label: "Show tour" }), _jsx(BarDivider, {})] })), _jsx(NotificationsReminder, { onClick: () => onClick('Notifications'), total: 2 }), _jsx(BarDivider, {}), _jsx(PeopleConnected, { onClick: () => null, total: 12 }), _jsx(BarDivider, {}), _jsx(ContactList, { onClick: () => null, total: 2 }), _jsx(BarDivider, {}), _jsx(TutorialsButton, { onClick: () => null }), !isMobile && (_jsxs(_Fragment, { children: [_jsx(BarDivider, {}), _jsxs(Flex, { align: "center", gap: "1", children: [_jsx(StorageUsed, { totalUsed: 2, totalStorage: 10, state: "trial", onClick: () => null }), _jsx(Trash, { onClick: () => null, total: 2 })] })] }))] }));
68
+ return (_jsxs(AppBar, { onLogoClick: () => null, user: userMock, children: [!isMobile && (_jsxs(_Fragment, { children: [_jsx(TourButton, { onClick: handleTour }), _jsx(BarDivider, {})] })), _jsx(NotificationsReminder, { onClick: () => onClick('Notifications'), total: 2 }), _jsx(BarDivider, {}), _jsx(PeopleConnected, { onClick: () => null, total: 12 }), _jsx(BarDivider, {}), _jsx(ContactList, { onClick: () => null, total: 2 }), _jsx(BarDivider, {}), _jsx(TutorialsButton, { onClick: () => null }), !isMobile && (_jsxs(_Fragment, { children: [_jsx(BarDivider, {}), _jsxs(Flex, { align: "center", gap: "1", children: [_jsx(StorageUsed, { totalUsed: 2, totalStorage: 10, state: "trial", onClick: () => null }), _jsx(Trash, { onClick: () => null, total: 2 })] })] }))] }));
69
69
  };
@@ -1,4 +1,4 @@
1
1
  export interface TourButtonI {
2
- label: string;
2
+ label?: string;
3
3
  onClick: () => void;
4
4
  }
@@ -3,7 +3,7 @@ export type FeedbackFormProps = {
3
3
  message: string;
4
4
  };
5
5
  export interface ContactFormI {
6
- categories: string[];
6
+ categories?: string[];
7
7
  isLoading: boolean;
8
8
  onClick: (form: FeedbackFormProps) => void;
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.6.3",
3
+ "version": "2.6.4",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -1,3 +1,4 @@
1
+ import { t } from 'i18next'
1
2
  import { Box, Flex, Image } from '@chakra-ui/react'
2
3
  import { TourButtonI } from '@/interfaces'
3
4
  import { Flag } from '@/assets/images'
@@ -25,7 +26,7 @@ export const TourButton = ({ label, onClick }: TourButtonI) => {
25
26
  position="relative"
26
27
  bottom="-4px"
27
28
  />
28
- {label}
29
+ {label ?? t('help.buttonTour')}
29
30
  </Flex>
30
31
  </Box>
31
32
  )
@@ -35,12 +35,14 @@ export const HelpContent = ({
35
35
  videoToPlay,
36
36
  } = useHelpContent(tutorials)
37
37
 
38
+ const categoriesDefault = t('feedback.categories').split(',')
39
+
38
40
  const tabs = [
39
41
  {
40
42
  label: t('help.tabs.tab1'),
41
43
  component: (
42
44
  <HelpFeedback
43
- categories={categories}
45
+ categories={categories ?? categoriesDefault}
44
46
  formSent={formSent}
45
47
  isLoading={isLoading}
46
48
  onClick={onFeedback}
@@ -492,7 +492,7 @@ export const AppBarComponent = ({
492
492
  <AppBar onLogoClick={() => null} user={userMock}>
493
493
  {!isMobile && (
494
494
  <>
495
- <TourButton onClick={handleTour} label="Show tour" />
495
+ <TourButton onClick={handleTour} />
496
496
  <BarDivider />
497
497
  </>
498
498
  )}
@@ -1,4 +1,4 @@
1
1
  export interface TourButtonI {
2
- label: string
2
+ label?: string
3
3
  onClick: () => void
4
4
  }
@@ -3,7 +3,7 @@ export type FeedbackFormProps = {
3
3
  message: string
4
4
  }
5
5
  export interface ContactFormI {
6
- categories: string[]
6
+ categories?: string[]
7
7
  isLoading: boolean
8
8
  onClick: (form: FeedbackFormProps) => void
9
9
  }