Skip to content

Commit

Permalink
Merge branch 'main' into redirects_1313
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivy Feraco authored Mar 3, 2023
2 parents f10be92 + c2d14b1 commit e91350b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 37 deletions.
20 changes: 18 additions & 2 deletions src/components/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import Container from '@mui/material/Container';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';

const version = process.env.REACT_APP_VERSION;
const isPrerelease = /(alpha|beta)/.test(version);

const Home = () => {
const theme = useTheme();
const { lang } = useParams();
Expand All @@ -27,14 +30,27 @@ const Home = () => {
borderRadius: '0.625rem',
};

const applyUrl = (
isPrerelease
? `https://laboratoria-bootcamp-next.web.app/${lang}/`
: `https://bootcamp.laboratoria.la/${lang}/`
);

return (
<Container>
<Grid container spacing={6}>
<Grid item xs={12}>
<Alert severity="info">
<span
<p
dangerouslySetInnerHTML={{
__html: formatMessage({ id: 'home/alert-info' }),
}}
/>
<p
dangerouslySetInnerHTML={{
__html: formatMessage({ id: 'home/alert' }),
__html: formatMessage({ id: 'home/alert-apply' }, {
link: `<a href="${applyUrl}">${formatMessage({ id: 'here' })}</a>`,
}),
}}
/>
</Alert>
Expand Down
18 changes: 8 additions & 10 deletions src/intl/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,19 @@ const es = {
ux: 'Diseño UX',
submit: 'Enviar',
reset: 'Reiniciar',
here: 'acá',

'not-available-in-lang': 'Este contenido no está disponible actualmente en español.',

'top-bar/hire': 'Contrata talento',

'home/alert': `
<p>
En este sitio web encontrarás contenido de referencia y apoyo que
usamos en nuestros bootcamps.
</p>
<p>
Si estás interesada en postular,
<a href="https://bootcamp.laboratoria.la/es/">acá</a>
puedes encontrar más información.
</p>
'home/alert-info': `
En este sitio web encontrarás contenido de referencia y apoyo que usamos en
nuestros bootcamps.
`,

'home/alert-apply': `
Si estás interesada en postular, {link} puedes encontrar más información.
`,

'projects.web-dev.intro': `
Expand Down
17 changes: 1 addition & 16 deletions src/intl/index.jsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
import { createContext, useContext, useEffect } from 'react';
import { IntlProvider as BaseIntlProvider, FormattedMessage } from 'react-intl';
import { IntlProvider as BaseIntlProvider } from 'react-intl';
import es from './es';
import pt from './pt';

const messages = { es, pt };

export const registerMessages = (namespace, newMessages) => {
Object.keys(newMessages).forEach((lang) => {
Object.keys(newMessages[lang]).forEach((key) => {
Object.assign(messages[lang], {
[`${namespace}/${key}`]: newMessages[lang][key],
});
});
});
return {
FormattedMessage: (props) => {
return <FormattedMessage {...props} />
},
};
};

const LangContext = createContext();

export const useLang = () => useContext(LangContext);
Expand Down
18 changes: 9 additions & 9 deletions src/intl/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ const pt = {
ux: 'UX Design',
submit: 'Enviar',
reset: 'Resetar',
here: 'aqui',

'not-available-in-lang': 'Este conteúdo não está disponível atualmente em português.',

'top-bar/hire': 'Contrate talento',

'home/alert': `
<p>
Neste site você encontrará conteúdo de referência e suporte que utilizamos
em nossos bootcamps.
</p>
<p>
Se estiver interessada em candidatar-se, pode encontrar mais informações
<a href="https://bootcamp.laboratoria.la/pt/">aqui</a>.
</p>
'home/alert-info': `
Neste site você encontrará conteúdo de referência e suporte que utilizamos
em nossos bootcamps.
`,

'home/alert-apply': `
Se estiver interessada em candidatar-se, pode encontrar mais informações
{link}.
`,

'projects.web-dev.intro': `
Expand Down

0 comments on commit e91350b

Please sign in to comment.