Skip to content

Commit e91f4e8

Browse files
committed
Pricing plan item editor fix
1 parent d4a27f9 commit e91f4e8

8 files changed

Lines changed: 62 additions & 51 deletions

File tree

apps/docs/src/pages/en/website/blocks.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You will also see the newly added link on the header itself.
3535

3636
3. Click on the pencil icon against the newly added link to edit it as shown above.
3737
4. Change the label (displayed as text on the header block) and the URL (where the user should be taken upon clicking the label on the header) and click `Done` to save.
38-
![Header edit link](/assets/pages/header-edit-link.png)
38+
![Header edit link](/assets/pages/header-edit-link.png)
3939
</details>
4040

4141
### [Rich Text](#rich-text)
@@ -60,7 +60,7 @@ You can also use the floating controls to do the same as shown below.
6060
> Double-clicking the text to select won't work due to a bug. We are working on it.
6161
2. Click on the floating `link` button to reveal a popup text input.
6262
3. In the popup text input, enter the URL as shown below.
63-
![Create a hyperlink in rich text block](/assets/pages/rich-text-create-hyperlink.gif)
63+
![Create a hyperlink in rich text block](/assets/pages/rich-text-create-hyperlink.gif)
6464
</details>
6565

6666
### [Hero](#hero)
@@ -85,8 +85,8 @@ Following is how it looks on a page.
8585

8686
3. In the button text field, add the text that will be visible on the button.
8787
4. In the button action, enter the URL the user should be taken to upon clicking.
88-
a. If the URL is from your own school, use its relative form, i.e., `/courses`.
89-
b. If the URL is from some external website, use the absolute (complete) URL, i.e., `https://website.com/courses`.
88+
a. If the URL is from your own school, use its relative form, i.e., `/courses`.
89+
b. If the URL is from some external website, use the absolute (complete) URL, i.e., `https://website.com/courses`.
9090
</details>
9191

9292
### [Grid](#grid)
@@ -130,8 +130,8 @@ A grid block comes in handy when you want to show some sort of list, for example
130130

131131
3. In the button text field, add the text that will be visible on the button.
132132
4. In the button action, enter the URL the user should be taken to upon clicking.
133-
a. If the URL is from your own school, use its relative form, i.e., `/courses`.
134-
b. If the URL is from some external website, use the absolute (complete) URL, i.e., `https://website.com/courses`.
133+
a. If the URL is from your own school, use its relative form, i.e., `/courses`.
134+
b. If the URL is from some external website, use the absolute (complete) URL, i.e., `https://website.com/courses`.
135135
</details>
136136

137137
### [Featured](#featured)
@@ -268,7 +268,7 @@ In the `Design` panel, you can customize:
268268
- Maximum width
269269
- Vertical padding
270270
- Social media links (Facebook, Twitter, Instagram, LinkedIn, YouTube, Discord, GitHub)
271-
</details>
271+
</details>
272272

273273
## [Shared blocks](#shared-blocks)
274274

apps/docs/src/pages/en/website/themes.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -192,30 +192,30 @@ The typography editor lets you customize text styles across your website. These
192192
- Header 3: Smaller titles for subsections
193193
- Header 4: Small titles for minor sections
194194
- Preheader: Introductory text that appears above headers
195-
</details>
195+
</details>
196196

197197
<details>
198198
<summary>Subheaders</summary>
199199

200200
- Subheader 1: Primary subheaders for section introductions
201201
- Subheader 2: Secondary subheaders for supporting text
202-
</details>
202+
</details>
203203

204204
<details>
205205
<summary>Body Text</summary>
206206

207207
- Text 1: Main body text for content
208208
- Text 2: Secondary body text for supporting content
209209
- Caption: Small text for image captions and footnotes
210-
</details>
210+
</details>
211211

212212
<details>
213213
<summary>Interactive Elements</summary>
214214

215215
- Link: Text for clickable links
216216
- Button: Text for buttons and calls-to-action
217217
- Input: Text for form fields and search boxes
218-
</details>
218+
</details>
219219

220220
For each text style, you can customize:
221221

@@ -243,7 +243,7 @@ CourseLit provides a carefully curated selection of professional fonts, organize
243243
- **Mulish**: A geometric sans-serif with a modern feel
244244
- **Nunito**: A well-balanced font with rounded terminals
245245
- **Work Sans**: A clean, modern font with a geometric feel
246-
</details>
246+
</details>
247247

248248
<details>
249249
<summary>Serif Fonts</summary>
@@ -253,7 +253,7 @@ CourseLit provides a carefully curated selection of professional fonts, organize
253253
- **Playfair Display**: An elegant serif font for headings
254254
- **Roboto Slab**: A serif variant of Roboto
255255
- **Source Serif 4**: A serif font designed for digital reading
256-
</details>
256+
</details>
257257

258258
<details>
259259
<summary>Display Fonts</summary>
@@ -264,15 +264,15 @@ CourseLit provides a carefully curated selection of professional fonts, organize
264264
- **Rubik**: A sans-serif with a geometric feel
265265
- **Oswald**: A reworking of the classic style
266266
- **Bebas Neue**: A display font with a strong personality
267-
</details>
267+
</details>
268268

269269
<details>
270270
<summary>Modern Fonts</summary>
271271

272272
- **Lato**: A sans-serif font with a warm feel
273273
- **PT Sans**: A font designed for public use
274274
- **Quicksand**: A display sans-serif with rounded terminals
275-
</details>
275+
</details>
276276

277277
Each font is optimized for web use and includes multiple weights for flexibility in design. All fonts support Latin characters and are carefully selected for their readability and professional appearance.
278278

@@ -290,7 +290,7 @@ The interactives editor allows you to customize the appearance of interactive el
290290
- Shadow effects: From None to 2X Large
291291
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
292292
- Disabled state: How the button looks when it can't be clicked
293-
</details>
293+
</details>
294294

295295
<details>
296296
<summary>Link</summary>
@@ -300,7 +300,7 @@ The interactives editor allows you to customize the appearance of interactive el
300300
- Text shadow: Add depth to your links
301301
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
302302
- Disabled state: How the link looks when it can't be clicked
303-
</details>
303+
</details>
304304

305305
<details>
306306
<summary>Card</summary>
@@ -309,7 +309,7 @@ The interactives editor allows you to customize the appearance of interactive el
309309
- Border style: Choose from various border styles
310310
- Shadow effects: Add depth to your cards
311311
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
312-
</details>
312+
</details>
313313

314314
<details>
315315
<summary>Input</summary>
@@ -320,7 +320,7 @@ The interactives editor allows you to customize the appearance of interactive el
320320
- Shadow effects: Add depth to your input fields
321321
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
322322
- Disabled state: How the input looks when it can't be used
323-
</details>
323+
</details>
324324

325325
### 4. Structure
326326

@@ -332,14 +332,14 @@ The structure editor lets you customize the layout of your pages, like section p
332332
<summary>Page</summary>
333333

334334
- Maximum width options: - 2XL (42rem): Compact layout - 3XL (48rem): Standard layout - 4XL (56rem): Wide layout - 5XL (64rem): Extra wide layout - 6XL (72rem): Full width layout
335-
</details>
335+
</details>
336336

337337
<details>
338338
<summary>Section</summary>
339339

340340
- Horizontal padding: Space on the left and right sides (None to 9X Large)
341341
- Vertical padding: Space on the top and bottom (None to 9X Large)
342-
</details>
342+
</details>
343343

344344
## Publishing Changes
345345

@@ -387,7 +387,7 @@ When adding custom styles to interactive elements, you can use the following Tai
387387
- `text-6xl`: 6X large text
388388
- `text-7xl`: 7X large text
389389
- `text-8xl`: 8X large text
390-
</details>
390+
</details>
391391

392392
<details>
393393
<summary>Padding</summary>
@@ -399,7 +399,7 @@ When adding custom styles to interactive elements, you can use the following Tai
399399
#### Horizontal Padding
400400

401401
- `px-4` to `px-20`: Horizontal padding from 1rem to 5rem
402-
</details>
402+
</details>
403403

404404
<details>
405405
<summary>Colors</summary>
@@ -454,7 +454,7 @@ Variants available: `hover`, `disabled`, `dark`
454454
- `ease-out`: Ease out
455455
- `ease-in-out`: Ease in and out
456456
- `ease-linear`: Linear
457-
</details>
457+
</details>
458458

459459
<details>
460460
<summary>Transforms</summary>
@@ -481,7 +481,7 @@ Variants available: `hover`, `disabled`, `dark`
481481
- `scale-110`: 110% scale
482482
- `scale-125`: 125% scale
483483
- `scale-150`: 150% scale
484-
</details>
484+
</details>
485485

486486
<details>
487487
<summary>Shadows</summary>

apps/web/app/(with-contexts)/dashboard/(sidebar)/blogs/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import Blogs from "@components/admin/blogs";
44
import DashboardContent from "@components/admin/dashboard-content";
55
import LoadingScreen from "@components/admin/loading-screen";
6-
import {
7-
ProfileContext,
8-
} from "@components/contexts";
6+
import { ProfileContext } from "@components/contexts";
97
import { UIConstants } from "@courselit/common-models";
108
import { checkPermission } from "@courselit/utils";
119
import { MANAGE_BLOG_PAGE_HEADING } from "@ui-config/strings";

apps/web/components/public/base-layout/header.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import React from "react";
22
import { IconButton } from "@courselit/components-library";
33
import { Menu } from "@courselit/icons";
4-
import SessionButton from "../session-button";
54
import Branding from "./branding";
65
import ExitCourseButton from "./exit-course-button";
7-
import { usePathname } from "next/navigation";
86
import { SiteInfo } from "@courselit/common-models";
97

108
interface HeaderProps {
@@ -13,13 +11,6 @@ interface HeaderProps {
1311
}
1412

1513
const Header = ({ onMenuClick, siteinfo }: HeaderProps) => {
16-
const currentCoursePathName = usePathname();
17-
18-
const coursePathName = [
19-
"/course/[slug]/[id]",
20-
"/course/[slug]/[id]/[lesson]",
21-
];
22-
2314
return (
2415
<header className="flex w-full z-10 justify-between">
2516
{onMenuClick && (
@@ -32,11 +23,7 @@ const Header = ({ onMenuClick, siteinfo }: HeaderProps) => {
3223
</IconButton>
3324
)}
3425
<Branding siteinfo={siteinfo} />
35-
{coursePathName.includes(currentCoursePathName || "") ? (
36-
<ExitCourseButton />
37-
) : (
38-
<SessionButton />
39-
)}
26+
<ExitCourseButton />
4027
</header>
4128
);
4229
};

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,7 @@ export default function AdminWidget({
275275
</div>
276276
</div>
277277
))}
278-
<Button
279-
component="button"
280-
onClick={addNewItem}
281-
className="w-full"
282-
>
278+
<Button component="button" onClick={addNewItem}>
283279
Add new item
284280
</Button>
285281
</div>

packages/page-blocks/src/blocks/grid/admin-widget/item-editor.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"use client";
2-
31
import React, { useState } from "react";
42
import { Item, SvgStyle } from "../settings";
53
import {

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

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ import {
1313
Checkbox,
1414
VerticalPaddingSelector,
1515
MaxWidthSelector,
16+
Button,
17+
Button2,
1618
} from "@courselit/components-library";
1719
import { columns as defaultColumns } from "../defaults";
1820
import { PageBuilderSlider } from "@courselit/components-library";
1921
import { Theme, ThemeStyle } from "@courselit/page-models";
22+
import { PencilIcon } from "lucide-react";
2023

2124
export interface AdminWidgetProps {
2225
settings: Settings;
@@ -186,7 +189,7 @@ export default function AdminWidget({
186189
return (
187190
<AdminWidgetPanelContainer
188191
type="multiple"
189-
defaultValue={["header", "design"]}
192+
defaultValue={["header", "plans", "design"]}
190193
>
191194
<AdminWidgetPanel title="Header" value="header">
192195
<Form className="flex flex-col gap-4">
@@ -235,6 +238,35 @@ export default function AdminWidget({
235238
)}
236239
</Form>
237240
</AdminWidgetPanel>
241+
<AdminWidgetPanel title="Plans" value="plans">
242+
<div className="flex flex-col gap-4">
243+
{items.map((item: Item, index: number) => (
244+
<div
245+
key={index}
246+
className="flex flex-col gap-2 p-2 border rounded"
247+
>
248+
<div className="flex justify-between items-center">
249+
<h3 className="font-medium">
250+
{item.title || "Untitled"}
251+
</h3>
252+
<Button2
253+
size="icon"
254+
variant="outline"
255+
onClick={() => {
256+
setItemBeingEditedIndex(index);
257+
hideActionButtons(true, {});
258+
}}
259+
>
260+
<PencilIcon className="w-4 h-4" />
261+
</Button2>
262+
</div>
263+
</div>
264+
))}
265+
<Button component="button" onClick={addNewItem}>
266+
Add new plan
267+
</Button>
268+
</div>
269+
</AdminWidgetPanel>
238270
<AdminWidgetPanel title="Design" value="design">
239271
<Select
240272
title="Header alignment"

packages/page-blocks/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"exclude": ["dist", "build", "node_modules"],
44
"compilerOptions": {
55
"outDir": "./dist",
6-
"lib": ["dom"],
6+
"lib": ["dom", "ES2020"],
77
"strict": false,
88
"sourceMap": true
99
},

0 commit comments

Comments
 (0)