Skip to content

Commit

Permalink
fix: remove paywall placeholder + rebase main pt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ilee2u committed Dec 17, 2024
1 parent 7c97e5f commit 1ac0c54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
13 changes: 5 additions & 8 deletions src/components/Sidebar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const Sidebar = ({
messageList,
} = useSelector(state => state.learningAssistant);

const { upgradeable, upgradeUrl, auditTrialDaysRemaining } = useCourseUpgrade();
const {
upgradeable, upgradeUrl, auditTrialExpired, auditTrialDaysRemaining,
} = useCourseUpgrade();

const chatboxContainerRef = useRef(null);

Expand Down Expand Up @@ -81,7 +83,7 @@ const Sidebar = ({
<MessageForm courseId={courseId} shouldAutofocus unitId={unitId} />
);

const getDaysRemainingMessage = () => {
const getDaysRemainingMessage = () => { // eslint-disable-line consistent-return
if (auditTrialDaysRemaining > 1) {
const intlRelativeTime = new Intl.RelativeTimeFormat({ style: 'long' });
return (
Expand All @@ -95,12 +97,7 @@ const Sidebar = ({
Your trial ends today! <a target="_blank" href={upgradeUrl} rel="noreferrer">Upgrade</a> for full access to Xpert.
</div>
);
} // TODO: Show the upgrade screen instead of this banner, to be done in future ticket
return (
<div>
Your trial has expired. <a target="_blank" href={upgradeUrl} rel="noreferrer">Upgrade</a> for full access to Xpert.
</div>
);
}
};

const getSidebar = () => (
Expand Down
5 changes: 3 additions & 2 deletions src/components/Sidebar/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import React from 'react';
import { screen, act } from '@testing-library/react';

import { usePromptExperimentDecision } from '../../experiments';
import { useCourseUpgrade, useTrackEvent } from '../../hooks';
import {
useCourseUpgrade, useTrackEvent,
} from '../../hooks';
import { render as renderComponent } from '../../utils/utils.test';
import { initialState } from '../../data/slice';
import showSurvey from '../../utils/surveyMonkey';
import { useCourseUpgrade, useTrackEvent } from '../../hooks';

import Sidebar from '.';

Expand Down

0 comments on commit 1ac0c54

Please sign in to comment.