Skip to content

Commit

Permalink
corrigindo tradução da mensagem de cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
jesielviana committed Aug 11, 2023
1 parent 06ee574 commit 68ab0bb
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 43 deletions.
10 changes: 9 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,13 @@
"Showing": "Showing",
"for": "for",
"out of": "out of",
"numberFormat": "{{value, number}}"
"numberFormat": "{{value, number}}",
"Got it": "Got it",
"Contact": "Contact",
"Email": "Email",
"Message": "Message",
"Submit": "Submit",
"ContactUs": "Get in Touch",
"Mail sent success": "Your message has been delivered!",
"Mail sent error": "Error sending message. Try again later."
}
10 changes: 0 additions & 10 deletions public/locales/en/contact.json

This file was deleted.

10 changes: 9 additions & 1 deletion public/locales/pt-BR/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,13 @@
"Showing": "Mostrando",
"for": "para",
"out of": "de",
"numberFormat": "{{value, number}}"
"numberFormat": "{{value, number}}",
"Got it": "Prosseguir",
"Contact": "Contato",
"Email": "Email",
"Message": "Menssagem",
"Submit": "Enviar",
"ContactUs": "Fale conosco",
"Mail sent success": "Sua mensagem foi enviada!",
"Mail sent error": "Erro ao enviar a mensagem. Tente novamente mais tarde."
}
10 changes: 0 additions & 10 deletions public/locales/pt-BR/contact.json

This file was deleted.

11 changes: 2 additions & 9 deletions src/components/ContactForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Loader from './Loader';

function ContactForm() {
/* const router = useRouter() */
const { t } = useTranslation('contact');
const { t } = useTranslation('common');

const options = {
autoClose: true,
Expand Down Expand Up @@ -121,14 +121,7 @@ function ContactForm() {
/>

<button
disabled={
!(
captchaCode !== '' &&
name !== '' &&
email !== '' &&
message !== ''
)
}
disabled={!(captchaCode !== '' && name !== '' && email !== '' && message !== '')}
className="btn btn-primary px-4 py-2"
type="submit"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/banners/CookieConsent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const CookieConsent = () => {
className="p-3 text-sm font-bold text-white uppercase bg-gray-700 whitespace-nowrap"
onClick={onClick}
>
Got it
{t('Got it')}
</button>
</div>
</div>
Expand Down
20 changes: 10 additions & 10 deletions src/pages/contact.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { GetStaticProps } from 'next'
import ContactForm from '../components/ContactForm'
import Head from 'next/head'
import { useTranslation } from 'react-i18next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { GetStaticProps } from 'next';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import Head from 'next/head';
import { useTranslation } from 'react-i18next';
import ContactForm from '../components/ContactForm';

type Props = {
// Add custom props here
}
};
// or getServerSideProps: GetServerSideProps<Props> = async ({ locale })
export const getStaticProps: GetStaticProps<Props> = async ({ locale }) => ({
props: {
...(await serverSideTranslations(locale ?? 'en', ['contact', 'navbar'])),
...(await serverSideTranslations(locale ?? 'en', ['common', 'navbar'])),
},
})
});

export default function About() {
const { t } = useTranslation('contact')
const { t } = useTranslation('common');
return (
<>
<Head>
Expand All @@ -33,5 +33,5 @@ export default function About() {
</div>
</div>
</>
)
);
}
2 changes: 1 addition & 1 deletion src/styles/Cookie.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}

.cookieItems button {
background-color: #383e52;
background-color: var(--secondary-color);
text-transform: uppercase;
font-weight: 700;
font-size: 0.875rem;
Expand Down

0 comments on commit 68ab0bb

Please sign in to comment.