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
288 changes: 106 additions & 182 deletions packages/shared/src/components/profile/ProfileSettingsMenu.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function AccountSecurityDefault({
};

return (
<AccountPageContainer title="Account access">
<AccountPageContainer title="Account & Security">
<AccountContentSection
className={{ heading: 'mt-0' }}
title="Email"
Expand Down
16 changes: 8 additions & 8 deletions packages/webapp/pages/settings/composition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ import { getPageSeoTitles } from '../../components/layouts/utils';

const defaultWriteTabs: RadioItemProps[] = Object.keys(WriteFormTab).map(
(key) => ({
label: WriteFormTab[key],
label: WriteFormTab[key as keyof typeof WriteFormTab],
value: key,
}),
);

const AccountManageSubscriptionPage = (): ReactElement => {
const PostingSettingsPage = (): ReactElement => {
const { updateFlag, flags } = useSettingsContext();

return (
<AccountPageContainer title="Composition">
<AccountPageContainer title="Posting">
<div id="compose" aria-hidden />
<FlexCol className="gap-2">
<Typography bold type={TypographyType.Subhead}>
Expand All @@ -38,7 +38,7 @@ const AccountManageSubscriptionPage = (): ReactElement => {
<Radio
name="default-write-tab"
options={defaultWriteTabs}
value={flags.defaultWriteTab}
value={flags?.defaultWriteTab}
onChange={(value) => {
updateFlag('defaultWriteTab', value);
}}
Expand All @@ -56,10 +56,10 @@ const AccountManageSubscriptionPage = (): ReactElement => {

const seo: NextSeoProps = {
...defaultSeo,
...getPageSeoTitles('Appearance'),
...getPageSeoTitles('Posting'),
};

AccountManageSubscriptionPage.getLayout = getSettingsLayout;
AccountManageSubscriptionPage.layoutProps = { seo };
PostingSettingsPage.getLayout = getSettingsLayout;
PostingSettingsPage.layoutProps = { seo };

export default AccountManageSubscriptionPage;
export default PostingSettingsPage;
2 changes: 1 addition & 1 deletion packages/webapp/pages/settings/customization/devcard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const DevCardStep2 = dynamic(() =>
).then((mod) => mod.DevCardStep2),
);

const seoTitles = getPageSeoTitles('Grab your DevCard');
const seoTitles = getPageSeoTitles('DevCard');
const seo: NextSeoProps = {
title: seoTitles.title,
description:
Expand Down
22 changes: 6 additions & 16 deletions packages/webapp/pages/settings/customization/gamification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useConditionalFeature } from '@dailydotdev/shared/src/hooks';
import { questsFeature } from '@dailydotdev/shared/src/lib/featureManagement';
import {
Typography,
TypographyColor,
TypographyType,
} from '@dailydotdev/shared/src/components/typography/Typography';
import { AccountPageContainer } from '../../../components/layouts/SettingsLayout/AccountPageContainer';
Expand Down Expand Up @@ -42,7 +41,7 @@ const GamificationSettingsPage = (): ReactElement | null => {
}

return (
<AccountPageContainer title="Gamification">
<AccountPageContainer title="Feature visibility">
<div className="flex flex-col gap-6">
<section className="flex flex-col gap-2">
<Typography bold type={TypographyType.Subhead}>
Expand All @@ -61,25 +60,16 @@ const GamificationSettingsPage = (): ReactElement | null => {
</section>

<section className="flex flex-col gap-2">
<div className="flex flex-col gap-1">
<Typography bold type={TypographyType.Subhead}>
Show quests
</Typography>

<Typography
type={TypographyType.Callout}
color={TypographyColor.Tertiary}
>
Turn quest UI on or off across the product.
</Typography>
</div>
<Typography bold type={TypographyType.Subhead}>
Show quests
</Typography>

<SettingsSwitch
name="quest-system"
checked={!optOutQuestSystem}
onToggle={toggleOptOutQuestSystem}
>
Toggle to display or hide the quest system UI.
Toggle to display or hide the quest system UI across the product.
</SettingsSwitch>
</section>
</div>
Expand All @@ -89,7 +79,7 @@ const GamificationSettingsPage = (): ReactElement | null => {

const seo: NextSeoProps = {
...defaultSeo,
title: getTemplatedTitle('Gamification'),
title: getTemplatedTitle('Feature visibility'),
};

GamificationSettingsPage.getLayout = getSettingsLayout;
Expand Down
9 changes: 9 additions & 0 deletions packages/webapp/pages/settings/customization/integrations.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ReactElement } from 'react';
import React, { useCallback, useState } from 'react';
import type { NextSeoProps } from 'next-seo';

import { useIntegrationsQuery } from '@dailydotdev/shared/src/hooks/integrations/useIntegrationsQuery';

Expand All @@ -16,6 +17,13 @@ import { useLogContext } from '@dailydotdev/shared/src/contexts/LogContext';
import { LogEvent, Origin } from '@dailydotdev/shared/src/lib/log';
import { getSettingsLayout } from '../../../components/layouts/SettingsLayout';
import { AccountPageContainer } from '../../../components/layouts/SettingsLayout/AccountPageContainer';
import { defaultSeo } from '../../../next-seo';
import { getPageSeoTitles } from '../../../components/layouts/utils';

const seo: NextSeoProps = {
...defaultSeo,
...getPageSeoTitles('Integrations'),
};

const AccountIntegrationsPage = (): ReactElement => {
const [state, setState] = useState<{
Expand Down Expand Up @@ -84,5 +92,6 @@ const AccountIntegrationsPage = (): ReactElement => {
};

AccountIntegrationsPage.getLayout = getSettingsLayout;
AccountIntegrationsPage.layoutProps = { seo };

export default AccountIntegrationsPage;
2 changes: 1 addition & 1 deletion packages/webapp/pages/settings/feed/ai.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const AccountManageSubscriptionPage = (): ReactElement => {
);
};

const seoTitles = getPageSeoTitles('Edit AI superpowers');
const seoTitles = getPageSeoTitles('AI superpowers');
const seo: NextSeoProps = {
title: seoTitles.title,
openGraph: { ...seoTitles.openGraph, ...defaultOpenGraph },
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/settings/feed/blocked.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const AccountManageSubscriptionPage = (): ReactElement => {
);
};

const seoTitles = getPageSeoTitles('Edit blocked content');
const seoTitles = getPageSeoTitles('Blocked content');
const seo: NextSeoProps = {
title: seoTitles.title,
openGraph: { ...seoTitles.openGraph, ...defaultOpenGraph },
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/settings/feed/general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const AccountManageSubscriptionPage = (): ReactElement => {
);
};

const seoTitles = getPageSeoTitles('Edit feed');
const seoTitles = getPageSeoTitles('General');
const seo: NextSeoProps = {
title: seoTitles.title,
openGraph: { ...seoTitles.openGraph, ...defaultOpenGraph },
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/settings/feed/preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const AccountManageSubscriptionPage = (): ReactElement => {
);
};

const seoTitles = getPageSeoTitles('Edit content preferences');
const seoTitles = getPageSeoTitles('Content preferences');
const seo: NextSeoProps = {
title: seoTitles.title,
openGraph: { ...seoTitles.openGraph, ...defaultOpenGraph },
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/settings/feed/sources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const AccountManageSubscriptionPage = (): ReactElement => {
);
};

const seoTitles = getPageSeoTitles('Edit content sources');
const seoTitles = getPageSeoTitles('Content sources');
const seo: NextSeoProps = {
title: seoTitles.title,
openGraph: { ...seoTitles.openGraph, ...defaultOpenGraph },
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/settings/feed/tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const AccountManageSubscriptionPage = (): ReactElement => {
);
};

const seoTitles = getPageSeoTitles('Edit tags');
const seoTitles = getPageSeoTitles('Tags');
const seo: NextSeoProps = {
title: seoTitles.title,
openGraph: { ...seoTitles.openGraph, ...defaultOpenGraph },
Expand Down
9 changes: 6 additions & 3 deletions packages/webapp/pages/settings/invite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ import { getSettingsLayout } from '../../components/layouts/SettingsLayout';
import { defaultSeo } from '../../next-seo';
import { getPageSeoTitles } from '../../components/layouts/utils';

const seo: NextSeoProps = { ...defaultSeo, ...getPageSeoTitles('Invite') };
const seo: NextSeoProps = {
...defaultSeo,
...getPageSeoTitles('Invite Friends'),
};

const AccountInvitePage = (): ReactElement => {
const { openModal } = useLazyModal();
Expand Down Expand Up @@ -88,10 +91,10 @@ const AccountInvitePage = (): ReactElement => {
getNextPageParam(referredUsers?.pageInfo),
});
const users: UserShortProfile[] = useMemo(() => {
const list = [];
const list: UserShortProfile[] = [];
usersResult.data?.pages.forEach((page) => {
page?.referredUsers.edges.forEach(({ node }) => {
list.push(node);
list.push(node as UserShortProfile);
});
}, []);

Expand Down
8 changes: 4 additions & 4 deletions packages/webapp/pages/settings/job-preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import { AccountPageContainer } from '../../components/layouts/SettingsLayout/Ac

const seo: NextSeoProps = {
...defaultSeo,
...getPageSeoTitles('Manage job preferences'),
...getPageSeoTitles('Job preferences'),
};

const options = [
Expand All @@ -84,9 +84,9 @@ const JobPreferencesPage = (): ReactElement => {
const { user } = useAuthContext();
const { displayToast } = useToastNotification();
const { completeAction } = useActions();
const [option, setOption] = useState(null);
const [option, setOption] = useState<CandidateStatus | null>(null);

const opts = getCandidatePreferencesOptions(user?.id);
const opts = getCandidatePreferencesOptions(user?.id ?? '');
const updateQuery = useUpdateQuery(opts);

const { data: preferences, isPending } = useQuery(opts);
Expand Down Expand Up @@ -282,7 +282,7 @@ const JobPreferencesPage = (): ReactElement => {
};

export const getStaticProps: GetStaticProps<{
dehydratedState: DehydratedState;
dehydratedState: DehydratedState | null;
}> = async () => {
const queryClient = new QueryClient();
try {
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/pages/settings/notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { AccountPageContent } from '../../components/layouts/SettingsLayout/comm

const seo: NextSeoProps = {
...defaultSeo,
...getPageSeoTitles('Manage account notifications'),
...getPageSeoTitles('Notifications'),
};

const AccountNotificationsPage = (): ReactElement => {
Expand Down
10 changes: 5 additions & 5 deletions packages/webapp/pages/settings/organization/[orgId]/billing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { defaultSeo } from '../../../../next-seo';
import { getPageSeoTitles } from '../../../../components/layouts/utils';
import { getOrganizationLayout } from '../../../../components/layouts/OrganizationLayout';

const Page = (): ReactElement => {
const Page = (): ReactElement | null => {
const router = useRouter();
const { openModal } = useLazyModal();
const organizationId = router.query.orgId as string;
Expand All @@ -56,7 +56,7 @@ const Page = (): ReactElement => {
setData(origData);
}, [origData, data]);

if (isFetching || !isAuthReady) {
if (isFetching || !isAuthReady || !organization) {
return null;
}

Expand All @@ -68,7 +68,7 @@ const Page = (): ReactElement => {
section: 'flex-1 gap-6',
}}
>
{data && (
{data && pricing && data.total && pricing.price?.monthly && (
<>
<section>
<Typography bold type={TypographyType.Body} className="pb-4">
Expand Down Expand Up @@ -158,7 +158,7 @@ const Page = (): ReactElement => {
{new Intl.NumberFormat(navigator.language, {
style: 'currency',
currency: pricing.currency.code,
}).format(pricing.price?.monthly?.amount)}
}).format(pricing.price.monthly.amount)}
/seat
</Typography>
</div>
Expand Down Expand Up @@ -200,7 +200,7 @@ const Page = (): ReactElement => {

const seo: NextSeoProps = {
...defaultSeo,
...getPageSeoTitles('Organization'),
...getPageSeoTitles('Billing'),
};

Page.getLayout = getOrganizationLayout;
Expand Down
17 changes: 7 additions & 10 deletions packages/webapp/pages/settings/organization/[orgId]/general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { getPageSeoTitles } from '../../../../components/layouts/utils';
import { defaultSeo } from '../../../../next-seo';
import { AccountPageContainer } from '../../../../components/layouts/SettingsLayout/AccountPageContainer';

const Page = (): ReactElement => {
const Page = (): ReactElement | null => {
const router = useRouter();
const { showPrompt } = usePrompt();
const {
Expand Down Expand Up @@ -72,10 +72,7 @@ const Page = (): ReactElement => {
data.image = imageFile;
}

await updateOrganization({
id: organization.id,
form: data,
});
await updateOrganization({ form: data });

setImageChanged(false);
return null;
Expand All @@ -98,15 +95,15 @@ const Page = (): ReactElement => {
}
};

if (isFetching || !organization) {
return null;
}

const disableDeletion =
!isOwner ||
organization.status === SubscriptionStatus.Active ||
seats.assigned > 0;

if (isFetching) {
return null;
}

return (
<AccountPageContainer
title="General"
Expand Down Expand Up @@ -220,7 +217,7 @@ const Page = (): ReactElement => {

const seo: NextSeoProps = {
...defaultSeo,
...getPageSeoTitles('Organization'),
...getPageSeoTitles('General'),
};

Page.getLayout = getOrganizationLayout;
Expand Down
Loading
Loading