Skip to content

Commit

Permalink
Merge pull request #3 from carvalholuigi25/main
Browse files Browse the repository at this point in the history
merge from main into production branch (pt 3)
  • Loading branch information
carvalholuigi25 authored Nov 1, 2023
2 parents b20e64e + 48bf0ad commit 893f799
Show file tree
Hide file tree
Showing 29 changed files with 142 additions and 89 deletions.
40 changes: 3 additions & 37 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// module.exports = nextConfig

const withNextIntl = require('next-intl/plugin')('./i18n.ts');
const defLocale = "en";

module.exports = withNextIntl({
experimental: {
Expand All @@ -15,44 +16,9 @@ module.exports = withNextIntl({
return [
{
source: '/',
destination: '/en',
destination: '/'+defLocale,
permanent: true,
},
{
source: '/admin',
destination: '/en/admin/dashboard',
permanent: true,
},
{
source: '/admin/dashboard',
destination: '/en/admin/dashboard',
permanent: true,
},
{
source: '/admin/projects',
destination: '/en/admin/projects',
permanent: true,
},
{
source: '/admin/users',
destination: '/en/admin/users',
permanent: true,
},
{
source: '/admin/newsletter',
destination: '/en/admin/newsletter',
permanent: true,
},
{
source: '/admin/subscriptions',
destination: '/en/admin/subscriptions',
permanent: true,
},
{
source: '/admin/settings',
destination: '/en/admin/settings',
permanent: true,
},
}
]
},
});
4 changes: 3 additions & 1 deletion public/locales/ae.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "رسالة",
"contactsMessageInp": "اكتب الرسالة هنا",
"contactsReset": "إعادة ضبط",
"contactsSubmit": "يُقدِّم"
"contactsSubmit": "يُقدِّم",
"contactsSendEmail": "هل تواجه مشكلة في التواصل معي؟",
"contactsSendEmail2": "انقر هنا لإرسال البريد الإلكتروني لي!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "Nachricht",
"contactsMessageInp": "Schreiben Sie die Nachricht hier",
"contactsReset": "Zurücksetzen",
"contactsSubmit": "Senden"
"contactsSubmit": "Senden",
"contactsSendEmail": "Haben Sie Schwierigkeiten, mit mir in Kontakt zu treten?",
"contactsSendEmail2": "Klicken Sie hier, um mir eine E-Mail zu senden!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "Message",
"contactsMessageInp": "Write the message here",
"contactsReset": "Reset",
"contactsSubmit": "Submit"
"contactsSubmit": "Submit",
"contactsSendEmail": "Having trouble to contact with me?",
"contactsSendEmail2": "Click here to send email to me!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "Message",
"contactsMessageInp": "Write the message here",
"contactsReset": "Reset",
"contactsSubmit": "Submit"
"contactsSubmit": "Submit",
"contactsSendEmail": "Having trouble to contact with me?",
"contactsSendEmail2": "Click here to send email to me!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "Message",
"contactsMessageInp": "Write the message here",
"contactsReset": "Reset",
"contactsSubmit": "Submit"
"contactsSubmit": "Submit",
"contactsSendEmail": "Having trouble to contact with me?",
"contactsSendEmail2": "Click here to send email to me!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "Mensaje",
"contactsMessageInp": "Escribe el mensaje aquí",
"contactsReset": "Restablecer",
"contactsSubmit": "Enviar"
"contactsSubmit": "Enviar",
"contactsSendEmail": "¿Tienes problemas para contactar conmigo?",
"contactsSendEmail2": "¡Haga clic aquí para enviarme un correo electrónico!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "Message",
"contactsMessageInp": "Écrivez le message ici",
"contactsReset": "Réinitialiser",
"contactsSubmit": "Soumettre"
"contactsSubmit": "Soumettre",
"contactsSendEmail": "Vous rencontrez des difficultés pour me contacter?",
"contactsSendEmail2": "Cliquez ici pour m'envoyer un e-mail!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "'Ōlelo",
"contactsMessageInp": "Kākau i ka memo ma ane'i",
"contactsReset": "Ho'oponopono hou",
"contactsSubmit": "Waiho mai"
"contactsSubmit": "Waiho mai",
"contactsSendEmail": "Loa'a ka pilikia e launa pū me a'u?",
"contactsSendEmail2": "Kaomi ma ane'i e ho'ouna i ka leka uila ia'u!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/il.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "הוֹדָעָה",
"contactsMessageInp": "כתבו את ההודעה כאן",
"contactsReset": "אִתחוּל",
"contactsSubmit": "שלח"
"contactsSubmit": "שלח",
"contactsSendEmail": "מתקשה ליצור איתי קשר?",
"contactsSendEmail2": "לחץ כאן כדי לשלוח לי מייל!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/in.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "संदेश",
"contactsMessageInp": "संदेश यहां लिखें",
"contactsReset": "रीसेट",
"contactsSubmit": "जमा करना"
"contactsSubmit": "जमा करना",
"contactsSendEmail": "मुझसे संपर्क करने में परेशानी हो रही है?",
"contactsSendEmail2": "मुझे ईमेल भेजने के लिए यहां क्लिक करें!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "Messaggio",
"contactsMessageInp": "Scrivi il messaggio qui",
"contactsReset": "Reimposta",
"contactsSubmit": "Invia"
"contactsSubmit": "Invia",
"contactsSendEmail": "Hai difficoltà a contattarmi?",
"contactsSendEmail2": "Clicca qui per inviarmi un'e-mail!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "メッセージ",
"contactsMessageInp": "ここにメッセージを書いてください",
"contactsReset": "リセット",
"contactsSubmit": "提出する"
"contactsSubmit": "提出する",
"contactsSendEmail": "私との連絡に問題がありますか?",
"contactsSendEmail2": "ここをクリックしてメールを送信してください。"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "Mensagem",
"contactsMessageInp": "Escreva a mensagem aqui",
"contactsReset": "Reiniciar",
"contactsSubmit": "Enviar"
"contactsSubmit": "Enviar",
"contactsSendEmail": "Está tendo problemas para entrar em contato comigo?",
"contactsSendEmail2": "Clique aqui para me enviar um e-mail!"
},
"Admin": {
"Login": {
Expand Down
4 changes: 3 additions & 1 deletion public/locales/ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"contactsMessage": "повідомлення",
"contactsMessageInp": "Напишіть повідомлення тут",
"contactsReset": "Скинути",
"contactsSubmit": "Надіслати"
"contactsSubmit": "Надіслати",
"contactsSendEmail": "Виникли проблеми зі мною зв'язатися?",
"contactsSendEmail2": "Натисніть тут, щоб надіслати мені електронний лист!"
},
"Admin": {
"Login": {
Expand Down
6 changes: 3 additions & 3 deletions src/app/[locale]/admin/dashboard/login.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import React, { useEffect, useState } from 'react';
import { useTranslations } from 'next-intl';
import { useLocale, useTranslations } from 'next-intl';
import Link from 'next/link';
import admstyles from '../../styles/admin/admin.module.scss';
import { doLogin } from '../../utils/authUtils';
Expand Down Expand Up @@ -45,7 +45,7 @@ export default function DashboardLogin() {
setIsLoggedIn(true);
setIsLoading(false);

location.href = "/admin/dashboard";
location.href = `/${localStorage.getItem("lang")}/admin/dashboard`;
}
}).catch((error) => console.error(error))
}
Expand Down Expand Up @@ -86,7 +86,7 @@ export default function DashboardLogin() {
</>
)}

<Link className='btn btn-primary btnBack' id='btnBack' dir="auto" href={"/"}>{t('btnBack')}</Link>
<Link className='btn btn-primary btnBack' id='btnBack' dir="auto" href={"/"+useLocale()}>{t('btnBack')}</Link>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/admin/newsletter/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function AdminNewsletterPage() {
<p className="hidden">{t('welcome', { 'username': username })}</p>
<h1 className='mt-3'><i className="bi bi-newspaper me-2"></i>{t('title')}</h1>
<p className='mt-3'>Lorem ipsum dolor sit amet consectetur adipisicing elit. Recusandae dolorem quas, distinctio asperiores mollitia ratione dignissimos cumque omnis reiciendis quos veritatis veniam ipsa. Velit illo adipisci, amet corrupti voluptatem laudantium.</p>
<a href='/admin/dashboard' className='btn btn-primary btnback mt-3'>{t('btnBack')}</a>
<a href={`/${localStorage.getItem("lang")}/admin/dashboard`} className='btn btn-primary btnback mt-3'>{t('btnBack')}</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/admin/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function AdminProjectsPage() {
<p className="hidden">{t('welcome', { 'username': username })}</p>
<h1 className='mt-3'><i className="bi bi-kanban me-2"></i>{t('title')}</h1>
<p className='mt-3'>Lorem ipsum dolor sit amet consectetur adipisicing elit. Recusandae dolorem quas, distinctio asperiores mollitia ratione dignissimos cumque omnis reiciendis quos veritatis veniam ipsa. Velit illo adipisci, amet corrupti voluptatem laudantium.</p>
<a href='/admin/dashboard' className='btn btn-primary btnback mt-3'>{t('btnBack')}</a>
<a href={`/${localStorage.getItem("lang")}/admin/dashboard`} className='btn btn-primary btnback mt-3'>{t('btnBack')}</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/admin/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function AdminSettingsPage() {
<p className="hidden">{t('welcome', { 'username': username })}</p>
<h1 className='mt-3'><i className="bi bi-gear me-2"></i>{t('title')}</h1>
<p className='mt-3'>Lorem ipsum dolor sit amet consectetur adipisicing elit. Recusandae dolorem quas, distinctio asperiores mollitia ratione dignissimos cumque omnis reiciendis quos veritatis veniam ipsa. Velit illo adipisci, amet corrupti voluptatem laudantium.</p>
<a href='/admin/dashboard' className='btn btn-primary btnback mt-3'>{t('btnBack')}</a>
<a href={`/${localStorage.getItem("lang")}/admin/dashboard`} className='btn btn-primary btnback mt-3'>{t('btnBack')}</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/admin/subscriptions/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default function AdminSubscriptionsPage() {

<div className="container mx-auto text-center mt-3">
<div className="col-12">
<a href='/admin/dashboard' className='btn btn-primary btnback'>{t('btnBack')}</a>
<a href={`/${localStorage.getItem("lang")}/admin/dashboard`} className='btn btn-primary btnback'>{t('btnBack')}</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/admin/users/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function AdminUsersPage() {
<p className="hidden">{t('welcome', { 'username': username })}</p>
<h1 className='mt-3'><i className="bi bi-people me-2"></i>{t('title')}</h1>
<p className='mt-3'>Lorem ipsum dolor sit amet consectetur adipisicing elit. Recusandae dolorem quas, distinctio asperiores mollitia ratione dignissimos cumque omnis reiciendis quos veritatis veniam ipsa. Velit illo adipisci, amet corrupti voluptatem laudantium.</p>
<a href='/admin/dashboard' className='btn btn-primary btnback mt-3'>{t('btnBack')}</a>
<a href={`/${localStorage.getItem("lang")}/admin/dashboard`} className='btn btn-primary btnback mt-3'>{t('btnBack')}</a>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/app/[locale]/components/admin/navbar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import React, { useState, useEffect } from 'react';
import { useTranslations } from 'next-intl';
import { useLocale, useTranslations } from 'next-intl';
import { doLogout } from '../../utils/authUtils';

export default function NavbarAdmin() {
Expand Down Expand Up @@ -33,7 +33,7 @@ export default function NavbarAdmin() {
setUserName("");
setIsLoggedIn(false);

location.href = "/admin";
location.href = `/${localStorage.getItem("lang")}/admin`;
}).catch((error) => console.error(error));
};

Expand All @@ -44,7 +44,7 @@ export default function NavbarAdmin() {
<button className="btn" type="button" data-bs-toggle="offcanvas" data-bs-target="#menuAdmDashLinks" aria-controls="menuAdmDashLinks">
<i className="bi bi-list"></i>
</button>
<a className="navbar-brand ms-3" href="/" dir="auto">LCP</a>
<a className="navbar-brand ms-3" href={`/${useLocale()}`} dir="auto">LCP</a>
<button className="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarAdmDash" aria-controls="navbarAdmDash" aria-expanded="false" aria-label="Toggle navigation" onClick={clickNav}>
<i className={`bi bi-${isCollapsed ? "x" : "three-dots"}`}></i>
</button>
Expand Down
13 changes: 7 additions & 6 deletions src/app/[locale]/components/admin/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import { usePathname } from 'next/navigation';
import { useTranslations } from 'next-intl';

export default function SidebarAdmin() {
const lang = localStorage.getItem("lang");
const t = useTranslations('Admin.Sidebar');

const pthname = usePathname();
const aryLinks = [
{ id: 1, name: t('sbaropt1'), href: "/admin/projects", icon: "bi-kanban" },
{ id: 2, name: t('sbaropt2'), href: "/admin/users", icon: "bi-people" },
{ id: 3, name: t('sbaropt3'), href: "/admin/newsletter", icon: "bi-newspaper" },
{ id: 4, name: t('sbaropt4'), href: "/admin/subscriptions", icon: "bi-inbox" },
{ id: 5, name: t('sbaropt5'), href: "/admin/settings", icon: "bi-gear" }
{ id: 1, name: t('sbaropt1'), href: `/${lang}/admin/projects`, icon: "bi-kanban" },
{ id: 2, name: t('sbaropt2'), href: `/${lang}/admin/users`, icon: "bi-people" },
{ id: 3, name: t('sbaropt3'), href: `/${lang}/admin/newsletter`, icon: "bi-newspaper" },
{ id: 4, name: t('sbaropt4'), href: `/${lang}/admin/subscriptions`, icon: "bi-inbox" },
{ id: 5, name: t('sbaropt5'), href: `/${lang}/admin/settings`, icon: "bi-gear" }
];

const [isCollapsed, setIsCollapsed] = useState(false);
Expand All @@ -27,7 +28,7 @@ export default function SidebarAdmin() {
<>
<div className={`offcanvas offcanvas-start ${!!isCollapsed ? "show sidebarCol" : "hiding"} ${admstyles.menuAdmDashLinks}`} tabIndex={-1} id="menuAdmDashLinks" aria-labelledby="menuAdmDashLinksLabel">
<div className="offcanvas-header">
<h5 className="offcanvas-title" id="menuAdmDashLinksLabel" dir="auto"><a href="/admin/dashboard">LCP</a></h5>
<h5 className="offcanvas-title" id="menuAdmDashLinksLabel" dir="auto"><a href={`/${lang}/admin/dashboard`}>LCP</a></h5>
<button type="button" className="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div className="offcanvas-body">
Expand Down
6 changes: 3 additions & 3 deletions src/app/[locale]/components/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ export default function ContactComponent() {
<form action="" method="post" className="container frmcontactus" id="frmcontactus" onSubmit={sendMail}>
<h1 className={styles.contactsTitle} dir="auto">{t('contactsTitle')}</h1>
<div className="row mt-3">
<div className="col-12 col-md-6">
<div className="col-12 col-md-6 mt-3">
<label htmlFor="name" dir="auto">{t('contactsName')}</label>
<input type="text" name="name" id="name" dir="auto" value={name} placeholder={t('contactsNameInp')} className="form-control name mt-1" required onChange={handleNameChange} />
</div>
<div className="col-12 col-md-6">
<div className="col-12 col-md-6 mt-3">
<label htmlFor="email" dir="auto">{t('contactsEmail')}</label>
<input type="email" name="email" id="email" dir="auto" value={email} placeholder={t('contactsEmailInp')} className="form-control email mt-1" required onChange={handleEmailChange} />
</div>
Expand All @@ -94,7 +94,7 @@ export default function ContactComponent() {
</div>
</form>
<div className={"mt-3 mx-auto " + styles.contactmsgblk}>
<p>Cannot contact to me? <a href="mailto:[email protected]">Click here to send email to me!</a></p>
<p>{t('contactsSendEmail')} <a href="mailto:[email protected]" className="cblack">{t('contactsSendEmail2')}</a></p>
</div>
</div>
</>
Expand Down
4 changes: 2 additions & 2 deletions src/app/[locale]/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export default function Header() {
<div className="row">
<div className="col-12 col-md-6 headersideleft mt-3 animate__animated animate__fadeInUp">
<h1 className={styles.mtitle} id="mtitle" dir="auto">LCP</h1>
<p className={styles.desc} dir="auto">
<p className={styles.desc} id="mdesc" dir="auto">
{t('desc')}
</p>
<a href="#features" className="btn btn-primary btnSeeMore" dir="auto">
<a href="#features" className="btn btn-primary btnSeeMore" id="btnSeeMore" dir="auto">
{t('btnSeeMore')}
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/[locale]/components/navbar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import React, { useState } from 'react';
import { useTranslations } from 'next-intl';
import { useLocale, useTranslations } from 'next-intl';

export default function Navbar() {
const t = useTranslations('Navbar');
Expand All @@ -15,7 +15,7 @@ export default function Navbar() {
<>
<nav className="navbar fixed-top navbar-expand-lg bg-body-tertiary mnavbar" id="mnavbar">
<div className="container-fluid">
<a className="navbar-brand" href="/">LCP</a>
<a className="navbar-brand" href={`/${useLocale()}`}>LCP</a>
<button className="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarLinks" aria-controls="navbarLinks" aria-expanded="false" aria-label="Toggle navigation" onClick={clickNav}>
<i className={`bi bi-${isCollapsed ? "x" : "three-dots"}`}></i>
</button>
Expand Down
Loading

0 comments on commit 893f799

Please sign in to comment.