hds-web 1.2.7 → 1.2.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hds-web",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -1,4 +1,4 @@
1
- import { React, useState, useEffect } from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import { MediaBox } from '../../helpers/Media';
3
3
  import { Typography } from '../../foundation/Typography';
4
4
  import { HDSButton } from '../../components/Buttons';
@@ -9,26 +9,27 @@ import PropTypes from 'prop-types';
9
9
  const tabCard = (tabContent) => (
10
10
  <>
11
11
  <div className='px-3'>
12
- {tabContent.title &&<Typography textStyle='h4' className={HDSColor(tabContent.title_color)}>{tabContent.title}</Typography>}
12
+ {tabContent.title && <Typography textStyle='h4' className={HDSColor(tabContent.title_color)}>{tabContent.title}</Typography>}
13
13
 
14
- {tabContent.sub_title &&<Typography textStyle='body1c' className={HDSColor(tabContent.sub_title_color)}>{tabContent.sub_title}</Typography>}
14
+ {tabContent.sub_title && <Typography textStyle='body1c' className={HDSColor(tabContent.sub_title_color)}>{tabContent.sub_title}</Typography>}
15
15
  </div>
16
- {tabContent.btnLabel &&
17
- <div className='flex pl-3 pt-6 pb-8'>
18
- <HDSButton
19
- label={tabContent.btnLabel}
20
- type='secondaryLink'
21
- leftIconVariant='none'
22
- rightIconVariant='none'
23
- state='default'
24
- size='sm'
25
- rightAnimatedArrow={true}
26
- rightAnimatedArrowColor='#1E56E3'
27
- animatedHoverStroke='group-hover:stroke-blue-600'
28
- className='flex'
29
- btnTextColorClass='text-blue-600'
30
- />
31
- </div>}
16
+ {tabContent.btnLabel &&
17
+ <div className='flex pl-3 pt-6 pb-8'>
18
+ <HDSButton
19
+ label={tabContent.btnLabel}
20
+ type='secondaryLink'
21
+ leftIconVariant='none'
22
+ rightIconVariant='none'
23
+ state='default'
24
+ size='sm'
25
+ rightAnimatedArrow={true}
26
+ rightAnimatedArrowColor='#1E56E3'
27
+ animatedHoverStroke='group-hover:stroke-blue-600'
28
+ className='flex'
29
+ btnTextColorClass='text-blue-600'
30
+ />
31
+ </div>
32
+ }
32
33
  <div className='mt-8'>
33
34
  <MediaBox
34
35
  img_url={tabContent.img_url}
@@ -41,41 +42,41 @@ const tabCard = (tabContent) => (
41
42
 
42
43
  export default function NavCard(props) {
43
44
  const [activeTab, setActiveTab] = useState('');
44
-
45
+
45
46
  useEffect(() => {
46
- if (props.tabContent) {
47
- const tabNames = Object.keys(props.tabContent);
48
- setActiveTab(tabNames[0]);
49
- }
47
+ if (props.tabContent) {
48
+ const tabNames = Object.keys(props.tabContent);
49
+ setActiveTab(tabNames[0]);
50
+ }
50
51
  }, [props.tabContent]);
51
-
52
+
52
53
  const handleTabClick = (tab) => {
53
- if(tab.name){
54
+ if (tab.name) {
54
55
  setActiveTab(tab.name);
55
56
  }
56
- else return ;
57
- // Perform any other actions based on the clicked tab
57
+ else return;
58
+ // Perform any other actions based on the clicked tab
58
59
  }
59
-
60
+
60
61
  return (
61
- <>
62
- {props.navTabs &&
62
+ <div>
63
+ {props.navTabs &&
63
64
 
64
- <div className='max-w-[44.44rem] p-16 bg-neutral-0 shadow rounded-2xl'>
65
+ <div className='max-w-[44.44rem] p-16 bg-neutral-0 shadow rounded-2xl'>
65
66
 
66
- <div className='flex justify-center pb-8'>
67
- <Tab
68
- onTabClick={handleTabClick}
69
- tabs={props.navTabs}
70
- />
71
- </div>
72
- <div className=''>
73
- {props.tabContent &&
74
- props.tabContent[activeTab] &&
75
- tabCard(props.tabContent[activeTab])}
76
- </div>
67
+ <div className='flex justify-center pb-8'>
68
+ <Tab
69
+ onTabClick={handleTabClick}
70
+ tabs={props.navTabs}
71
+ />
72
+ </div>
73
+ <div className=''>
74
+ {props.tabContent &&
75
+ props.tabContent[activeTab] &&
76
+ tabCard(props.tabContent[activeTab])}
77
+ </div>
77
78
 
78
- </div>}
79
- </>
79
+ </div>}
80
+ </div>
80
81
  )
81
82
  }