Skip to content

Commit

Permalink
Merge branch 'main' of github.com:NTNU-SmallSat-Lab/outreach-website
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasKnudsen committed Apr 11, 2024
2 parents cecd864 + c6670d6 commit 8735f78
Show file tree
Hide file tree
Showing 16 changed files with 407 additions and 92 deletions.
2 changes: 1 addition & 1 deletion frontend/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const nextConfig = {
{
protocol: "http",
hostname: "web.hypso.ies.ntnu.no",
port: '1337'
port: "1337",
},
{
protocol: "http",
Expand Down
57 changes: 52 additions & 5 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@turf/turf": "^6.5.0",
"@visx/geo": "^3.5.0",
"@visx/scale": "^3.5.0",
"@visx/shape": "^3.5.0",
"add": "^2.0.6",
"chart.js": "^4.4.1",
"chartjs-adapter-luxon": "^1.3.1",
Expand Down
27 changes: 18 additions & 9 deletions frontend/src/app/blog/[articleSlug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { BlocksContent } from "@strapi/blocks-react-renderer";
import BlockRendererClient from "@/components/BlockRendererClient";
import { gql } from "@/__generated__/gql";
import { getClient } from "@/lib/ApolloClient";
import { AvatarImageFix } from "@/components/AvatarImageFix";
import ShareButtons from "@/components/ShareButtons";
import NextImage from "next/image";

const STRAPI_URL = process.env.STRAPI_URL;

Expand Down Expand Up @@ -92,14 +92,23 @@ export default async function Page({
<div className="flex flex-1 justify-start gap-1">
{avatarURL && (
<Avatar className="">
<AvatarImageFix src={avatarURL} alt="Avatar" />
<AvatarFallback>
{// Get initials from author name
authorName
?.split(" ")
.map((name: any) => name[0])
.join("")}
</AvatarFallback>
{avatarURL && (
<NextImage
src={avatarURL}
alt="Avatar Image"
width={50}
height={50}
/>
)}
{!avatarURL && (
<AvatarFallback>
{// Get initials from author name
authorName
?.split(" ")
.map((name: any) => name[0])
.join("")}
</AvatarFallback>
)}
</Avatar>
)}
<div className="flex flex-col justify-center">
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { ApolloWrapper } from "@/components/wrappers/ApolloWrapper";
const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "NTNU SmallSat Lab",
description: "NTNU Small Satellite Lab",
};

import ErrorBoundaryNavigation from "@/components/ErrorBoundaryNavigation";
Expand Down
80 changes: 55 additions & 25 deletions frontend/src/app/satellites/[satelliteSlug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import BlockRendererClient from "@/components/BlockRendererClient";
import fetchSatelliteInfo from "@/lib/data/fetchSatelliteInfo";
import { BlocksContent } from "@strapi/blocks-react-renderer";
import RelatedProjectsAndSatellites from "@/components/RelatedProjectsAndSatellites";
import SatelliteDataHome from "@/components/satelliteData/SatelliteDataHome";
import Map2d from "@/components/2dmap/Map2d";
import { useSatelliteStore } from "@/lib/store";
import SolarDataComponent from "@/components/SolarActivity/SolarData";
import SatelliteDataHome from "@/components/satelliteData/SatelliteDataHome";

function setSelectedSatelliteSlug(satelliteSlug: string) {
const setSelectedSatellite =
useSatelliteStore.getState().setSelectedSatellite;
Expand Down Expand Up @@ -39,31 +40,60 @@ export default async function SatelliteInfoPage({
if (!satelliteInfo) return <div>Loading...</div>;

return (
<>
<SolarDataComponent></SolarDataComponent>
<div className="my-12 flex min-h-screen items-center justify-center">
<div className="flex w-2/3 flex-col">
<div className="flex w-full flex-col items-center border-2 border-gray-600 bg-black p-4">
{/* Container for satname, stats and sat image */}
<div className="flex w-full flex-col bg-gray-600 p-0.5 xl:flex-row">
{/* Stats Container */}
<div className="z-10 flex w-full flex-col">
<div className="bg-black p-5">
<h1 className="text-xl font-bold tracking-wide">
{satelliteInfo.name}
</h1>
</div>
<div className="mt-0.5">
<SatelliteDataHome />
</div>
</div>

{/* Image container */}
<div className="z-0 ml-0.5 w-full">
<div className="flex h-full w-full items-center justify-center bg-black">
<h1>Satellite Image</h1>
</div>
</div>
</div>

{/* Container for map */}
<div className="mt-6 w-full">
<Map2d satName={satelliteInfo.name} />
</div>

{/* Container for body content */}
<div className="mt-6">
<BlockRendererClient content={satelliteInfo.content} />
</div>
</div>

{/* Related projects */}
<div className="mt-8 flex w-full flex-col items-center border-2 border-gray-600 bg-black p-4">
{satelliteInfo.relatedProjects?.length != 0 ? (
<h1 className="text-xl font-bold">Related Projects</h1>
) : null}

<div className="flex flex-col items-center">
<h1 className="mt-4 text-2xl font-bold">
{satelliteInfo.name}
</h1>
<SatelliteDataHome />
<BlockRendererClient content={satelliteInfo.content} />
{satelliteInfo.relatedProjects?.length ? (
<h1 className="mb-2 mt-2 text-xl font-bold">
Related Projects
</h1>
) : null}
<div className="mx-10 mt-4 flex flex-wrap justify-center gap-4 md:justify-start">
{satelliteInfo.relatedProjects?.map(
(project: ProjectOrSatellite) => (
<RelatedProjectsAndSatellites
project={project}
key={project.id}
/>
),
)}
<div className="mx-10 mt-4 flex flex-wrap justify-center gap-4 md:justify-start">
{satelliteInfo.relatedProjects?.map(
(project: ProjectOrSatellite) => (
<RelatedProjectsAndSatellites
project={project}
key={project.id}
/>
),
)}
</div>
</div>
</div>
</>
</div>
);
}
Loading

0 comments on commit 8735f78

Please sign in to comment.