Skip to content

Commit

Permalink
Fix featured projects preview image bug, prettier checked (#422)
Browse files Browse the repository at this point in the history
* Fetching data from Space-Track, fixing some bugs, adding cron tasks for updating database with tool functions

* Orbital chart done, using backend data without refetching from the backend server

* Clean code of orbitalDataGraph, restore strapi files, adding cronTask to the 3rd of each month.

* Adding package*.json files

* ESLint fixed

* Updating strapi env

* Reseting frontend/package.json

* Prettier checked

* Updating for ESlint check

* Try fixing cron job, error caused by Strapi reloading after updating db

* Fix cron jobs issue and update Footer info

* Fixing not available satellites

* Fix FeaturedProjects preview images bug

* Prettier updated
  • Loading branch information
Graulitard committed Aug 14, 2024
1 parent ea768b3 commit 59a3432
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
17 changes: 8 additions & 9 deletions frontend/src/app/_homeComponents/FeaturedProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ export default async function FeaturedProjects() {
featuredProjects?.featuredProject3,
];

let image_url = undefined;
if (STRAPI_URL) {
image_url =
STRAPI_URL +
featuredProjects?.featuredProject1?.data?.attributes?.previewImage
?.data?.attributes?.url;
}

return (
<PagePaddingOnlyHorizontal>
<div className="mb-16 flex w-full flex-col justify-center gap-2">
Expand All @@ -50,6 +42,13 @@ export default async function FeaturedProjects() {
if (!project?.data?.attributes?.title) {
return null;
}
let previewImage =
project?.data?.attributes?.previewImage?.data
?.attributes?.url;

if (STRAPI_URL && previewImage != undefined) {
previewImage = STRAPI_URL + previewImage;
}
return (
<CardWithContent
key={index.toString()}
Expand All @@ -58,7 +57,7 @@ export default async function FeaturedProjects() {
"/projects/" +
project?.data?.attributes?.slug
}
imageURL={image_url}
imageURL={previewImage}
></CardWithContent>
);
})}
Expand Down
22 changes: 14 additions & 8 deletions frontend/src/app/satellites/SatelliteResponsiveTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,20 @@ export default function SatelliteResponsiveTable({
/>
))
: (satellites ?? []).map((satellite) => (
<TableRow
className="cursor-pointer hover:bg-white hover:text-black"
key={satellite.attributes?.catalogNumberNORAD}
{...(satellite.attributes?.catalogNumberNORAD ? {
onClick: () =>
handleRowClick(satellite.attributes?.slug ?? "")
} : {})}
>
<TableRow
className="cursor-pointer hover:bg-white hover:text-black"
key={satellite.attributes?.catalogNumberNORAD}
{...(satellite.attributes?.catalogNumberNORAD
? {
onClick: () =>
handleRowClick(
satellite.attributes
?.slug ?? "",
),
}
: {})}
>

<TableCell className="px-6">
{satellite.attributes?.name}
</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,14 @@ const OrbitDataGraph: React.FC<OrbitDataProps> = ({
<>
{orbitalData && (
<div ref={svgContainer} className="flex w-full flex-col">
<div className="flex mb-5">
<div className="mb-5 flex">
<p>Orbital parameters history (source :</p>
<a className="hover:underline" href="https://www.space-track.org/">Space Track</a>
<a
className="hover:underline"
href="https://www.space-track.org/"
>
Space Track
</a>
<p>)</p>
</div>
<div className="zoom-container mb-5 flex items-center">
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ export default function Footer() {

<div className="flex flex-1 justify-end">
<div className="flex flex-col text-center lg:text-right">
<a className="hover:underline" href="http://ntnu.edu/smallsat">NTNU Small Satellite Lab</a>
<a
className="hover:underline"
href="http://ntnu.edu/smallsat"
>
NTNU Small Satellite Lab
</a>
<span className="">Trondheim, Norway</span>
<p>Norwegian University of Science and Technology</p>
<p className="lg:hidden">
Expand Down

0 comments on commit 59a3432

Please sign in to comment.