Skip to content

Commit

Permalink
new version without SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarra committed Jun 10, 2024
1 parent 45c86df commit dba4c40
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
15 changes: 11 additions & 4 deletions app/layout.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
"use client"
"use client";

import { Montserrat } from "next/font/google";
import './sass/main.scss';
import "./globals.sass";
// import 'bootstrap/dist/css/bootstrap.min.css';
import { useState, useEffect } from "react";

// import i18n (needs to be bundled ;))
import './i18n';

const montserrat = Montserrat({ subsets: ["latin"] });

export default function RootLayout({ children }) {
//disable SSR whole project, this will make the project to be rendered only on client side
const [isClient, setIsClient] = useState(false)

useEffect(() => {
setIsClient(true)
}, [])

return (
<html lang="en">
<body className={montserrat.className}>{children}</body>
<html hola="bye">
<body className={montserrat.className}>{isClient ? children:null}</body>
</html>
);
}
4 changes: 2 additions & 2 deletions app/tools/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ export default function Tools(props) {
{tools.map(
({ title, description, route, logo, github, gradient }) => {
return (
<div className="tool">
<div className="tool" key={title}>
<div className={`tool_logo ${gradient}`}>
<img alt={"Project Logo"} src={logo} />
</div>

<div class="tool_content">
<div className="tool_content">
<div className="tool_title">
<h3>{title}</h3>
</div>
Expand Down
3 changes: 2 additions & 1 deletion components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from "@fortawesome/free-brands-svg-icons";
import { useTranslation } from "react-i18next";


export default function Footer(props) {
const { t } = useTranslation();
const routes = [
Expand Down Expand Up @@ -59,7 +60,7 @@ export default function Footer(props) {
: "text-left mb-2 font-medium"
}
>
<Link suppressHydrationWarning className="font-medium" href={route.route}>
<Link className="font-medium" href={route.route}>
{t(route.key)}
</Link>
</li>
Expand Down
2 changes: 1 addition & 1 deletion components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default function Header(props) {
key={index}
className={route.route === props.route ? "li-selected" : ""}
>
<Link href={route.route} suppressHydrationWarning >{t(route.key)}</Link>
<Link href={route.route} >{t(route.key)}</Link>
</li>
))}
</ul>
Expand Down
2 changes: 2 additions & 0 deletions components/RecentPublications.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import React from "react";
import Link from "next/link";
import { useState, useEffect } from "react";
Expand Down

0 comments on commit dba4c40

Please sign in to comment.