SubMenu.js
3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import Image from 'next/image'
import Link from 'next/link'
import React from 'react'
import { Col, Row } from 'react-bootstrap'
import { cleanImage } from '../imageHandling'
export const SubMenu = ({ data, menuTitle }) => {
// console.log(data, 'menudata');
const { classname, headerLeft, headerRight } = data;
return (
<section className='submenu_header_desktop'>
<div className='custom_container'>
<Row className='justify-content-between'>
<div className={classname}>
<Row>
<p className='nav_title'>{menuTitle}</p>
{
headerLeft && headerLeft.map((item, index) => (
<div className={`nav_item ${item?.classname}`} key={index}>
<a className='text-decoration-none' href={item?.btnTextUrl}>
<h4>{item?.title}</h4>
<p>{item?.description}</p>
{
item?.btnText && (
<a className='btn btn-primary' href={item?.btnTextUrl}>{item?.btnText}</a>
)
}
</a>
</div>
))
}
</Row>
</div>
{
!headerRight?.hideRightSection && (
<>
<Col md={1}>
<div className='border_right'></div>
</Col>
<div className={`best_seller ${headerRight?.classname}`}>
<a href={headerRight?.btnTextUrl}>
<Image src={cleanImage(headerRight?.image?.url)} width={1000} height={1000} className='img-fluid position-relative' alt='header image' />
<Row>
<div className='col-xxl-6 col-md-8 best_seller_card'>
<h3>{headerRight?.title}</h3>
<span className='badge bg-white'>
<strong>{headerRight?.tag.split(' ')[0]}</strong> {headerRight?.tag.split(' ').slice(1).join(' ')}
</span>
<p>{headerRight?.description}</p>
</div>
</Row>
<h4>{headerRight?.subTitle}</h4>
<p>{headerRight?.subDescription}</p>
</a>
</div>
</>
)
}
</Row>
</div>
</section>
)
}