Skip to content

Commit

Permalink
Merge branch 'main' into wap
Browse files Browse the repository at this point in the history
  • Loading branch information
IncognitaDev authored Mar 7, 2024
2 parents bd73644 + 67a403e commit b736763
Show file tree
Hide file tree
Showing 39 changed files with 903 additions and 365 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ import_map.local.json
_fresh/

deno.lock

# deco files
.decofile.json
2 changes: 1 addition & 1 deletion apps/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ export default function Site(
};
}

export { onBeforeResolveProps } from "apps/website/mod.ts";
export { onBeforeResolveProps, Preview } from "apps/website/mod.ts";
42 changes: 0 additions & 42 deletions components/footer/ColorClasses.tsx

This file was deleted.

17 changes: 13 additions & 4 deletions components/footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import BackToTop from "$store/components/footer/BackToTop.tsx";
import ColorClasses from "$store/components/footer/ColorClasses.tsx";
import Divider from "$store/components/footer/Divider.tsx";
import ExtraLinks from "$store/components/footer/ExtraLinks.tsx";
import FooterItems from "$store/components/footer/FooterItems.tsx";
Expand All @@ -9,6 +8,7 @@ import PaymentMethods from "$store/components/footer/PaymentMethods.tsx";
import RegionSelector from "$store/components/footer/RegionSelector.tsx";
import Social from "$store/components/footer/Social.tsx";
import Newsletter from "$store/islands/Newsletter.tsx";
import { clx } from "$store/sdk/clx.ts";
import type { ImageWidget } from "apps/admin/widgets.ts";
import PoweredByDeco from "apps/website/components/PoweredByDeco.tsx";

Expand Down Expand Up @@ -111,6 +111,14 @@ export interface Props {
layout?: Layout;
}

const LAYOUT = {
"Primary": "bg-primary text-primary-content",
"Secondary": "bg-secondary text-secondary-content",
"Accent": "bg-accent text-accent-content",
"Base 100": "bg-base-100 text-base-content",
"Base 100 inverted": "bg-base-content text-base-100",
};

function Footer({
logo,
newsletter = {
Expand Down Expand Up @@ -214,9 +222,10 @@ function Footer({

return (
<footer
class={`w-full flex flex-col pt-10 pb-2 md:pb-10 gap-10 ${
ColorClasses(layout)
}`}
class={clx(
"w-full flex flex-col pt-10 pb-2 md:pb-10 gap-10",
LAYOUT[layout?.backgroundColor ?? "Primary"],
)}
>
<div class="lg:container mx-6 lg:mx-auto">
{(!layout?.variation || layout?.variation == "Variation 1") && (
Expand Down
2 changes: 1 addition & 1 deletion components/footer/FooterItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function FooterItems(
{sections.map((section) => (
<li>
<div class="collapse collapse-arrow ">
<input type="checkbox" class="min-h-[0]" />
<input id={section.label} type="checkbox" class="min-h-[0]" />
<label
htmlFor={section.label}
class="collapse-title min-h-[0] !p-0 flex gap-2"
Expand Down
12 changes: 6 additions & 6 deletions components/footer/Newsletter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useSignal } from "@preact/signals";
import { invoke } from "$store/runtime.ts";
import { clx } from "$store/sdk/clx.ts";
import { useSignal } from "@preact/signals";
import type { JSX } from "preact";

export interface Form {
Expand Down Expand Up @@ -44,11 +45,10 @@ function Newsletter(

return (
<div
class={`flex ${
tiled
? "flex-col gap-4 lg:flex-row lg:w-full lg:justify-between"
: "flex-col gap-4"
}`}
class={clx(
"flex flex-col gap-4",
tiled && "lg:flex-row lg:w-full lg:justify-between",
)}
>
<div class="flex flex-col gap-4">
{content?.title && (
Expand Down
10 changes: 8 additions & 2 deletions components/footer/RegionSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,21 @@ export default function RegionSelector(
{content?.currency?.length > 0 && (
<>
<label for="currency" class="sr-only">Currency</label>
<select class="select select-bordered select-sm h-10">
<select
id="currency"
class="select select-bordered select-sm h-10"
>
{content.currency.map((crr) => <option>{crr.label}</option>)}
</select>
</>
)}
{content?.language?.length > 0 && (
<>
<label for="language" class="sr-only">Language</label>
<select class="select select-bordered select-sm h-10">
<select
id="language"
class="select select-bordered select-sm h-10"
>
{content.language.map((lng) => <option>{lng.label}</option>)}
</select>
</>
Expand Down
2 changes: 1 addition & 1 deletion components/header/Drawers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Aside = (
<span class="font-medium text-2xl">{title}</span>
</h1>
{onClose && (
<Button class="btn btn-ghost" onClick={onClose}>
<Button aria-label="X" class="btn btn-ghost" onClick={onClose}>
<Icon id="XMark" size={24} strokeWidth={2} />
</Button>
)}
Expand Down
10 changes: 9 additions & 1 deletion components/header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { AppContext } from "$store/apps/site.ts";
import type { Props as SearchbarProps } from "$store/components/search/Searchbar.tsx";
import Drawers from "$store/islands/Header/Drawers.tsx";
import { usePlatform } from "$store/sdk/usePlatform.tsx";
import type { ImageWidget } from "apps/admin/widgets.ts";
import type { SiteNavigationElement } from "apps/commerce/types.ts";
import type { SectionProps } from "deco/types.ts";
import Alert from "./Alert.tsx";
import Navbar from "./Navbar.tsx";
import { headerHeight } from "./constants.ts";
Expand Down Expand Up @@ -74,7 +76,8 @@ function Header({
},
logoPosition = "center",
buttons,
}: Props) {
device,
}: SectionProps<typeof loader>) {
const platform = usePlatform();
const items = navItems ?? [];

Expand All @@ -89,6 +92,7 @@ function Header({
<div class="bg-base-100 fixed w-full z-50">
{alerts && alerts.length > 0 && <Alert alerts={alerts} />}
<Navbar
device={device}
items={items}
searchbar={searchbar && { ...searchbar, platform }}
logo={logo}
Expand All @@ -102,4 +106,8 @@ function Header({
);
}

export const loader = (props: Props, _req: Request, ctx: AppContext) => {
return { ...props, device: ctx.device };
};

export default Header;
Loading

0 comments on commit b736763

Please sign in to comment.