Skip to content

Commit d8414d2

Browse files
author
Rajat
committed
Removed commented code and deprecated docs
1 parent e098607 commit d8414d2

5 files changed

Lines changed: 1 addition & 237 deletions

File tree

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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 0 additions & 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");

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 {

docs/widgets.md

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

0 commit comments

Comments
 (0)