Skip to content

Commit

Permalink
chore: update to astro 3 (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
pReya authored Oct 7, 2023
1 parent 826f715 commit 4dd880d
Show file tree
Hide file tree
Showing 15 changed files with 2,949 additions and 2,416 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.8.0
v20.8
5,273 changes: 2,906 additions & 2,367 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
"scripts": {
"dev": "astro dev --host",
"start": "astro dev",
"build": "astro build --experimental-static-build",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"devDependencies": {
"@astrojs/mdx": "^0.19.7",
"@astrojs/react": "^2.2.1",
"@astrojs/tailwind": "^4.0.0",
"@tailwindcss/typography": "^0.5.9",
"@types/node": "^20.4.9",
"astro": "^2.10.5",
"embla-carousel-react": "^7.0.9",
"@astrojs/mdx": "^1.1.1",
"@astrojs/react": "^3.0.3",
"@astrojs/tailwind": "^5.0.1",
"@tailwindcss/typography": "^0.5.10",
"@types/node": "^20.8.3",
"astro": "^3.2.3",
"embla-carousel-react": "^7.1.0",
"github-slugger": "^2.0.0",
"mapbox-gl": "^2.15.0",
"react-dom": "^18.2.0",
"react-map-gl": "^7.1.3",
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.1.0",
"react-map-gl": "^7.1.6",
"rehype-autolink-headings": "^7.0.0",
"rehype-slug": "^6.0.0",
"tailwindcss": "^3.3.3",
"vite-plugin-svgr": "^3.2.0"
"vite-plugin-svgr": "^3.3.0"
}
}
File renamed without changes
26 changes: 13 additions & 13 deletions src/components/HeadlineUnderlined.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Underline5Svg from "@assets/tolocar_underline_5.svg";
import Underline6Svg from "@assets/tolocar_underline_6.svg";
import Underline7Svg from "@assets/tolocar_underline_7.svg";
import Underline8Svg from "@assets/tolocar_underline_8.svg";
import CircularUnderlineSvg from "@assets/tolocar_circular_underline.svg";
import Underline9Svg from "@assets/tolocar_underline_9.svg";
import CircularUnderlineSvg from "@assets/tolocar_circular_underline.svg";

interface Props {
children: React.ReactNode;
Expand All @@ -20,20 +20,20 @@ interface Props {
}

const underlineSvgAndClassesMapping = [
{ src: Underline1Svg, classes: "-bottom-3" },
{ src: Underline2Svg, classes: "-bottom-3" },
{ src: Underline3Svg, classes: "bottom-0" },
{ src: Underline4Svg, classes: "-bottom-4" },
{ src: Underline5Svg, classes: "-bottom-1" },
{ src: Underline6Svg, classes: "bottom-0" },
{ src: Underline7Svg, classes: "bottom-0" },
{ src: Underline8Svg, classes: "bottom-0" },
{ component: Underline1Svg, classes: "-bottom-3" },
{ component: Underline2Svg, classes: "-bottom-3" },
{ component: Underline3Svg, classes: "bottom-0" },
{ component: Underline4Svg, classes: "-bottom-4" },
{ component: Underline5Svg, classes: "-bottom-1" },
{ component: Underline6Svg, classes: "bottom-0" },
{ component: Underline7Svg, classes: "bottom-0" },
{ component: Underline8Svg, classes: "bottom-0" },
{
src: CircularUnderlineSvg,
component: CircularUnderlineSvg,
classes:
"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-x-125 scale-y-105 lg:scale-100",
},
{ src: Underline9Svg, classes: "bottom-0" },
{ component: Underline9Svg, classes: "bottom-0" },
];

const HeadlineUnderlined: React.FC<Props> = ({
Expand All @@ -56,9 +56,9 @@ const HeadlineUnderlined: React.FC<Props> = ({
>
<img
className={`-z-10 absolute ${
underlineSvgAndClassesMapping[variant - 1].classes
underlineSvgAndClassesMapping?.[variant - 1]?.classes
}`}
src={underlineSvgAndClassesMapping[variant - 1].src}
src={underlineSvgAndClassesMapping?.[variant - 1]?.component?.src}
/>
{children}
</h2>
Expand Down
2 changes: 1 addition & 1 deletion src/components/InterventionMap.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from "react";
import Map, { Marker, NavigationControl, Popup } from "react-map-gl";
import { ReactComponent as ArrowIcon } from "@assets/arrow.svg";
import { IInterventionPoi } from "@interfaces/IIntervention";
import type { IInterventionPoi } from "@interfaces/IIntervention";
import useWindowSize from "../util/useWindowSize";

const InterventionMap = ({
Expand Down
5 changes: 1 addition & 4 deletions src/components/InterventionsMapDataWrapper.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---
import {
IInterventionFrontmatter,
IInterventionPoi,
} from "@interfaces/IIntervention";
import type { IInterventionFrontmatter } from "@interfaces/IIntervention";
import { InterventionMap } from "@components";
import "mapbox-gl/dist/mapbox-gl.css";
import mapbox from "mapbox-gl";
Expand Down
2 changes: 1 addition & 1 deletion src/components/InterventionsMapSection.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { IInterventionFrontmatter } from "@interfaces/IIntervention";
import type { IInterventionFrontmatter } from "@interfaces/IIntervention";
import {
InterventionPreviewCard,
ButtonLink,
Expand Down
2 changes: 1 addition & 1 deletion src/components/NewsSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { NewsItem } from "@components";
import { ReactComponent as ArrowIcon } from "@assets/arrow.svg";
import { ReactComponent as InstagramIcon } from "@assets/instagram.svg";
import { ReactComponent as FacebookIcon } from "@assets/facebook.svg";
import { INewsItem } from "@interfaces/INews";
import type { INewsItem } from "@interfaces/INews";

interface Props {
news: Array<INewsItem>;
Expand Down
7 changes: 2 additions & 5 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
import type { MarkdownLayoutProps } from "astro";
import { Navigation, Footer } from "@components";
import TolocarFavicon from "../assets/favicon.png";
import CommonUtils from "@util/CommonUtils";
import type { IMenuMarkdown } from "@interfaces/IMenu";
import "../../base.css";
Expand Down Expand Up @@ -45,7 +44,7 @@ const isProduction = import.meta.env.MODE === "production";
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href={TolocarFavicon} />
<link rel="icon" type="image/png" href={"/favicon.png"} />
<meta name="generator" content={Astro.generator} />
<meta
name="description"
Expand Down Expand Up @@ -79,9 +78,7 @@ const isProduction = import.meta.env.MODE === "production";
<Footer
locale={localeFromUrl}
menu={translatedAndRebasedMenu}
className={frontmatter?.footerGrey
? "!bg-neutral-50"
: ""}
className={frontmatter?.footerGrey ? "!bg-neutral-50" : ""}
/>
</main>
</body>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/InterventionIndex.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import BaseLayout from "./BaseLayout.astro";
import { IInterventionFrontmatter } from "@interfaces/IIntervention";
import type { IInterventionFrontmatter } from "@interfaces/IIntervention";
import {
ContentSection,
Card,
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/InterventionSingleView.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import BaseLayout from "./BaseLayout.astro";
import { IInterventionFrontmatter } from "@interfaces/IIntervention";
import type { IInterventionFrontmatter } from "@interfaces/IIntervention";
import {
ContentSection,
InterventionImageCarousel,
Expand Down
8 changes: 4 additions & 4 deletions src/pages/en/academy/3dmodels/3dmodelsinternet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Depending on which rights you want to grant, there are different CC rights modul

| Icon | Abbreviation | Module name | Explanation |
| - | - | - | - |
| ![grafik](images/academy/3dmodels/3dmodelsinternet/1_BY.png) | BY | Attribution | The name of the author must be mentioned. |
| ![grafik](images/academy/3dmodels/3dmodelsinternet/2_NC.png) | NC | Non-Commercial | The work may not be used for commercial purposes. |
| ![grafik](images/academy/3dmodels/3dmodelsinternet/3_ND.png) | ND | No Derivatives | The work must not be altered. |
| ![grafik](images/academy/3dmodels/3dmodelsinternet/4_SA.png) | SA | Share Alike | The work must be redistributed under the same license after modifications. |
| ![grafik](/images/academy/3dmodels/3dmodelsinternet/1_BY.png) | BY | Attribution | The name of the author must be mentioned. |
| ![grafik](/images/academy/3dmodels/3dmodelsinternet/2_NC.png) | NC | Non-Commercial | The work may not be used for commercial purposes. |
| ![grafik](/images/academy/3dmodels/3dmodelsinternet/3_ND.png) | ND | No Derivatives | The work must not be altered. |
| ![grafik](/images/academy/3dmodels/3dmodelsinternet/4_SA.png) | SA | Share Alike | The work must be redistributed under the same license after modifications. |

<p align="center"> <i> Rights modules at Creative Commons - table from: https://de.wikipedia.org/wiki/Creative_Commons#Die_Rechtemodule - <a href="https://creativecommons.org/licenses/by-sa/3.0/">(CC BY-SA 3.0)</a> </i> </p>

Expand Down
8 changes: 4 additions & 4 deletions src/pages/ua/academy/3dmodels/3dmodelsinternet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ Creative Commons (CC) — це громадська організація зі

| Зображення | Скорочення | Ім’я модуля | Пояснення |
| - | - | - | - |
| ![grafik](images/academy/3dmodels/3dmodelsinternet/1_BY.png) | BY | Із зазначенням авторства (englisch: Attribution) | Треба зазначати ім’я автора. |
| ![grafik](images/academy/3dmodels/3dmodelsinternet/2_NC.png) | NC | Некомерційна (Non-Commercial) | Das Werk darf nicht für kommerzielle Zwecke verwendet werden. |
| ![grafik](images/academy/3dmodels/3dmodelsinternet/3_ND.png) | ND | Без похідних (No Derivatives) | Твір не можна змінювати. |
| ![grafik](images/academy/3dmodels/3dmodelsinternet/4_SA.png) | SA | Розповсюдження на тих самих умовах (Share Alike) | Змінений наступним співавтором твір має поширюватися на умовах цієї ж ліцензії. |
| ![grafik](/images/academy/3dmodels/3dmodelsinternet/1_BY.png) | BY | Із зазначенням авторства (englisch: Attribution) | Треба зазначати ім’я автора. |
| ![grafik](/images/academy/3dmodels/3dmodelsinternet/2_NC.png) | NC | Некомерційна (Non-Commercial) | Das Werk darf nicht für kommerzielle Zwecke verwendet werden. |
| ![grafik](/images/academy/3dmodels/3dmodelsinternet/3_ND.png) | ND | Без похідних (No Derivatives) | Твір не можна змінювати. |
| ![grafik](/images/academy/3dmodels/3dmodelsinternet/4_SA.png) | SA | Розповсюдження на тих самих умовах (Share Alike) | Змінений наступним співавтором твір має поширюватися на умовах цієї ж ліцензії. |

<p align="center"> <i> Правові модулі Creative Commons – Таблиця - Джерело: https://de.wikipedia.org/wiki/Creative_Commons#Die_Rechtemodule - <a href="https://creativecommons.org/licenses/by-sa/3.0/">(CC BY-SA 3.0)</a> </i> </p>

Expand Down
2 changes: 1 addition & 1 deletion src/util/ContentTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
AcademyPageFrontmatter,
} from "@interfaces/IAcademy";
import type { MDXInstance } from "astro";
import {
import type {
IInterventionFrontmatter,
IInterventionPoi,
} from "@interfaces/IIntervention";
Expand Down

0 comments on commit 4dd880d

Please sign in to comment.