Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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,7 @@ import {
import { ArrowIcon } from '../../icons';
import { IconSize } from '../../Icon';
import type { Opportunity } from '../../../features/opportunity/types';
import { settingsUrl, webappUrl } from '../../../lib/constants';
import { RoleInfoSection } from './sections/RoleInfoSection';
import { JobDetailsSection } from './sections/JobDetailsSection';
import { ContentSection } from './sections/ContentSection';
Expand Down Expand Up @@ -192,7 +193,9 @@ export function OpportunityEditPanel({
name={recruiter?.name}
image={recruiter?.image}
subtitle={recruiter?.title}
editUrl="/settings/profile"
editUrl={`${settingsUrl}/profile?redirectTo=${encodeURIComponent(
`${webappUrl}recruiter/${opportunity.id}/edit`,
)}&redirectCopy=${encodeURIComponent('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 @@ -75,7 +75,9 @@ const Footer = () => {
variant={ButtonVariant.Tertiary}
icon={<SettingsIcon />}
size={ButtonSize.XSmall}
href={`${settingsUrl}/profile`}
href={`${settingsUrl}/profile?redirectTo=${encodeURIComponent(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why encode it? could use getPathnameWithQuery or just URL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually forgot we had that one

`${webappUrl}recruiter`,
)}&redirectCopy=${encodeURIComponent('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