diff --git a/package.json b/package.json index 11bf724..ae36d9d 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,12 @@ }, "dependencies": { "@astrojs/check": "^0.5.10", + "@codespacecz/web": "^0.0.1", "@iconify-json/mdi": "^1.1.66", "@iconify-json/tabler": "^1.1.110", "astro": "^4.6.3", - "astro-icon": "^1.1.0", "astro-i18n": "^2.2.4", + "astro-icon": "^1.1.0", "typescript": "^5.4.5" } } \ No newline at end of file diff --git a/src/components/Nav.astro b/src/components/Nav.astro deleted file mode 100644 index d846bb1..0000000 --- a/src/components/Nav.astro +++ /dev/null @@ -1,43 +0,0 @@ ---- -import { Icon } from 'astro-icon/components'; -import NavLink from './NavLink.astro'; -import LanguageSwitcher from './LanguageSwitcher.astro'; -import "../styles/nav.css"; -import { t, l } from "astro-i18n"; - -const nav = [ - {title: "home", link: l("/")}, - {title: "services", link: l("/sluzby")}, - {title: "contact", link: l("/kontakt")} -]; ---- - - - \ No newline at end of file diff --git a/src/components/NavLink.astro b/src/components/NavLink.astro deleted file mode 100644 index 514e51b..0000000 --- a/src/components/NavLink.astro +++ /dev/null @@ -1,14 +0,0 @@ ---- -import type { HTMLAttributes } from 'astro/types'; - -type Props = HTMLAttributes<'a'>; - -const { href, class: className, ...props } = Astro.props; - -const { pathname } = Astro.url; -const isActive = href === pathname; ---- - - - - \ No newline at end of file diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index f6e7fc1..9b6b2cb 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,20 +1,10 @@ --- -import Nav from '../components/Nav.astro'; +import { MetaTags, Nav, NavLink } from '@codespacecz/web/components'; +import { type Meta } from '@codespacecz/web/types'; +import LanguageSwitcher from '../components/LanguageSwitcher.astro'; import Footer from '../components/Footer.astro'; -import { t } from 'astro-i18n'; - -export interface Meta { - site_name: string, - author: string, - title: string, - desc: string, - title_suffix: string, - use_title_suffix: boolean, - image: string, - image_type: "banner" | "icon", - favicon: string, - color: string -} +import { Icon } from 'astro-icon/components'; +import { l, t } from 'astro-i18n'; type Styles = "white-nav"; @@ -36,16 +26,19 @@ const defaultMeta: Meta = { color: "#cc1e58" }; +const nav = [ + {title: "home", link: l("/")}, + {title: "services", link: l("/sluzby")}, + {title: "contact", link: l("/kontakt")} +]; + const props = Astro.props; const meta = { ...defaultMeta, ...props.meta }; let classes: string[] = []; props.style?.forEach(s => classes.push(`style-${s}`)); -const title = meta.title + (meta.use_title_suffix ? meta.title_suffix : ""); -const card = meta.image_type == "banner" ? "summary_large_image" : "summary"; - -import '../styles/variables.css'; +import '@codespacecz/web/style.css'; import '../styles/global.css'; import '../styles/fonts.css'; --- @@ -53,28 +46,27 @@ import '../styles/fonts.css'; - - {title} - - - - - - - - - - - - - - - +
-