Skip to content

Commit 8371bdd

Browse files
author
Rajat
committed
hero card layout; (untested) hero layouts
1 parent a357886 commit 8371bdd

8 files changed

Lines changed: 343 additions & 266 deletions

File tree

apps/web/components/public/base-layout/template/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const Template = (props: TemplateProps) => {
7373
);
7474

7575
return (
76-
<div className="flex flex-col courselit-theme">
76+
<div className="flex flex-col bg-background courselit-theme">
7777
{header && (
7878
<EditableWidget
7979
item={header}

packages/page-blocks/src/blocks/header/admin-widget/index.tsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useState } from "react";
2-
import Settings, { Link } from "../settings";
2+
import Settings, { Layout, Link } from "../settings";
33
import LinkEditor from "./link-editor";
44
import {
55
AdminWidgetPanel,
@@ -57,6 +57,10 @@ export default function AdminWidget({
5757
const [showGithubStars, setShowGithubStars] = useState<boolean | undefined>(
5858
settings.showGithubStars || false,
5959
);
60+
const [layout, setLayout] = useState<Layout>(settings.layout || "fixed");
61+
const [backdropBlur, setBackdropBlur] = useState<boolean | undefined>(
62+
settings.backdropBlur || false,
63+
);
6064

6165
useEffect(() => {
6266
onChange({
@@ -68,6 +72,8 @@ export default function AdminWidget({
6872
maxWidth,
6973
githubRepo,
7074
showGithubStars,
75+
layout,
76+
backdropBlur,
7177
});
7278
}, [
7379
links,
@@ -78,6 +84,8 @@ export default function AdminWidget({
7884
maxWidth,
7985
githubRepo,
8086
showGithubStars,
87+
layout,
88+
backdropBlur,
8189
]);
8290

8391
const onLinkChanged = (index: number, link: Link) => {
@@ -151,6 +159,15 @@ export default function AdminWidget({
151159
</div>
152160
</AdminWidgetPanel>
153161
<AdminWidgetPanel title="Design" value="design">
162+
<Select
163+
title="Layout"
164+
value={layout}
165+
options={[
166+
{ label: "Fixed", value: "fixed" },
167+
{ label: "Floating", value: "floating" },
168+
]}
169+
onChange={(value: Layout) => setLayout(value)}
170+
/>
154171
<Select
155172
title="Link font weight"
156173
value={linkFontWeight}
@@ -186,6 +203,18 @@ export default function AdminWidget({
186203
value={maxWidth || theme.theme.structure.page.width}
187204
onChange={setMaxWidth}
188205
/>
206+
<div className="flex justify-between">
207+
<div className="flex grow items-center gap-1">
208+
<p>Backdrop blur</p>
209+
<Tooltip title="Applies a backdrop blur effect to the header background">
210+
<Help />
211+
</Tooltip>
212+
</div>
213+
<Checkbox
214+
checked={backdropBlur}
215+
onChange={(value: boolean) => setBackdropBlur(value)}
216+
/>
217+
</div>
189218
</AdminWidgetPanel>
190219
<AdminWidgetPanel title="Other settings" value="other-settings">
191220
<div className="flex justify-between">
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { WidgetDefaultSettings } from "@courselit/common-models";
22

3+
export type Layout = "fixed" | "floating";
4+
35
export interface Link {
46
label: string;
57
href: string;
@@ -10,15 +12,12 @@ export interface Link {
1012

1113
export default interface Settings extends WidgetDefaultSettings {
1214
links: Link[];
13-
// appBarBackground: string;
14-
// logoColor: string;
15-
// loginBtnColor: string;
16-
// loginBtnBgColor: string;
17-
// linkColor: string;
1815
linkAlignment: "left" | "right" | "center";
1916
showLoginControl: boolean;
2017
linkFontWeight: "font-normal" | "font-light" | "font-bold";
2118
spacingBetweenLinks: number;
2219
githubRepo?: string;
2320
showGithubStars?: boolean;
21+
layout?: Layout;
22+
backdropBlur?: boolean;
2423
}

0 commit comments

Comments
 (0)