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 @@ -9,6 +9,8 @@ import {
import { ArrowIcon } from '../../icons';
import { IconSize } from '../../Icon';
import type { Opportunity } from '../../../features/opportunity/types';
import { settingsUrl, webappUrl } from '../../../lib/constants';
import { getPathnameWithQuery } from '../../../lib/links';
import { RoleInfoSection } from './sections/RoleInfoSection';
import { JobDetailsSection } from './sections/JobDetailsSection';
import { ContentSection } from './sections/ContentSection';
Expand Down Expand Up @@ -192,7 +194,13 @@ export function OpportunityEditPanel({
name={recruiter?.name}
image={recruiter?.image}
subtitle={recruiter?.title}
editUrl="/settings/profile"
editUrl={getPathnameWithQuery(
`${settingsUrl}/profile`,
new URLSearchParams({
redirectTo: `${webappUrl}recruiter/${opportunity.id}/edit`,
redirectCopy: 'Back to job posting',
}),
)}
emptyMessage="No recruiter info added yet"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { getOpportunitiesOptions } from '../../../features/opportunity/queries';
import type { Opportunity } from '../../../features/opportunity/types';
import { OpportunityState } from '../../../features/opportunity/protobuf/opportunity';
import { settingsUrl, webappUrl } from '../../../lib/constants';
import { getPathnameWithQuery } from '../../../lib/links';
import { LogoutReason } from '../../../lib/user';

const Header = () => (
Expand Down Expand Up @@ -75,7 +76,13 @@ const Footer = () => {
variant={ButtonVariant.Tertiary}
icon={<SettingsIcon />}
size={ButtonSize.XSmall}
href={`${settingsUrl}/profile`}
href={getPathnameWithQuery(
`${settingsUrl}/profile`,
new URLSearchParams({
redirectTo: `${webappUrl}recruiter`,
redirectCopy: 'Back to recruiter dashboard',
}),
)}
tag="a"
/>
<Button
Expand Down
17 changes: 16 additions & 1 deletion packages/webapp/components/layouts/SettingsLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import useAuthForms from '@dailydotdev/shared/src/hooks/useAuthForms';
import dynamic from 'next/dynamic';
import {
Typography,
TypographyColor,
TypographyTag,
TypographyType,
} from '@dailydotdev/shared/src/components/typography/Typography';
Expand Down Expand Up @@ -133,7 +134,21 @@ export default function SettingsLayout({
/>
</div>
)}

{router.query.redirectTo && router.query.redirectCopy && (
<button
type="button"
onClick={() => router.push(router.query.redirectTo as string)}
className="flex w-full items-center justify-center gap-2 border-b border-border-subtlest-tertiary bg-surface-float px-6 py-3 text-left transition-colors hover:bg-surface-hover"
>
<ArrowIcon className="-rotate-90 text-text-tertiary" />
<Typography
type={TypographyType.Callout}
color={TypographyColor.Secondary}
>
{router.query.redirectCopy}
</Typography>
</button>
)}
<div className="mx-auto flex w-full max-w-5xl gap-4 tablet:p-6">
{isMobile ? (
<ProfileSettingsMenuMobile
Expand Down