diff --git a/src/components/ArticleComments/ArticleComments.astro b/src/components/ArticleComments/ArticleComments.astro new file mode 100644 index 0000000..58752e9 --- /dev/null +++ b/src/components/ArticleComments/ArticleComments.astro @@ -0,0 +1,7 @@ +--- +import UIString from "../UIString"; +--- + + diff --git a/src/components/ArticleComments/index.ts b/src/components/ArticleComments/index.ts new file mode 100644 index 0000000..afced07 --- /dev/null +++ b/src/components/ArticleComments/index.ts @@ -0,0 +1 @@ +export { default } from "./ArticleComments.astro"; diff --git a/src/components/ArticleContent/ArticleContent.scss b/src/components/ArticleContent/ArticleContent.scss index bb8bb5a..42db060 100644 --- a/src/components/ArticleContent/ArticleContent.scss +++ b/src/components/ArticleContent/ArticleContent.scss @@ -74,6 +74,7 @@ border-radius: var(--border-radius-lg); font-size: 1rem; font-weight: 500; + font-family: "IBM Plex Mono", monospace; padding: 0.2rem 0.3rem; } diff --git a/src/components/ArticlePost/ArticlePost.astro b/src/components/ArticlePost/ArticlePost.astro index 6e5d083..1b9da09 100644 --- a/src/components/ArticlePost/ArticlePost.astro +++ b/src/components/ArticlePost/ArticlePost.astro @@ -1,17 +1,16 @@ --- -import { createDateFormatter, getLanguageFromURL } from "@root/utils"; +import { createDateFormatter } from "@root/utils"; import { Image } from "@astrojs/image/components"; +import ArticleComments from "@components/ArticleComments"; import "./ArticlePost.scss"; export type Props = { data: ArticleType; + lang: string; }; -const { data } = Astro.props as Props; +const { data, lang } = Astro.props as Props; const { title, tags, author, published_at } = data; -// const lang = getLanguageFromURL(Astro.url.pathname); -// console.log(lang); - const DateFormatter = createDateFormatter("ru"); --- @@ -46,7 +45,5 @@ const DateFormatter = createDateFormatter("ru"); } - + diff --git a/src/components/Header/Header.astro b/src/components/Header/Header.astro index d11d738..89165de 100644 --- a/src/components/Header/Header.astro +++ b/src/components/Header/Header.astro @@ -6,6 +6,7 @@ import UIString from "@components/UIString"; import NavToggle from "./NavToggle"; import "./Header.scss"; import TranslatedLink from "@components/TranslatedLink"; +import LanguageSelect from "@components/LanguageSelect"; const { name, nav, contacts } = SITE_METADATA; const { pathname } = Astro.url; @@ -45,7 +46,7 @@ const { pathname } = Astro.url;
- +
diff --git a/src/components/Header/Header.scss b/src/components/Header/Header.scss index ee890a0..0378aef 100644 --- a/src/components/Header/Header.scss +++ b/src/components/Header/Header.scss @@ -77,6 +77,8 @@ } body[data-is-mobile-open="true"] { + overflow-y: hidden; + touch-action: none; & .header { padding: 15px 0; background-color: var(--background-header-color); @@ -121,12 +123,22 @@ display: block; position: absolute; bottom: 45px; - right: 2.5rem; + right: 2.2rem; & svg { width: 36px; height: 36px; } } + & .language-select { + position: absolute; + bottom: 115px; + right: 2.2rem; + & svg, + & select { + height: 36px; + width: 36px; + } + } } } } diff --git a/src/components/LanguageSelect/LanguageSelect.astro b/src/components/LanguageSelect/LanguageSelect.astro new file mode 100644 index 0000000..1169939 --- /dev/null +++ b/src/components/LanguageSelect/LanguageSelect.astro @@ -0,0 +1,59 @@ +--- +import { Icon } from "astro-icon"; +import { DEFAULT_LANGUAGE } from "@root/config"; +import languages from "@i18n/languages"; +import { getLanguageFromURL } from "@root/utils"; + +const lang = getLanguageFromURL(Astro.url.pathname); +--- + +
+ + +
+ + + + diff --git a/src/components/LanguageSelect/index.ts b/src/components/LanguageSelect/index.ts new file mode 100644 index 0000000..9d165f9 --- /dev/null +++ b/src/components/LanguageSelect/index.ts @@ -0,0 +1 @@ +export { default } from "./LanguageSelect.astro"; diff --git a/src/components/ProjectItem/ProjectItem.astro b/src/components/ProjectItem/ProjectItem.astro index 02773e0..e8735df 100644 --- a/src/components/ProjectItem/ProjectItem.astro +++ b/src/components/ProjectItem/ProjectItem.astro @@ -1,5 +1,5 @@ --- -import { FALLBACK_LANGUAGE } from "@root/config"; +import { DEFAULT_LANGUAGE } from "@root/config"; import { getLanguageFromURL } from "@root/utils"; import { Icon } from "astro-icon"; import UIString from "../UIString"; @@ -23,7 +23,7 @@ const { icon, name, year, description, articleUrl, sourceUrl, demoUrl } = data; {year}
-

{description[lang] || description[FALLBACK_LANGUAGE]}

+

{description[lang] || description[DEFAULT_LANGUAGE]}