Skip to content

Commit 7f370f7

Browse files
Merge pull request #2019 from breatheco-de/main
Merge main into dev
2 parents 2cdc0aa + c312d2e commit 7f370f7

File tree

15 files changed

+373
-144
lines changed

15 files changed

+373
-144
lines changed

bun.lock

Lines changed: 256 additions & 3 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"js-md5": "^0.8.3",
8787
"katex": "^0.16.8",
8888
"markdown-to-jsx": "7.2.0",
89+
"mermaid": "^11.6.0",
8990
"next": "^13.4.1",
9091
"next-redux-wrapper": "8.1.0",
9192
"next-remove-imports": "^1.0.11",

public/locales/en/course.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
},
111111
"build-connector": {
112112
"what-you-will": "Learn by building",
113-
"description": "When learning to code at your own pace, having access to video tutorials, code examples, and continuous, real-time feedback is crucial to succeed. The tasks you'll tackle will closely resemble those encountered in a real-world tech position. Here's a glimpse of what you'll be working on:",
113+
"description": "When learning at your own pace, having access to video tutorials, code examples, and continuous, real-time feedback is crucial to succeed. The tasks you'll tackle will closely resemble those encountered in a real-world tech position. Here's a glimpse of what you'll be working on:",
114114
"build": "real-life projects"
115115
},
116116
"why-learn-4geeks-connector": {
@@ -394,9 +394,9 @@
394394
},
395395
"job-section": {
396396
"image": "/static/images/happy-male-with-laptop.png",
397-
"title": "Get prepared for a new career",
397+
"title": "Get an exclusive 30% discount on Beyond the Resume",
398398
"subtitle": "Improve your CV, portfolio, GitHub profile, and social media profiles.",
399-
"description": "Get access to exercises that simulate real-life interviews curated from the companies actively hiring. At no additional cost to you and without deducting anything from the salary of the job offer you get.",
399+
"description": "Earn an exclusive discount on Beyond the Resume after completing the course, a program designed to help you with career topics, from optimizing your professional profile to excelling in interviews.",
400400
"button": "Join now!",
401401
"button-link": "#pricing"
402402
}

public/locales/es/course.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"course-content-text": "Prepárate para obtener un trabajo con nuestro syllabus",
2+
"course-content-text": "Prepárate para obtener un trabajo con nuestro curriculum",
33
"course-content-description": "Hemos ajustado nuestro contenido del curso con cientos de posiciones laborales para prepararte para una entrada exitosa en el mundo de la tecnología.",
44
"students-enrolled-count": "+{{count}} estudiantes inscritos",
55
"students-enrolled": "cientos de estudiantes inscritos",
@@ -110,7 +110,7 @@
110110
},
111111
"build-connector": {
112112
"what-you-will": "Aprende construyendo",
113-
"description": "Cuando aprendes a programar a tu propio ritmo, tener acceso a tutoriales en video, ejemplos de código y retroalimentación continua en tiempo real es crucial para tener éxito. Las tareas que abordarás se asemejarán estrechamente a las encontradas en una posición tecnológica del mundo real. Aquí tienes un vistazo de en qué estarás trabajando:",
113+
"description": "Cuando aprendes a tu propio ritmo, tener acceso a tutoriales en video, ejemplos de código y retroalimentación continua en tiempo real es crucial para tener éxito. Las tareas que abordarás se asemejarán estrechamente a las encontradas en una posición tecnológica del mundo real. Aquí tienes un vistazo de en qué estarás trabajando:",
114114
"build": "proyectos de la vida real",
115115
"link": "#pricing"
116116
},
@@ -329,19 +329,16 @@
329329
{
330330
"type": "lesson",
331331
"title": "Lecturas",
332-
"qty": 45,
333332
"icon": "book"
334333
},
335334
{
336335
"type": "exercise",
337336
"title": "Ejercicios interactivos",
338-
"qty": 584,
339337
"icon": "strength"
340338
},
341339
{
342340
"type": "project",
343341
"title": "Proyectos interactivos",
344-
"qty": 28,
345342
"icon": "laptop-code"
346343
},
347344
{
@@ -385,7 +382,7 @@
385382
"image": "/static/images/certificate-preview.webp",
386383
"title": "Certifícate en tu tecnología favorita",
387384
"description": "Tu certificado de 4Geeks abrirá puertas a oportunidades profesionales con nuestra extensa red de empresas en todo el mundo. Respaldado por instituciones internacionales, representa un estándar reconocido a nivel global, desbloqueando diversos caminos profesionales.",
388-
"button": "Ver precios",
385+
"button": "Empieza ahora",
389386
"button-link": "#pricing"
390387
},
391388
"havent-decided": {
@@ -398,10 +395,10 @@
398395
},
399396
"job-section": {
400397
"image": "/static/images/happy-male-with-laptop.png",
401-
"title": "Prepárate para una carrera nueva",
398+
"title": "Obtén un descuento exclusivo de 30% en Beyond the Resume",
402399
"subtitle": "Mejora tu CV, portafolio, perfil de GitHub, y el perfil de tus redes sociales.",
403-
"description": "Obtén acceso a ejercicios que simulan entrevistas de la vida real, obtenidas de empresas que están contratando activamente. Por ningún costo adicional para ti y sin quitarte nada del salario de la oferta de trabajo que obtengas.",
404-
"button": "Únete ahora",
400+
"description": "Obtén un descuento exclusivo en Beyond the Resume al completar el curso, un programa diseñado para ayudarte con temas de carrera, desde optimizar tu perfil profesional hasta destacar en entrevistas.",
401+
"button": "Empieza ahora",
405402
"button-link": "#pricing"
406403
}
407404
}

src/components/Checkout/PaymentInfo.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,10 @@ function PaymentInfo({ setShowPaymentDetails }) {
270270
};
271271

272272
const handleSubmit = async (actions, values) => {
273-
const resp = await bc.payment().addCard(values);
273+
const resp = await bc.payment().addCard({
274+
...values,
275+
academy: selectedPlanCheckoutData?.owner?.id,
276+
});
274277
const data = await resp.json();
275278
setIsSubmittingCard(false);
276279

src/components/Checkout/ServiceSummary.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function ServiceSummary({ service }) {
166166
},
167167
});
168168
}
169-
const resp = await bc.payment().addCard(values);
169+
const resp = await bc.payment().addCard({ ...values, academy: service.academy.id });
170170
const data = await resp.json();
171171
setIsSubmittingCard(false);
172172
if (resp.ok) {

src/components/CourseContent.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
import PropTypes from 'prop-types';
22
import { Flex } from '@chakra-ui/react';
3-
import useTranslation from 'next-translate/useTranslation';
43
import Heading from './Heading';
54
import useStyle from '../hooks/useStyle';
65
import Text from './Text';
76
import AcordionList from './AcordionList';
87

9-
function CourseContent({ data, ...rest }) {
8+
function CourseContent({ data, courseContentText, courseContentDescription, ...rest }) {
109
const { hexColor } = useStyle();
11-
const { t } = useTranslation('course');
1210

1311
return (
1412
<Flex gridGap="12px" flexDirection="column">
1513
<Heading as="h2" size={{ base: '20px', md: '34px' }}>
16-
{t('course-content-text')}
14+
{courseContentText}
1715
</Heading>
1816
<Text size={{ base: '16px', md: '18px' }} color={hexColor.fontColor2}>
19-
{t('course-content-description')}
17+
{courseContentDescription}
2018
</Text>
2119

2220
<AcordionList defaultIndex={0} list={data} {...rest} />
@@ -25,8 +23,12 @@ function CourseContent({ data, ...rest }) {
2523
}
2624
CourseContent.propTypes = {
2725
data: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object])),
26+
courseContentText: PropTypes.string,
27+
courseContentDescription: PropTypes.string,
2828
};
2929
CourseContent.defaultProps = {
3030
data: {},
31+
courseContentText: '',
32+
courseContentDescription: '',
3133
};
3234
export default CourseContent;

src/components/MarkDownParser/MDComponents/index.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import tomorrow from '../syntaxHighlighter/tomorrow';
1313
import { slugify } from '../../../utils';
1414
import Text from '../../Text';
1515
import Image from '../../Image';
16+
import MermaidRenderer from '../MermaidRenderer';
1617

1718
export function generateId(children) {
1819
const text = children ? children
@@ -87,6 +88,13 @@ export function MDLink({ children, href }) {
8788
export function Code({ inline, showLineNumbers, showInlineLineNumbers, className, children }) {
8889
const match = /language-(\w+)/.exec(className || '');
8990

91+
console.log('LENGUAGE ', match);
92+
93+
if (match && match.includes('mermaid')) {
94+
console.log(children, 'Children');
95+
return <MermaidRenderer code={children[0]} />;
96+
}
97+
9098
return !inline && match ? (
9199
<SyntaxHighlighter
92100
showLineNumbers={showLineNumbers}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { useEffect } from 'react';
2+
import mermaid from 'mermaid';
3+
import PropTypes from 'prop-types';
4+
5+
function MermaidRenderer({ code }) {
6+
useEffect(() => {
7+
mermaid.initialize({ startOnLoad: true });
8+
mermaid.contentLoaded();
9+
}, []);
10+
11+
return <div className="mermaid">{code}</div>;
12+
}
13+
14+
MermaidRenderer.propTypes = {
15+
code: PropTypes.string.isRequired,
16+
};
17+
export default MermaidRenderer;

src/components/Navbar/index.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { getAllMySubscriptions } from '../../handlers/subscriptions';
3535

3636
function Navbar({ translations, pageProps }) {
3737
const [uniqueLanguages, setUniqueLanguages] = useState([]);
38-
const { location } = useSession();
38+
const { location, isLoadingLocation } = useSession();
3939
const { isAuthenticated, isLoading, user, logout, cohorts } = useAuth();
4040
const [navbarItems, setNavbarItems] = useState([]);
4141
const [mktCourses, setMktCourses] = useState([]);
@@ -135,8 +135,10 @@ function Navbar({ translations, pageProps }) {
135135
};
136136

137137
useEffect(() => {
138-
fetchMktCourses();
139-
}, [locale]);
138+
if (!isLoadingLocation) {
139+
fetchMktCourses();
140+
}
141+
}, [locale, isLoadingLocation]);
140142

141143
useEffect(() => {
142144
if (pageProps?.existsWhiteLabel) {

0 commit comments

Comments
 (0)