Skip to content

Commit b3f9832

Browse files
rajat1saxenaRajat
andauthored
Page blocks improvements (#652)
* Removed commented code and deprecated docs * Re-arrange FAQ items * FAQ block new layout switcher, re-arranger * hero card layout; (untested) hero layouts * tested: header layout * header background for existing pages fix * media block border made configurable * Fixed links on checkout and links texts --------- Co-authored-by: Rajat <hi@rajatsaxena.dev>
1 parent e098607 commit b3f9832

File tree

24 files changed

+526
-584
lines changed

24 files changed

+526
-584
lines changed

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
import DashboardContent from "@components/admin/dashboard-content";
44
import LoadingScreen from "@components/admin/loading-screen";
55
import Settings from "@components/admin/settings";
6-
import {
7-
AddressContext,
8-
ProfileContext,
9-
SiteInfoContext,
10-
} from "@components/contexts";
6+
import { ProfileContext, SiteInfoContext } from "@components/contexts";
117
import { Profile, UIConstants } from "@courselit/common-models";
128
import { checkPermission } from "@courselit/utils";
139
import { SITE_SETTINGS_PAGE_HEADING } from "@ui-config/strings";
@@ -19,7 +15,6 @@ const breadcrumbs = [{ label: SITE_SETTINGS_PAGE_HEADING, href: "#" }];
1915

2016
export default function Page() {
2117
const siteinfo = useContext(SiteInfoContext);
22-
const address = useContext(AddressContext);
2318
const { profile } = useContext(ProfileContext);
2419
const searchParams = useSearchParams();
2520

@@ -37,12 +32,9 @@ export default function Page() {
3732
<Settings
3833
key={tab}
3934
siteinfo={siteinfo}
40-
address={address}
4135
profile={profile as Profile}
4236
selectedTab={tab as any}
43-
dispatch={() => {}}
4437
loading={false}
45-
networkAction={false}
4638
/>
4739
</DashboardContent>
4840
);

apps/web/app/(with-contexts)/dashboard/page/[id]/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function Page(props: { params: Promise<{ id: string }> }) {
4444
siteinfo: siteInfo,
4545
address: address,
4646
profile: profile as Profile,
47-
auth: profile.email
47+
auth: profile!.email
4848
? {
4949
guest: false,
5050
checked: true,
@@ -72,7 +72,6 @@ export default function Page(props: { params: Promise<{ id: string }> }) {
7272
action: null,
7373
},
7474
}}
75-
dispatch={() => {}}
7675
/>
7776
);
7877
}

apps/web/components/admin/page-editor/index.tsx

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -519,52 +519,6 @@ export default function PageEditor({
519519
[selectedWidget],
520520
);
521521

522-
// const saveDraftTypefaces = async (fontName: string) => {
523-
// const newTypefaces: Typeface[] = structuredClone(draftTypefaces);
524-
// const defaultSection = newTypefaces.filter(
525-
// (x) => x.section === "default",
526-
// )[0];
527-
// defaultSection.typeface = fontName;
528-
529-
// const query = `
530-
// mutation {
531-
// site: updateDraftTypefaces(
532-
// typefaces: ${getGraphQLQueryStringFromObject(newTypefaces)}
533-
// ) {
534-
// draftTypefaces {
535-
// section,
536-
// typeface,
537-
// fontWeights,
538-
// fontSize,
539-
// lineHeight,
540-
// letterSpacing,
541-
// case
542-
// },
543-
// }
544-
// }
545-
// `;
546-
// const fetch = new FetchBuilder()
547-
// .setUrl(`${address.backend}/api/graph`)
548-
// .setPayload(query)
549-
// .setIsGraphQLEndpoint(true)
550-
// .build();
551-
// try {
552-
// dispatch && dispatch(networkAction(true));
553-
// const response = await fetch.exec();
554-
// if (response.site) {
555-
// setDraftTypefaces(response.site.draftTypefaces);
556-
// }
557-
// } catch (err: any) {
558-
// toast({
559-
// title: TOAST_TITLE_ERROR,
560-
// description: err.message,
561-
// variant: "destructive",
562-
// });
563-
// } finally {
564-
// dispatch && dispatch(networkAction(false));
565-
// }
566-
// };
567-
568522
const onAddWidgetBelow = (index: number) => {
569523
setSelectedWidgetIndex(index);
570524
setLeftPaneContent("widgets");
@@ -762,6 +716,7 @@ export default function PageEditor({
762716
onClick={onPublish}
763717
size="sm"
764718
className="gap-2 whitespace-nowrap"
719+
disabled={loading}
765720
>
766721
<ArrowUpFromLine className="h-4 w-4" />
767722
{EDIT_PAGE_BUTTON_UPDATE}

apps/web/components/admin/settings/index.tsx

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -135,35 +135,6 @@ const Settings = (props: SettingsProps) => {
135135
loadAdminSettings();
136136
}, []);
137137

138-
// useEffect(() => {
139-
// props.dispatch(
140-
// newSiteInfoAvailable({
141-
// title: settings.title || "",
142-
// subtitle: settings.subtitle || "",
143-
// logo: settings.logo,
144-
// currencyISOCode: settings.currencyISOCode,
145-
// paymentMethod: settings.paymentMethod,
146-
// stripeKey: settings.stripeKey,
147-
// codeInjectionHead: settings.codeInjectionHead
148-
// ? encode(settings.codeInjectionHead)
149-
// : "",
150-
// codeInjectionBody: settings.codeInjectionBody
151-
// ? encode(settings.codeInjectionBody)
152-
// : "",
153-
// mailingAddress: settings.mailingAddress || "",
154-
// hideCourseLitBranding: settings.hideCourseLitBranding ?? false,
155-
// razorpayKey: settings.razorpayKey,
156-
// lemonsqueezyStoreId: settings.lemonsqueezyStoreId,
157-
// lemonsqueezyOneTimeVariantId:
158-
// settings.lemonsqueezyOneTimeVariantId,
159-
// lemonsqueezySubscriptionMonthlyVariantId:
160-
// settings.lemonsqueezySubscriptionMonthlyVariantId,
161-
// lemonsqueezySubscriptionYearlyVariantId:
162-
// settings.lemonsqueezySubscriptionYearlyVariantId,
163-
// }),
164-
// );
165-
// }, [settings]);
166-
167138
const loadAdminSettings = async () => {
168139
const query = `
169140
query {

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}

apps/web/components/public/payments/login-form.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
FormItem,
1313
FormMessage,
1414
} from "@/components/ui/form";
15-
import Link from "next/link";
1615
import {
1716
AddressContext,
1817
ProfileContext,
@@ -168,19 +167,23 @@ export function LoginForm({ onLoginComplete }: LoginFormProps) {
168167
/>
169168
<Text2 className="text-xs" theme={theme.theme}>
170169
By signing in, you accept our{" "}
171-
<Link
172-
href="/terms"
170+
<a
171+
href="/p/terms"
173172
className="underline hover:text-primary font-medium"
173+
target="_blank"
174+
rel="noreferrer noopener"
174175
>
175176
Terms
176-
</Link>{" "}
177+
</a>{" "}
177178
and{" "}
178-
<Link
179-
href="/privacy"
179+
<a
180+
href="/p/privacy"
180181
className="underline hover:text-primary font-medium"
182+
target="_blank"
183+
rel="noreferrer noopener"
181184
>
182185
Privacy Policy
183-
</Link>
186+
</a>
184187
</Text2>
185188
<Button
186189
type="button"

apps/web/graphql/pages/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ export async function initSharedWidgets(ctx: GQLContext) {
211211
{
212212
name: "Legal",
213213
links: [
214-
{ label: "Terms of use", href: "/p/terms" },
215-
{ label: "Privacy policy", href: "/p/privacy" },
214+
{ label: "Terms of Use", href: "/p/terms" },
215+
{ label: "Privacy Policy", href: "/p/privacy" },
216216
],
217217
},
218218
],

docs/widgets.md

Lines changed: 0 additions & 152 deletions
This file was deleted.

packages/common-models/src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export const leads = ["website", "newsletter", "download", "api"] as const;
3636
export const mailRequestStatus = ["pending", "approved", "rejected"] as const;
3737
export const pageNames = {
3838
home: "Home page",
39-
terms: "Terms of Service",
40-
privacy: "Privacy policy",
39+
terms: "Terms of Use",
40+
privacy: "Privacy Policy",
4141
blog: "Blog",
4242
};
4343
export const dripType = ["relative-date", "exact-date"] as const;

0 commit comments

Comments
 (0)