Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
import DashboardContent from "@components/admin/dashboard-content";
import LoadingScreen from "@components/admin/loading-screen";
import Settings from "@components/admin/settings";
import {
AddressContext,
ProfileContext,
SiteInfoContext,
} from "@components/contexts";
import { ProfileContext, SiteInfoContext } from "@components/contexts";
import { Profile, UIConstants } from "@courselit/common-models";
import { checkPermission } from "@courselit/utils";
import { SITE_SETTINGS_PAGE_HEADING } from "@ui-config/strings";
Expand All @@ -19,7 +15,6 @@ const breadcrumbs = [{ label: SITE_SETTINGS_PAGE_HEADING, href: "#" }];

export default function Page() {
const siteinfo = useContext(SiteInfoContext);
const address = useContext(AddressContext);
const { profile } = useContext(ProfileContext);
const searchParams = useSearchParams();

Expand All @@ -37,12 +32,9 @@ export default function Page() {
<Settings
key={tab}
siteinfo={siteinfo}
address={address}
profile={profile as Profile}
selectedTab={tab as any}
dispatch={() => {}}
loading={false}
networkAction={false}
/>
</DashboardContent>
);
Expand Down
3 changes: 1 addition & 2 deletions apps/web/app/(with-contexts)/dashboard/page/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function Page(props: { params: Promise<{ id: string }> }) {
siteinfo: siteInfo,
address: address,
profile: profile as Profile,
auth: profile.email
auth: profile!.email
? {
guest: false,
checked: true,
Expand Down Expand Up @@ -72,7 +72,6 @@ export default function Page(props: { params: Promise<{ id: string }> }) {
action: null,
},
}}
dispatch={() => {}}
/>
);
}
47 changes: 1 addition & 46 deletions apps/web/components/admin/page-editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -519,52 +519,6 @@ export default function PageEditor({
[selectedWidget],
);

// const saveDraftTypefaces = async (fontName: string) => {
// const newTypefaces: Typeface[] = structuredClone(draftTypefaces);
// const defaultSection = newTypefaces.filter(
// (x) => x.section === "default",
// )[0];
// defaultSection.typeface = fontName;

// const query = `
// mutation {
// site: updateDraftTypefaces(
// typefaces: ${getGraphQLQueryStringFromObject(newTypefaces)}
// ) {
// draftTypefaces {
// section,
// typeface,
// fontWeights,
// fontSize,
// lineHeight,
// letterSpacing,
// case
// },
// }
// }
// `;
// const fetch = new FetchBuilder()
// .setUrl(`${address.backend}/api/graph`)
// .setPayload(query)
// .setIsGraphQLEndpoint(true)
// .build();
// try {
// dispatch && dispatch(networkAction(true));
// const response = await fetch.exec();
// if (response.site) {
// setDraftTypefaces(response.site.draftTypefaces);
// }
// } catch (err: any) {
// toast({
// title: TOAST_TITLE_ERROR,
// description: err.message,
// variant: "destructive",
// });
// } finally {
// dispatch && dispatch(networkAction(false));
// }
// };

const onAddWidgetBelow = (index: number) => {
setSelectedWidgetIndex(index);
setLeftPaneContent("widgets");
Expand Down Expand Up @@ -762,6 +716,7 @@ export default function PageEditor({
onClick={onPublish}
size="sm"
className="gap-2 whitespace-nowrap"
disabled={loading}
>
<ArrowUpFromLine className="h-4 w-4" />
{EDIT_PAGE_BUTTON_UPDATE}
Expand Down
29 changes: 0 additions & 29 deletions apps/web/components/admin/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,35 +135,6 @@ const Settings = (props: SettingsProps) => {
loadAdminSettings();
}, []);

// useEffect(() => {
// props.dispatch(
// newSiteInfoAvailable({
// title: settings.title || "",
// subtitle: settings.subtitle || "",
// logo: settings.logo,
// currencyISOCode: settings.currencyISOCode,
// paymentMethod: settings.paymentMethod,
// stripeKey: settings.stripeKey,
// codeInjectionHead: settings.codeInjectionHead
// ? encode(settings.codeInjectionHead)
// : "",
// codeInjectionBody: settings.codeInjectionBody
// ? encode(settings.codeInjectionBody)
// : "",
// mailingAddress: settings.mailingAddress || "",
// hideCourseLitBranding: settings.hideCourseLitBranding ?? false,
// razorpayKey: settings.razorpayKey,
// lemonsqueezyStoreId: settings.lemonsqueezyStoreId,
// lemonsqueezyOneTimeVariantId:
// settings.lemonsqueezyOneTimeVariantId,
// lemonsqueezySubscriptionMonthlyVariantId:
// settings.lemonsqueezySubscriptionMonthlyVariantId,
// lemonsqueezySubscriptionYearlyVariantId:
// settings.lemonsqueezySubscriptionYearlyVariantId,
// }),
// );
// }, [settings]);

const loadAdminSettings = async () => {
const query = `
query {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/public/base-layout/template/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Template = (props: TemplateProps) => {
);

return (
<div className="flex flex-col courselit-theme">
<div className="flex flex-col bg-background courselit-theme">
{header && (
<EditableWidget
item={header}
Expand Down
17 changes: 10 additions & 7 deletions apps/web/components/public/payments/login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
FormItem,
FormMessage,
} from "@/components/ui/form";
import Link from "next/link";
import {
AddressContext,
ProfileContext,
Expand Down Expand Up @@ -168,19 +167,23 @@ export function LoginForm({ onLoginComplete }: LoginFormProps) {
/>
<Text2 className="text-xs" theme={theme.theme}>
By signing in, you accept our{" "}
<Link
href="/terms"
<a
href="/p/terms"
className="underline hover:text-primary font-medium"
target="_blank"
rel="noreferrer noopener"
>
Terms
</Link>{" "}
</a>{" "}
and{" "}
<Link
href="/privacy"
<a
href="/p/privacy"
className="underline hover:text-primary font-medium"
target="_blank"
rel="noreferrer noopener"
>
Privacy Policy
</Link>
</a>
</Text2>
<Button
type="button"
Expand Down
4 changes: 2 additions & 2 deletions apps/web/graphql/pages/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ export async function initSharedWidgets(ctx: GQLContext) {
{
name: "Legal",
links: [
{ label: "Terms of use", href: "/p/terms" },
{ label: "Privacy policy", href: "/p/privacy" },
{ label: "Terms of Use", href: "/p/terms" },
{ label: "Privacy Policy", href: "/p/privacy" },
],
},
],
Expand Down
152 changes: 0 additions & 152 deletions docs/widgets.md

This file was deleted.

4 changes: 2 additions & 2 deletions packages/common-models/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const leads = ["website", "newsletter", "download", "api"] as const;
export const mailRequestStatus = ["pending", "approved", "rejected"] as const;
export const pageNames = {
home: "Home page",
terms: "Terms of Service",
privacy: "Privacy policy",
terms: "Terms of Use",
privacy: "Privacy Policy",
blog: "Blog",
};
export const dripType = ["relative-date", "exact-date"] as const;
Expand Down
Loading
Loading