Skip to content

Commit 9ae315f

Browse files
Merge pull request #2054 from lumi-tip/development-lumi-9241
✨ Bootcamp landing can add whatsapp buble now
2 parents 38e6027 + 0008174 commit 9ae315f

File tree

3 files changed

+86
-0
lines changed

3 files changed

+86
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const whatsappBorder = ({ width, height, style, color = '#25BF6C' }) => (
2+
<svg
3+
width={width || '48'}
4+
height={height || '48'}
5+
style={style}
6+
viewBox="0 0 48 48"
7+
fill="none"
8+
xmlns="http://www.w3.org/2000/svg"
9+
pointerEvents="none"
10+
>
11+
{/* Círculo exterior con piquito */}
12+
<path
13+
d="M24 6c-9.94 0-18 8.06-18 18 0 2.7.62 5.27 1.8 7.6L6 42l10.4-2.75A18 18 0 1 0 24 6z"
14+
fill="none"
15+
stroke={color}
16+
strokeWidth="4"
17+
/>
18+
{/* Teléfono redimensionado y centrado */}
19+
<g transform="translate(10, 9) scale(2.2)">
20+
<path
21+
d="M4.56 3.73C4.68 3.73 4.79 3.73 4.9 3.74C5 3.74 5.15 3.7 5.29 4.04C5.43 4.38 5.78 5.24 5.82 5.32C5.87 5.41 5.9 5.51 5.84 5.63C5.78 5.74 5.75 5.82 5.66 5.92C5.58 6.02 5.48 6.14 5.4 6.22C5.32 6.31 5.23 6.4 5.33 6.57C5.43 6.75 5.78 7.32 6.3 7.78C6.96 8.37 7.52 8.55 7.7 8.64C7.87 8.72 7.97 8.71 8.07 8.59C8.18 8.48 8.51 8.09 8.63 7.91C8.74 7.74 8.86 7.77 9.02 7.83C9.18 7.88 10.03 8.3 10.21 8.39C10.38 8.48 10.5 8.52 10.54 8.59C10.58 8.66 10.58 9.01 10.44 9.42C10.29 9.82 9.6 10.19 9.26 10.24C8.96 10.29 8.58 10.3 8.17 10.17C7.91 10.09 7.59 9.99 7.17 9.81C5.43 9.06 4.29 7.31 4.2 7.19C4.11 7.07 3.49 6.25 3.49 5.4C3.49 4.54 3.94 4.12 4.1 3.95C4.26 3.78 4.45 3.73 4.56 3.73Z"
22+
stroke={color}
23+
strokeWidth="0.6"
24+
fill={color}
25+
strokeLinecap="round"
26+
strokeLinejoin="round"
27+
/>
28+
</g>
29+
</svg>
30+
);
31+
32+
export default whatsappBorder;

src/components/PageBubble.jsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
import { Box } from '@chakra-ui/react';
3+
import PropTypes from 'prop-types';
4+
5+
function PageBubble({ url, children, ...rest }) {
6+
if (!url) return null;
7+
return (
8+
<Box
9+
as="a"
10+
href={url}
11+
target="_blank"
12+
rel="noopener noreferrer"
13+
position="fixed"
14+
bottom="32px"
15+
right="32px"
16+
borderRadius="full"
17+
width="60px"
18+
height="60px"
19+
display="flex"
20+
alignItems="center"
21+
justifyContent="center"
22+
{...rest}
23+
>
24+
{children}
25+
</Box>
26+
);
27+
}
28+
29+
PageBubble.propTypes = {
30+
url: PropTypes.string.isRequired,
31+
children: PropTypes.node.isRequired,
32+
};
33+
34+
export default PageBubble;

src/pages/bootcamp/[course_slug].jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import SimpleModal from '../../components/SimpleModal';
2323
import CustomCarousel from '../../components/CustomCarousel';
2424
import AssignmentSlide from '../../components/AssignmentSlide';
2525
import { useBootcamp } from './useBootcamp';
26+
import PageBubble from '../../components/PageBubble';
2627

2728
const limitViewStudents = 3;
2829

@@ -629,6 +630,25 @@ function CoursePage() {
629630
/>
630631
</Box>
631632
</SimpleModal>
633+
{getAlternativeTranslation('whatsapp_url') && (
634+
<PageBubble
635+
url={getAlternativeTranslation('whatsapp_url')}
636+
background="green.400"
637+
borderRadius="50%"
638+
boxShadow="0 2px 8px rgba(0,0,0,0.10)"
639+
p={1.5}
640+
display="flex"
641+
alignItems="center"
642+
justifyContent="center"
643+
width="52px"
644+
height="52px"
645+
bottom={isCtaVisible ? '72px' : '10px'}
646+
right="12px"
647+
zIndex={2000}
648+
>
649+
<Icon icon="whatsapp-border" color="#ffffff" width="35px" height="35px" />
650+
</PageBubble>
651+
)}
632652
</>
633653
);
634654
}

0 commit comments

Comments
 (0)