Skip to content

Commit 49d7a92

Browse files
committed
[Add] Metadata and graphql
1 parent eb776e4 commit 49d7a92

File tree

5 files changed

+118
-38
lines changed

5 files changed

+118
-38
lines changed

public/metadata.png

17.4 KB
Loading
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { FunctionComponent, useEffect, useRef, useState } from 'react'
22
import Image from 'next/image';
33
import { QRCode } from 'react-qrcode-logo';
4-
import logo from '../../../../../public/logo.png';
4+
import logo from '../../../../public/logo.png';
55

66

77

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
"use client";
2+
3+
import { Inter } from "next/font/google";
4+
5+
6+
import { useEffect, useState } from "react";
7+
8+
import Link from "next/link";
9+
import { IoMdSettings } from "react-icons/io";
10+
import { MCDUContextProvider } from "@/app/context/mcduContext";
11+
import { SimbriefContextProvider } from "@/app/context/simbriefContext";
12+
import Footer from "./footer";
13+
import Titlebar from "./titlebar";
14+
15+
const inter = Inter({ subsets: ["latin"] });
16+
17+
interface WindowProps extends Window {
18+
__TAURI__?: boolean;
19+
}
20+
declare const window: WindowProps;
21+
22+
export default function Layout({
23+
children,
24+
}: Readonly<{
25+
children: React.ReactNode;
26+
}>) {
27+
28+
const [isTauri, setIsTauri] = useState<boolean>(false);
29+
30+
useEffect(() => {
31+
document.addEventListener('contextmenu', event => event.preventDefault());
32+
33+
if (window?.__TAURI__) {
34+
console.log('Tauri detected');
35+
setIsTauri(true);
36+
}
37+
}, []);
38+
39+
40+
return (
41+
<div className={` m-0 ${isTauri ? 'bg-transparent rounded-[40px] ' : 'bg-[#000000] bg-[radial-gradient(#ffffff33_1px,#ffffff10_1px)] bg-[size:20px_20px]'} overflow-hidden`}>
42+
<div style={{ height: isTauri ? '700px' : '100vh' }} className={`bg-[#000000] bg-[radial-gradient(#ffffff20_1px,#ffffff10_1px)] bg-[size:20px_20px] w-full ${isTauri ? 'h-[600px]' : 'h-screen'} flex justify-center items-center bordernone border-tertiary rounded-big`}>
43+
{isTauri && <div className='h-12 mb-8 block z-20'><Titlebar /></div>}
44+
{!isTauri &&<Link href={"/settings"} className="inline-flex z-50 fixed top-[20px] right-[20px] justify-center items-center w-[30px] h-[30px] cursor-pointer text-primary"><IoMdSettings/></Link>}
45+
<div className='w-full z-10 flex justify-center items-center h-full '>
46+
<SimbriefContextProvider>
47+
<MCDUContextProvider>
48+
{children}
49+
</MCDUContextProvider>
50+
</SimbriefContextProvider>
51+
</div>
52+
{isTauri && <Footer/>}
53+
</div>
54+
</div>
55+
);
56+
}

src/app/layout.tsx

Lines changed: 60 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,80 @@
1-
"use client";
21

32
import type { Metadata } from "next";
4-
import { Inter } from "next/font/google";
53
import "./globals.css";
6-
import Titlebar from "./components/layout/titlebar";
7-
import { MCDUContextProvider } from "./context/mcduContext";
8-
import { useEffect, useState } from "react";
9-
import Footer from "./components/layout/footer";
10-
import { SimbriefContextProvider } from "./context/simbriefContext";
11-
import Link from "next/link";
12-
import { IoMdSettings } from "react-icons/io";
4+
import Layout from "./components/layout/layout";
5+
import type { Viewport } from 'next'
136

14-
const inter = Inter({ subsets: ["latin"] });
157

16-
interface WindowProps extends Window {
17-
__TAURI__?: boolean;
8+
export const viewport: Viewport = {
9+
colorScheme: 'dark',
1810
}
19-
declare const window: WindowProps;
2011

12+
export const metadata: Metadata = {
13+
metadataBase: new URL("https://flightmetrics.vercel.app/"),
14+
title: "FlightMetrics - Your performance calculator",
15+
description:
16+
"TODO: Add description",
17+
generator: "Next.js",
18+
applicationName: "FlightMetrics",
19+
keywords: [
20+
"FlightMetrics",
21+
"FlightMetrics"
22+
],
23+
openGraph: {
24+
title: "FlightMetrics - Your performance calculator",
25+
description:
26+
"TODO: Add description",
27+
url: "https://flightmetrics.vercel.app/",
28+
siteName: "FlightMetrics",
29+
images: [
30+
{
31+
url: "./public/metadata.jpg",
32+
width: 1200,
33+
height: 630,
34+
alt: "FlightMetrics - Your performance calculator",
35+
},
36+
],
37+
locale: "en-US",
38+
type: "website",
39+
},
40+
twitter: {
41+
card: "summary_large_image",
42+
title: "FlightMetrics - Your performance calculator",
43+
description:
44+
"TODO : Add description",
45+
creator: "ZeroxyDev",
46+
creatorId: "0000000000",
47+
images: ["./public/metadata.jpg"],
48+
},
49+
robots: {
50+
index: true,
51+
follow: true,
52+
nocache: false,
53+
googleBot: {
54+
index: true,
55+
follow: false,
56+
noimageindex: true,
57+
"max-video-preview": -1,
58+
"max-image-preview": "large",
59+
"max-snippet": -1,
60+
},
61+
},
62+
category: "service",
63+
};
2164

2265
export default function RootLayout({
2366
children,
2467
}: Readonly<{
2568
children: React.ReactNode;
2669
}>) {
27-
28-
const [isTauri, setIsTauri] = useState<boolean>(false);
29-
30-
useEffect(() => {
31-
document.addEventListener('contextmenu', event => event.preventDefault());
32-
33-
if (window?.__TAURI__) {
34-
console.log('Tauri detected');
35-
setIsTauri(true);
36-
}
37-
}, []);
70+
3871

3972
return (
4073
<html lang="en">
41-
<body className={`rounded-[40px] m-0 ${isTauri ? 'bg-transparent' : 'bg-[#000000] bg-[radial-gradient(#ffffff33_1px,#ffffff10_1px)] bg-[size:20px_20px]'} overflow-hidden`}>
42-
<div style={{ height: isTauri ? '700px' : '100vh' }} className={`bg-[#000000] bg-[radial-gradient(#ffffff20_1px,#ffffff10_1px)] bg-[size:20px_20px] w-full ${isTauri ? 'h-[600px]' : 'h-screen'} flex justify-center items-center bordernone border-tertiary rounded-big`}>
43-
{isTauri && <div className='h-12 mb-8 block z-20'><Titlebar /></div>}
44-
{!isTauri &&<Link href={"/settings"} className="inline-flex z-50 fixed top-[20px] right-[20px] justify-center items-center w-[30px] h-[30px] cursor-pointer text-primary"><IoMdSettings/></Link>}
45-
<div className='w-full z-10 flex justify-center items-center h-full '>
46-
<SimbriefContextProvider>
47-
<MCDUContextProvider>
74+
<body className="bg-transparent">
75+
<Layout>
4876
{children}
49-
</MCDUContextProvider>
50-
</SimbriefContextProvider>
51-
</div>
52-
{isTauri && <Footer/>}
53-
</div>
77+
</Layout>
5478
</body>
5579
</html>
5680
);

src/app/welcome/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useState, useEffect } from 'react';
44
import HighlightButton from '../UI/buttons/highlight-button';
55
import DownloadButton from '../UI/buttons/downloadButton';
66
import generalSettings from '@/config/general';
7-
import QRGen from '../UI/buttons/QR/generateQR';
7+
import QRGen from '../UI/QR/generateQR';
88

99
interface WindowProps extends Window {
1010
__TAURI__?: boolean;

0 commit comments

Comments
 (0)