diff --git a/public/pages/faq/faq.png b/public/pages/faq/faq.png new file mode 100644 index 00000000..95955b15 Binary files /dev/null and b/public/pages/faq/faq.png differ diff --git a/public/svg/button-minus.svg b/public/svg/button-minus.svg new file mode 100644 index 00000000..e543fb2d --- /dev/null +++ b/public/svg/button-minus.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/public/svg/button-plus.svg b/public/svg/button-plus.svg new file mode 100644 index 00000000..febfa644 --- /dev/null +++ b/public/svg/button-plus.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index a7a9c9b6..c80126c6 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -11,7 +11,7 @@ export enum ButtonType { export interface ButtonProps { theme?: 'primary' | 'secondary' | 'positive' | 'caution' | 'danger' | 'discord'; - label: string | JSX.Element; + label?: string | JSX.Element; disabled?: boolean; className?: string; onClick?: () => void; @@ -49,8 +49,9 @@ const Button: FC = ({ } return ( - - {children || label} + + {label} + {children} ); }; diff --git a/src/components/Discord/Discord.tsx b/src/components/Discord/Discord.tsx index 76623b08..0e17d465 100644 --- a/src/components/Discord/Discord.tsx +++ b/src/components/Discord/Discord.tsx @@ -1,22 +1,23 @@ import Image from 'next/legacy/image'; +import Link from 'next/link'; import Button from '../Button/Button'; import { links } from '../../constants/links'; const Discord = () => ( - + Discord Join us to chat with other members of the community, get started with contributing, or ask us a question! - - + ); diff --git a/src/components/Downloads/DownloadLinks.tsx b/src/components/Downloads/DownloadLinks.tsx index ba06067c..e000ef8f 100644 --- a/src/components/Downloads/DownloadLinks.tsx +++ b/src/components/Downloads/DownloadLinks.tsx @@ -1,19 +1,30 @@ +import Link from 'next/link'; import Button from '../Button/Button'; type DownloadProps = { - stableLink: string, - devLink: string, + stableLink?: string, + devLink?: string, aircraft: string, } -const downloadLinks = ({ aircraft }: DownloadProps) => ( +const downloadLinks = ({ stableLink, devLink, aircraft }: DownloadProps) => ( {aircraft} - - - - + {stableLink && devLink ? ( + <> + + + Stable + + + Development + + + > + ) : ( + Use our installer to download. + )} ); diff --git a/src/components/Faqs/Faqs.tsx b/src/components/Faqs/Faqs.tsx new file mode 100644 index 00000000..c3c93391 --- /dev/null +++ b/src/components/Faqs/Faqs.tsx @@ -0,0 +1,33 @@ +import { useState } from 'react'; +import Image from 'next/legacy/image'; + +type FaqsProps = { + question: string, + response?: string, +} + +// @TODO expand to see response functionality + +const Faqs = ({ question }: FaqsProps) => { + const [isToggled, setIsToggled] = useState(false); + + const onToggle = () => { + if (isToggled) { + setIsToggled(false); + } else { + setIsToggled(true); + } + }; + + return ( + + {question} + {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */} + + + + + ); +}; + +export default Faqs; diff --git a/src/components/Navigation/Footer.tsx b/src/components/Navigation/Footer.tsx index 54eae711..5b1ff5f8 100644 --- a/src/components/Navigation/Footer.tsx +++ b/src/components/Navigation/Footer.tsx @@ -50,6 +50,7 @@ const Footer = () => ( + diff --git a/src/components/Notam/Card.tsx b/src/components/Notam/Card.tsx index a6b39c36..650db7dc 100644 --- a/src/components/Notam/Card.tsx +++ b/src/components/Notam/Card.tsx @@ -3,7 +3,7 @@ import Image from "next/legacy/image"; import Tag from '../Utils/Tag'; import { PostListing } from '../../lib/notams/posts'; -const Card = (props: PostListing) => ( +const Card = (props: Omit) => ( - - - + {href !== undefined && ( + + Learn More + + )} {downloadURL && ( <> - } theme="primary" className="flex max-w-min items-center justify-center" disabled={disabled} /> + } theme="primary" className="flex max-w-min items-center justify-center" disabled={disabled}>Download > )} diff --git a/src/components/Utils/Tag.tsx b/src/components/Utils/Tag.tsx index 6b21a307..ecacc230 100644 --- a/src/components/Utils/Tag.tsx +++ b/src/components/Utils/Tag.tsx @@ -1,13 +1,15 @@ import { twMerge } from 'tailwind-merge'; -type TagType = 'Update' | 'News' | 'Aircraft' | 'Software' | 'Latest' +export type TagType = 'Update' | 'News' | 'Aircraft' | 'Software' | 'Latest' export interface TagProps { - category: TagType; + category: AnyTag; className?: string; } -const handleCategory = (category: TagType) => { +export type AnyTag = TagType | Uppercase | Lowercase + +const handleCategory = (category: AnyTag) => { switch (category.toLowerCase() as Lowercase) { case 'update': return 'border-yellow-500 bg-yellow-500/20 text-yellow-500'; diff --git a/src/constants/frequentlyAsked.ts b/src/constants/frequentlyAsked.ts new file mode 100644 index 00000000..6a6ba496 --- /dev/null +++ b/src/constants/frequentlyAsked.ts @@ -0,0 +1,8 @@ +export const frequentlyAsked = [ + { question: 'When Will the Project be Released?', response: 'When it is ready' }, + { question: 'What is the meaning of life?', response: 'Lorem Ipsum' }, + { question: 'What is the meaning of life?', response: 'Lorem Ipsum' }, + { question: 'What is the meaning of life?', response: 'Lorem Ipsum' }, + { question: 'What is the meaning of life?', response: 'Lorem Ipsum' }, + { question: 'What is the meaning of life?', response: 'Lorem Ipsum' }, +]; diff --git a/src/constants/links.ts b/src/constants/links.ts index 9c87c939..a1fa3ead 100644 --- a/src/constants/links.ts +++ b/src/constants/links.ts @@ -6,4 +6,5 @@ export const links: {[name: string]: string} = { twitter: 'https://x.com/flybywiresim', facebook: 'https://www.facebook.com/FlyByWireSimulations/', opencollective: 'https://opencollective.com/flybywire', + docsfaq: 'https://docs.flybywiresim.com/faq', }; diff --git a/src/layouts/landing/Hero.tsx b/src/layouts/landing/Hero.tsx index 8f49e610..db62ecd9 100644 --- a/src/layouts/landing/Hero.tsx +++ b/src/layouts/landing/Hero.tsx @@ -33,7 +33,6 @@ const Hero = () => { router.push('/downloads')} /> - router.push('/projects/a32nx')} /> diff --git a/src/layouts/landing/Insights.tsx b/src/layouts/landing/Insights.tsx index 7a32c8b8..1794e621 100644 --- a/src/layouts/landing/Insights.tsx +++ b/src/layouts/landing/Insights.tsx @@ -59,7 +59,7 @@ const Insights = () => { - + diff --git a/src/layouts/landing/Installer.tsx b/src/layouts/landing/Installer.tsx index 4d040201..5023c07e 100644 --- a/src/layouts/landing/Installer.tsx +++ b/src/layouts/landing/Installer.tsx @@ -1,29 +1,30 @@ +import { useRouter } from 'next/router'; import Section from '../../components/Utils/Section'; import Container from '../../components/Utils/Container'; import Button from '../../components/Button/Button'; -import { useRouter } from "next/router"; const Installer = () => { const router = useRouter(); return ( - - - - - Custom-built Installer - - Our custom-built, open-source installer is where we keep our projects for you to easily install. - - router.push('/downloads')}/> + + + + + Custom-built Installer + + Our custom-built, open-source installer is where we keep our projects for you to easily install. + + router.push('/downloads')} /> + - - {/* TODO: Change placeholder image */} - - - - - -)}; + {/* TODO: Change placeholder image */} + + + + + + ); +}; export default Installer; diff --git a/src/lib/notams/posts.ts b/src/lib/notams/posts.ts index 0222efd6..e62b65ea 100644 --- a/src/lib/notams/posts.ts +++ b/src/lib/notams/posts.ts @@ -9,6 +9,7 @@ import rehypeSlug from 'rehype-slug-custom-id'; import { remark } from 'remark'; import { rehype } from 'rehype'; import { slug } from 'github-slugger'; +import { TagType } from '../../components/Utils/Tag'; export interface PostListing { index: number; @@ -18,7 +19,8 @@ export interface PostListing { title: string, description: string, authors?: string[], - category: string, + category: TagType | Uppercase | Lowercase, + embedPreviewImage: string, metaImage: string, metaAlt: string, } diff --git a/src/lib/notams/preview.html b/src/lib/notams/preview.html new file mode 100644 index 00000000..8cc8a6ed --- /dev/null +++ b/src/lib/notams/preview.html @@ -0,0 +1,150 @@ + + + + + + + + + Title + + + + + {{category}} + {{readingStats}} + + {{title}} + Written by {{authors}} + Posted: {{date}} + + + + + + + diff --git a/src/pages/downloads/index.tsx b/src/pages/downloads/index.tsx index d6b94a34..4ab2681f 100644 --- a/src/pages/downloads/index.tsx +++ b/src/pages/downloads/index.tsx @@ -1,4 +1,5 @@ import { NextPage } from 'next'; +import Link from 'next/link'; import Section from '../../components/Utils/Section'; import Container from '../../components/Utils/Container'; import Button from '../../components/Button/Button'; @@ -24,7 +25,9 @@ const Downloads: NextPage = () => ( Our easy-to-use installer is the easiest way to get started with our addons. Simply launch and install any addon you want, with only two clicks. - + + + @@ -33,7 +36,11 @@ const Downloads: NextPage = () => ( Direct Download If you prefer a direct download, the following links are available. - + diff --git a/src/pages/faq/index.tsx b/src/pages/faq/index.tsx new file mode 100644 index 00000000..dace13b3 --- /dev/null +++ b/src/pages/faq/index.tsx @@ -0,0 +1,38 @@ +import { NextPage } from 'next'; +import Image from 'next/legacy/image'; +import Section from '../../components/Utils/Section'; +import Container from '../../components/Utils/Container'; +import Faqs from '../../components/Faqs/Faqs'; +import { frequentlyAsked } from '../../constants/frequentlyAsked'; + +const BackgroundImage = () => ( + + + +); + +const FAQ: NextPage = () => ( + <> + + + + + Looking for some help? + + We have you covered! Below we have a wide coverage of frequently asked questions, along with + each of their answers + + + + + + + {frequentlyAsked.map((faq, index) => ( + + ))} + + + > +); + +export default FAQ; diff --git a/src/pages/notams/[id].tsx b/src/pages/notams/[id].tsx index 86c03fde..d2b84bb8 100644 --- a/src/pages/notams/[id].tsx +++ b/src/pages/notams/[id].tsx @@ -1,18 +1,25 @@ import { GetStaticPaths, GetStaticProps } from 'next'; -import Image from 'next/legacy/image'; +import Image from 'next/image'; import Head from 'next/head'; import { twMerge } from 'tailwind-merge'; +import nodeHtmlToImage from 'node-html-to-image'; +import fs from 'fs'; +import { v4 } from 'uuid'; import Section from '../../components/Utils/Section'; import { getAllPostIds, getPostContent, PostContent } from '../../lib/notams/posts'; import Container from '../../components/Utils/Container'; import Tag from '../../components/Utils/Tag'; +const NOTAMS_EMBED_PREVIEWS_DIR = 'public/img/notams-embed-previews'; +const NOTAMS_EMBED_PREVIEWS_PUBLIC_DIR = 'img/notams-embed-previews'; + export type PostProps = { content: PostContent } const Post = ({ content: { category, title, + embedPreviewImage, metaImage, metaAlt, readingStats, @@ -29,26 +36,18 @@ const Post = ({ {' '} - FlyByWire Simulations - - - - + + + + + + + + + + + + @@ -62,7 +61,7 @@ const Post = ({ /> - + {new Date(date).toLocaleDateString('en-US', { dateStyle: 'full' })} @@ -81,9 +80,9 @@ const Post = ({ - + -
Join us to chat with other members of the community, get started with contributing, or ask us a question!
Use our installer to download.
- Our custom-built, open-source installer is where we keep our projects for you to easily install. -
+ Our custom-built, open-source installer is where we keep our projects for you to easily install. +
If you prefer a direct download, the following links are available.
+ We have you covered! Below we have a wide coverage of frequently asked questions, along with + each of their answers +
{new Date(date).toLocaleDateString('en-US', { dateStyle: 'full' })} @@ -81,9 +80,9 @@ const Post = ({ - + -