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
5 changes: 1 addition & 4 deletions packages/shared/src/components/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export interface FeedProps<T>
isHorizontal?: boolean;
feedContainerRef?: React.Ref<HTMLDivElement>;
disableListFrame?: boolean;
disableBriefCard?: boolean;
}

interface RankVariables {
Expand Down Expand Up @@ -210,7 +209,6 @@ export default function Feed<T>({
isHorizontal = false,
feedContainerRef,
disableListFrame = false,
disableBriefCard = false,
}: FeedProps<T>): ReactElement {
const origin = Origin.Feed;
const { logEvent } = useLogContext();
Expand Down Expand Up @@ -258,8 +256,7 @@ export default function Feed<T>({
hasNoBriefAction &&
!hasDismissedBriefCard &&
!showProfileCompletionCard &&
!isProfileCompletionCardLoading &&
!disableBriefCard;
!isProfileCompletionCardLoading;
const { value: briefCardFeatureValue } = useConditionalFeature({
feature: briefCardFeedFeature,
shouldEvaluate: shouldEvaluateBriefCard,
Expand Down
10 changes: 2 additions & 8 deletions packages/shared/src/components/MainFeedLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ export interface MainFeedLayoutProps
navChildren?: ReactNode;
isFinder?: boolean;
onNavTabClick?: (tab: string) => void;
hideFeedActionButtons?: boolean;
disableBriefCard?: boolean;
}

const getQueryBasedOnLogin = (
Expand Down Expand Up @@ -224,8 +222,6 @@ export default function MainFeedLayout({
navChildren,
isFinder,
onNavTabClick,
hideFeedActionButtons,
disableBriefCard,
}: MainFeedLayoutProps): ReactElement {
useScrollRestoration();
const { sortingEnabled, loadedSettings } = useContext(SettingsContext);
Expand Down Expand Up @@ -519,7 +515,7 @@ export default function MainFeedLayout({
feedName: SharedFeedPage.Custom,
},
emptyScreen: propsByFeed[feedName]?.emptyScreen || <FeedEmptyScreen />,
actionButtons: feedWithActions && !hideFeedActionButtons && (
actionButtons: feedWithActions && (
<SearchControlHeader
algoState={[selectedAlgo, handleSelectedAlgoChange]}
feedName={feedName}
Expand Down Expand Up @@ -599,7 +595,7 @@ export default function MainFeedLayout({
query: config.query,
variables,
emptyScreen: propsByFeed[feedName]?.emptyScreen || <FeedEmptyScreen />,
actionButtons: feedWithActions && !hideFeedActionButtons && (
actionButtons: feedWithActions && (
<SearchControlHeader
algoState={[selectedAlgo, handleSelectedAlgoChange]}
feedName={feedName}
Expand Down Expand Up @@ -636,7 +632,6 @@ export default function MainFeedLayout({
isLaptop,
loadedAlgo,
tokenRefreshed,
hideFeedActionButtons,
]);

useEffect(() => {
Expand Down Expand Up @@ -740,7 +735,6 @@ export default function MainFeedLayout({
<Feed
{...feedProps}
shortcuts={shortcuts}
disableBriefCard={disableBriefCard}
className={classNames(
shouldUseListFeedLayout && !isFinder && 'laptop:px-6',
)}
Expand Down
22 changes: 2 additions & 20 deletions packages/shared/src/components/auth/AuthOptionsInner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ import {
DATE_SINCE_ACTIONS_REQUIRED,
onboardingCompletedActions,
} from '../../hooks/auth';
import { useConditionalFeature } from '../../hooks/useConditionalFeature';
import { featureOnboardingV2 } from '../../lib/featureManagement';

const AuthDefault = dynamic(
() => import(/* webpackChunkName: "authDefault" */ './AuthDefault'),
Expand Down Expand Up @@ -139,7 +137,6 @@ function AuthOptionsInner({
compact,
autoTriggerProvider,
socialProviderScopes,
acceptedMarketing,
}: AuthOptionsProps): ReactElement {
const { displayToast } = useToastNotification();
const { syncSettings } = useSettingsContext();
Expand All @@ -153,12 +150,6 @@ function AuthOptionsInner({
const router = useRouter();
const isOnboardingOrFunnel =
!!router?.pathname?.startsWith('/onboarding') || isFunnel;
const { value: isOnboardingV2 } = useConditionalFeature({
feature: featureOnboardingV2,
shouldEvaluate: trigger === AuthTriggers.Onboarding,
});
const shouldAutoCompleteOnboarding =
trigger === AuthTriggers.Onboarding && isOnboardingV2;
const [activeDisplay, setActiveDisplay] = useState(() =>
storage.getItem(SIGNIN_METHOD_KEY) && !forceDefaultDisplay
? AuthDisplay.SignBack
Expand Down Expand Up @@ -355,8 +346,6 @@ function AuthOptionsInner({
}
} else if (trigger === AuthTriggers.RecruiterSelfServe) {
await autoCompleteProfile(user.email, user.name, false);
} else if (shouldAutoCompleteOnboarding) {
await autoCompleteProfile(user.email, user.name, acceptedMarketing);
} else {
onSetActiveDisplay(AuthDisplay.SocialRegistration);
}
Expand Down Expand Up @@ -465,16 +454,10 @@ function AuthOptionsInner({
return;
}

if (
trigger === AuthTriggers.RecruiterSelfServe ||
shouldAutoCompleteOnboarding
) {
if (trigger === AuthTriggers.RecruiterSelfServe) {
setIsSocialAuthLoading(false);
const loggedUser = boot.user as LoggedUser;
const marketing = shouldAutoCompleteOnboarding
? acceptedMarketing
: false;
await autoCompleteProfile(loggedUser.email, loggedUser.name, marketing);
await autoCompleteProfile(loggedUser.email, loggedUser.name, false);
return;
}

Expand Down Expand Up @@ -699,7 +682,6 @@ function AuthOptionsInner({
hints={hint}
isLoading={isProfileUpdateLoading}
onUpdateHints={onUpdateHint}
trigger={trigger}
simplified={simplified}
{...(user?.isPlus && {
title: 'Complete your profile',
Expand Down
13 changes: 3 additions & 10 deletions packages/shared/src/components/auth/OnboardingRegistrationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ import { providerMap } from './common';
import OrDivider from './OrDivider';
import { useLogContext } from '../../contexts/LogContext';
import type { AuthTriggersType } from '../../lib/auth';
import { AuthEventNames, AuthTriggers } from '../../lib/auth';
import { AuthEventNames } from '../../lib/auth';
import type { ButtonProps } from '../buttons/Button';
import { Button, ButtonSize, ButtonVariant } from '../buttons/Button';
import { isIOSNative } from '../../lib/func';

import { MemberAlready } from '../onboarding/MemberAlready';
import SignupDisclaimer from './SignupDisclaimer';
import { FunnelTargetId } from '../../features/onboarding/types/funnelEvents';
import { useConditionalFeature } from '../../hooks/useConditionalFeature';
import { featureOnboardingV2 } from '../../lib/featureManagement';

interface ClassName {
onboardingSignup?: string;
Expand Down Expand Up @@ -112,10 +110,6 @@ export const OnboardingRegistrationForm = ({
compact,
}: OnboardingRegistrationFormProps): ReactElement => {
const { logEvent } = useLogContext();
const { value: isOnboardingV2 } = useConditionalFeature({
feature: featureOnboardingV2,
shouldEvaluate: trigger === AuthTriggers.Onboarding,
});

const trackOpenSignup = () => {
logEvent({
Expand Down Expand Up @@ -169,9 +163,8 @@ export const OnboardingRegistrationForm = ({
<MemberAlready
onLogin={() => onExistingEmail?.('')}
className={{
container: isOnboardingV2
? 'mx-auto mt-6 w-full justify-center border-t border-border-subtlest-tertiary pt-6 text-center text-text-secondary typo-callout'
: 'mx-auto mt-6 text-center text-text-secondary typo-callout',
container:
'mx-auto mt-6 text-center text-text-secondary typo-callout',
login: '!text-inherit',
}}
/>
Expand Down
16 changes: 4 additions & 12 deletions packages/shared/src/components/auth/RegistrationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import type {
RegistrationParameters,
} from '../../lib/auth';
import { AuthEventNames, AuthTriggers } from '../../lib/auth';
import { useConditionalFeature } from '../../hooks/useConditionalFeature';
import { featureOnboardingV2 } from '../../lib/featureManagement';
import { formToJson } from '../../lib/form';
import { Button, ButtonVariant, ButtonSize } from '../buttons/Button';
import { PasswordField } from '../fields/PasswordField';
Expand Down Expand Up @@ -85,11 +83,7 @@ const RegistrationForm = ({
const [isSubmitted, setIsSubmitted] = useState<boolean>(false);
const [name, setName] = useState('');
const isRecruiterOnboarding = trigger === AuthTriggers.RecruiterSelfServe;
const { value: isOnboardingV2 } = useConditionalFeature({
feature: featureOnboardingV2,
shouldEvaluate: trigger === AuthTriggers.Onboarding,
});
const hideExperienceLevel = isRecruiterOnboarding || isOnboardingV2;
const hideExperienceLevel = isRecruiterOnboarding;
const {
username,
setUsername,
Expand Down Expand Up @@ -433,11 +427,9 @@ const RegistrationForm = ({
saveHintSpace
/>
)}
{!isOnboardingV2 && (
<Checkbox name="optOutMarketing">
I don&apos;t want to receive updates and promotions via email
</Checkbox>
)}
<Checkbox name="optOutMarketing">
I don&apos;t want to receive updates and promotions via email
</Checkbox>
<ConditionalWrapper
condition={simplified ?? false}
wrapper={(component) => (
Expand Down
44 changes: 15 additions & 29 deletions packages/shared/src/components/auth/SocialRegistrationForm.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import classNames from 'classnames';
import type { MutableRefObject, ReactElement } from 'react';
import React, { useContext, useEffect, useState } from 'react';
import type {
AuthTriggersType,
SocialRegistrationParameters,
} from '../../lib/auth';
import { AuthEventNames, AuthTriggers } from '../../lib/auth';
import { useConditionalFeature } from '../../hooks/useConditionalFeature';
import { featureOnboardingV2 } from '../../lib/featureManagement';
import type { SocialRegistrationParameters } from '../../lib/auth';
import { AuthEventNames } from '../../lib/auth';
import { formToJson } from '../../lib/form';
import { Button, ButtonVariant } from '../buttons/Button';
import ImageInput from '../fields/ImageInput';
Expand Down Expand Up @@ -37,7 +32,6 @@ export interface SocialRegistrationFormProps extends AuthFormProps {
provider?: string;
formRef?: MutableRefObject<HTMLFormElement>;
title?: string;
trigger: AuthTriggersType;
hints?: ProfileFormHint;
onUpdateHints?: (errors: ProfileFormHint) => void;
onSignup?: (params: SocialRegistrationParameters) => void;
Expand All @@ -59,15 +53,9 @@ export const SocialRegistrationForm = ({
onSignup,
isLoading,
simplified,
trigger,
}: SocialRegistrationFormProps): ReactElement => {
const { logEvent } = useLogContext();
const { user } = useContext(AuthContext);
const { value: isOnboardingV2 } = useConditionalFeature({
feature: featureOnboardingV2,
shouldEvaluate: trigger === AuthTriggers.Onboarding,
});
const hideExperienceLevel = isOnboardingV2;
const [nameHint, setNameHint] = useState<string>(null);
const [usernameHint, setUsernameHint] = useState<string>(null);
const [experienceLevelHint, setExperienceLevelHint] = useState<string>(null);
Expand Down Expand Up @@ -126,7 +114,7 @@ export const SocialRegistrationForm = ({
return;
}

if (!hideExperienceLevel && !values.experienceLevel?.length) {
if (!values.experienceLevel?.length) {
logError('Experience level not provided');
setExperienceLevelHint('Please select your experience level');
return;
Expand Down Expand Up @@ -237,20 +225,18 @@ export const SocialRegistrationForm = ({
}
rightIcon={isLoadingUsername ? <Loader /> : null}
/>
{!hideExperienceLevel && (
<ExperienceLevelDropdown
className={{ container: 'w-full' }}
name="experienceLevel"
onChange={() => {
if (experienceLevelHint) {
setExperienceLevelHint(null);
}
}}
valid={experienceLevelHint === null}
hint={experienceLevelHint}
saveHintSpace
/>
)}
<ExperienceLevelDropdown
className={{ container: 'w-full' }}
name="experienceLevel"
onChange={() => {
if (experienceLevelHint) {
setExperienceLevelHint(null);
}
}}
valid={experienceLevelHint === null}
hint={experienceLevelHint}
saveHintSpace
/>
<Checkbox name="optOutMarketing" className="font-normal">
I don’t want to receive updates and promotions via email
</Checkbox>
Expand Down
1 change: 0 additions & 1 deletion packages/shared/src/components/auth/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,4 @@ export interface AuthOptionsProps {
compact?: boolean;
autoTriggerProvider?: string;
socialProviderScopes?: string[];
acceptedMarketing?: boolean;
}
2 changes: 1 addition & 1 deletion packages/shared/src/components/onboarding/EditTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const EditTag = ({
}, [isMobile, showPersonas]);

// When the persona feature is on, override any caller-supplied headline
// (Freyja funnel JSON or OnboardingV2 modal) with the persona-tuned copy.
// (Freyja funnel JSON) with the persona-tuned copy.
// TODO: drop this override once Freyja's persona-experiment variant ships
// the new headline directly.
const resolvedHeadline = showPersonas
Expand Down
4 changes: 1 addition & 3 deletions packages/shared/src/lib/featureManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ export const sharedPostPreviewFeature = new Feature(
false,
);

export const featureOnboardingV2 = new Feature('onboarding_v2', false);

export const featureOnboardingTagRecommender = new Feature(
'onboarding_tag_recommender',
false,
Expand Down Expand Up @@ -203,4 +201,4 @@ export const featureCompanionDemoWidget = new Feature(
false,
);

export const featureFeedTagChips = new Feature('feed_tag_chips', false);
export const featureFeedTagChips = new Feature('feed_tag_chips', true);
25 changes: 0 additions & 25 deletions packages/shared/src/lib/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export enum Origin {
HotTakeList = 'hot take list',
HotAndCold = 'hot and cold',
Leaderboard = 'leaderboard',
// Onboarding v2
OnboardingModal = 'onboarding modal',
// Auth
BetterAuthEmailLogin = 'betterauth email login',
BetterAuthEmailLoginBoot = 'betterauth email login boot',
Expand Down Expand Up @@ -559,16 +557,7 @@ export enum TargetType {
BriefCard = 'brief card',
HighlightsCard = 'highlights card',
AdvertiseHereCta = 'advertise here cta',
// Onboarding v2
SignupChooser = 'signup chooser',
SignupPrompt = 'signup prompt',
ProfileImport = 'profile import',
ExperienceLevel = 'experience level',
ExtensionPromo = 'extension promo',
TagsFallback = 'tags fallback',
MarketingOptOut = 'marketing opt out',
OnboardingComplete = 'onboarding complete',
MobileAppDownload = 'mobile app download',
CustomizeNewTab = 'customize new tab',
}

Expand Down Expand Up @@ -632,23 +621,9 @@ export enum TargetId {
AskPage = 'ask page',
AskUpsellSearch = 'ask upsell search',
HackathonPage = 'hackathon page',
// Onboarding v2
GitHub = 'github',
Google = 'google',
AI = 'ai',
Install = 'install',
Dismiss = 'dismiss',
InstallExtension = 'install extension',
MobileApp = 'mobile app',
EnableNotifications = 'enable notifications',
GoToFeed = 'go to feed',
OptOut = 'opt_out',
OptIn = 'opt_in',
ReaderHeader = 'reader header',
ReaderInstallPrompt = 'reader install prompt',
ReaderPermissionPrompt = 'reader permission prompt',
IOS = 'ios',
Android = 'android',
}

export enum NotificationChannel {
Expand Down
Loading
Loading