Skip to content

Commit

Permalink
Merge pull request #1003 from t3n/paywall
Browse files Browse the repository at this point in the history
Revert "Merge pull request #1002 from t3n/revert-feature-paywall"
  • Loading branch information
birterohden authored Oct 7, 2024
2 parents 429f682 + c40f46a commit d97163e
Show file tree
Hide file tree
Showing 28 changed files with 97 additions and 25 deletions.
8 changes: 4 additions & 4 deletions packages/components/src/LegacyFooter/LegacyDesktopFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ const legacyDesktopLinkGroups: DesktopLinkGroupsType = [
label: 't3n',
links: [
{
label: 'Pur',
url: '/pur',
label: 'Plus',
url: '/plus-artikel',
},
{
label: 'Pro',
url: '/pro-artikel',
label: 'Digitale Abos',
url: '/abos',
},
{
label: 'News',
Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/LegacyFooter/LegacyMobileFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ const SmallerText = styled(Text)`

const legacyMobileLinks: MobileLinkType = [
{
label: 'Pur',
url: '/pur',
label: 'Plus',
url: '/plus-artikel',
},
{
label: 'Pro',
url: '/pro-artikel',
label: 'Digitale Abos',
url: '/abos',
},
{
label: 'Team',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface LegacyDesktopHeaderProps {
showAds?: boolean;
adsPreview?: boolean;
userEmail?: string;
isPlusUser?: boolean;
isProMember?: boolean;
userMenuItems?: ReactNode[];
}
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/LegacyHeader/LegacyDesktopHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface LegacyDesktopHeaderProps {
showAds?: boolean;
adsPreview?: boolean;
userEmail?: string;
isPlusUser?: boolean;
isProMember?: boolean;
userMenuItems?: ReactNode[];
}
Expand Down Expand Up @@ -178,6 +179,7 @@ const LegacyDesktopHeader: React.FC<LegacyDesktopHeaderProps> = ({
showAds,
adsPreview,
userEmail,
isPlusUser,
isProMember,
userMenuItems,
}) => {
Expand Down Expand Up @@ -236,6 +238,7 @@ const LegacyDesktopHeader: React.FC<LegacyDesktopHeaderProps> = ({
</HeaderCampaign>
<Box display="flex" flexDirection="column" flexGrow={1} mt={2}>
<LegacyT3nNav
isPlusUser={isPlusUser}
isProMember={isProMember}
userEmail={userEmail}
userMenuItems={userMenuItems}
Expand Down Expand Up @@ -281,6 +284,7 @@ const LegacyDesktopHeader: React.FC<LegacyDesktopHeaderProps> = ({
</SearchForm>
</StickyNavBox>
<UserMenu
isPlusUser={isPlusUser}
isProMember={isProMember}
userEmail={userEmail}
light
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/LegacyHeader/LegacyHeader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface LegacyHeaderProps {
showAds?: boolean;
adsPreview?: boolean;
userEmail?: string;
isPlusUser?: boolean;
isProMember?: boolean;
userMenuItems?: ReactNode[];
}
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/LegacyHeader/LegacyHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface LegacyHeaderProps {
showAds?: boolean;
adsPreview?: boolean;
userEmail?: string;
isPlusUser?: boolean;
isProMember?: boolean;
userMenuItems?: ReactNode[];
}
Expand All @@ -28,6 +29,7 @@ const LegacyHeader: React.FC<LegacyHeaderProps> = ({
showAds,
adsPreview,
userEmail,
isPlusUser,
isProMember,
userMenuItems,
}) => {
Expand All @@ -38,6 +40,7 @@ const LegacyHeader: React.FC<LegacyHeaderProps> = ({
headerCampaignUrl={headerCampaignUrl}
headerCampaignImageMobile={headerCampaignImageMobile}
userEmail={userEmail}
isPlusUser={isPlusUser}
isProMember={isProMember}
/>
</Box>
Expand All @@ -50,6 +53,7 @@ const LegacyHeader: React.FC<LegacyHeaderProps> = ({
showAds={showAds}
adsPreview={adsPreview}
userEmail={userEmail}
isPlusUser={isPlusUser}
isProMember={isProMember}
userMenuItems={userMenuItems}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface LegacyMobileHeaderProps {
headerCampaignUrl: string;
headerCampaignImageMobile?: string;
userEmail?: string;
isPlusUser?: boolean;
isProMember?: boolean;
}
declare const LegacyMobileHeader: React.FC<LegacyMobileHeaderProps>;
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/LegacyHeader/LegacyMobileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface LegacyMobileHeaderProps {
headerCampaignUrl: string;
headerCampaignImageMobile?: string;
userEmail?: string;
isPlusUser?: boolean;
isProMember?: boolean;
}

Expand Down Expand Up @@ -55,6 +56,7 @@ const LegacyMobileHeader: React.FC<LegacyMobileHeaderProps> = ({
headerCampaignUrl,
headerCampaignImageMobile,
userEmail,
isPlusUser,
isProMember,
}) => {
return (
Expand Down Expand Up @@ -90,6 +92,7 @@ const LegacyMobileHeader: React.FC<LegacyMobileHeaderProps> = ({
</HeaderCampaign>
<LegacyMobileNav
userEmail={userEmail}
isPlusUser={isPlusUser}
isProMember={isProMember}
headerCampaignUrl={headerCampaignUrl}
headerCampaignImageMobile={headerCampaignImageMobile}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ export const Indicator = styled.span`

const mainNavLinkGroups: MainNavLinkGroupsType[] = [
{
label: 'Pro',
url: '/pro-artikel',
label: 'Plus',
url: '/plus-artikel',
indicator: true,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface LegacyMobileNavProps {
headerCampaignUrl: string;
headerCampaignImageMobile?: string;
userEmail?: string;
isPlusUser?: boolean;
isProMember?: boolean;
}
export type MobileNavLinksType = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
MaterialClose,
MaterialMenu,
MaterialPersonOutline,
T3nPlus,
T3nPro,
} from '@t3n/icons';
import { ThemeProps } from '@t3n/theme';
Expand All @@ -26,6 +27,7 @@ export interface LegacyMobileNavProps {
headerCampaignUrl: string;
headerCampaignImageMobile?: string;
userEmail?: string;
isPlusUser?: boolean;
isProMember?: boolean;
}

Expand Down Expand Up @@ -158,8 +160,8 @@ const SearchForm = styled.form`

const mobileNavLinks: MobileNavLinksType[] = [
{
label: 'Pro',
url: '/pro-artikel',
label: 'Plus',
url: '/plus-artikel',
indicator: false,
},
{
Expand Down Expand Up @@ -217,6 +219,7 @@ const LegacyMobileNav: React.FC<LegacyMobileNavProps> = ({
headerCampaignUrl,
headerCampaignImageMobile,
userEmail,
isPlusUser,
isProMember,
}) => {
const [menuOpen, setMenuOpen] = useState(false);
Expand Down Expand Up @@ -296,6 +299,20 @@ const LegacyMobileNav: React.FC<LegacyMobileNavProps> = ({
))}
{userEmail ? (
<>
{isPlusUser && (
<MobileMenuItem
borderTopThick
href="/account/plus"
title="t3n Plus"
>
<T3nPlus
width="22px"
height="18px"
style={{ marginRight: 8 }}
/>
Plus
</MobileMenuItem>
)}
{isProMember && (
<MobileMenuItem
borderTopThick
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { ReactNode } from 'react';
export interface LegacyT3nNavProps {
isPlusUser?: boolean;
isProMember?: boolean;
userEmail?: string;
userMenuItems?: ReactNode[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import HeaderLink from './LegacyHeaderLink';
import { MainNavDropdown } from './LegacyMainNav';

export interface LegacyT3nNavProps {
isPlusUser?: boolean;
isProMember?: boolean;
userEmail?: string;
userMenuItems?: ReactNode[];
Expand Down Expand Up @@ -119,6 +120,7 @@ const t3nNavLinks: T3nNavLinksType[] = [
];

const LegacyT3nNav: React.FC<LegacyT3nNavProps> = ({
isPlusUser,
isProMember,
userEmail,
userMenuItems,
Expand Down Expand Up @@ -156,6 +158,7 @@ const LegacyT3nNav: React.FC<LegacyT3nNavProps> = ({
</MainNavItem>
))}
<UserMenu
isPlusUser={isPlusUser}
isProMember={isProMember}
userEmail={userEmail}
light
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/LegacyNewsCard/LegacyNewsCard.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface LegacyNewsCardProps {
popular?: boolean;
sponsored?: boolean;
hero?: boolean;
pro?: boolean;
plus?: boolean;
tr?: boolean;
withImage?: boolean;
withTeaser?: boolean;
Expand All @@ -28,5 +28,5 @@ export declare const LegacyLoadingHeroCard: () => React.JSX.Element;
export declare const LegacyLoadingFeedCard: React.FC<{
withImage?: boolean;
}>;
declare const LegacyNewsCard: ({ news, loading, hero, sponsored, popular, pro, tr, withTeaser, withImage, withAuthor, isBookmarked, onBookmarkClick, }: LegacyNewsCardProps) => React.JSX.Element | null;
declare const LegacyNewsCard: ({ news, loading, hero, sponsored, popular, plus, tr, withTeaser, withImage, withAuthor, isBookmarked, onBookmarkClick, }: LegacyNewsCardProps) => React.JSX.Element | null;
export default LegacyNewsCard;
8 changes: 4 additions & 4 deletions packages/components/src/LegacyNewsCard/LegacyNewsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface LegacyNewsCardProps {
popular?: boolean;
sponsored?: boolean;
hero?: boolean;
pro?: boolean;
plus?: boolean;
tr?: boolean;
withImage?: boolean;
withTeaser?: boolean;
Expand Down Expand Up @@ -122,7 +122,7 @@ const LegacyNewsCard = ({
hero,
sponsored,
popular,
pro,
plus,
tr,
withTeaser,
withImage = true,
Expand Down Expand Up @@ -164,7 +164,7 @@ const LegacyNewsCard = ({
<LegacyNewsCardHeadline
title={news.title}
type={news.type}
pro={pro}
plus={plus}
tr={tr}
sponsored={sponsored}
/>
Expand Down Expand Up @@ -202,7 +202,7 @@ const LegacyNewsCard = ({
<LegacyNewsCardHeadline
title={news.title}
type={news.type}
pro={pro}
plus={plus}
tr={tr}
sponsored={sponsored}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface LegacyNewsCardHeadlineProps {
type: string;
title: string;
sponsored?: boolean;
pro?: boolean;
plus?: boolean;
tr?: boolean;
}
declare const LegacyNewsCardHeadline: React.FC<LegacyNewsCardHeadlineProps>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import styled from 'styled-components';
import { border, color, space, typography } from 'styled-system';

import { T3nPro } from '@t3n/icons';
import { T3nPlus } from '@t3n/icons';

import Box from '../Box';
import Heading from '../Heading';
Expand All @@ -12,7 +12,7 @@ export interface LegacyNewsCardHeadlineProps {
type: string;
title: string;
sponsored?: boolean;
pro?: boolean;
plus?: boolean;
tr?: boolean;
}

Expand Down Expand Up @@ -71,7 +71,7 @@ const LegacyNewsCardHeadline: React.FC<LegacyNewsCardHeadlineProps> = ({
type,
title,
sponsored,
pro,
plus,
tr,
}) => {
return (
Expand All @@ -82,9 +82,9 @@ const LegacyNewsCardHeadline: React.FC<LegacyNewsCardHeadlineProps> = ({
Anzeige
</SponsoredInfo>
)}
{pro && (
{plus && (
<Box display="flex" mb={1} mr={1}>
<T3nPro height="18" width="36" />
<T3nPlus height="18" width="22" />
</Box>
)}
{tr && <TRBadge>MIT Technology Review</TRBadge>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface LegacyPageLayoutProps extends LegacyHeaderProps {
adUnits?: LegacyAdName[];
previewAdUnits?: boolean;
userEmail?: string;
isPlusUser?: boolean;
isProMember?: boolean;
userMenuItems?: ReactNode[];
children?: ReactNode;
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/LegacyPageLayout/LegacyPageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface LegacyPageLayoutProps extends LegacyHeaderProps {
adUnits?: LegacyAdName[];
previewAdUnits?: boolean;
userEmail?: string;
isPlusUser?: boolean;
isProMember?: boolean;
userMenuItems?: ReactNode[];
children?: ReactNode;
Expand All @@ -35,6 +36,7 @@ const LegacyPageLayout: React.FC<LegacyPageLayoutProps> = ({
previewAdUnits,
overflow,
userEmail,
isPlusUser,
isProMember,
userMenuItems,
children,
Expand All @@ -59,6 +61,7 @@ const LegacyPageLayout: React.FC<LegacyPageLayoutProps> = ({
showAds={shouldDisplayAdUnit('T3N_D_Right')}
adsPreview={previewAdUnits}
userEmail={userEmail}
isPlusUser={isPlusUser}
isProMember={isProMember}
userMenuItems={userMenuItems}
/>
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/UserMenu/UserMenu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export interface UserMenuProps {
proMembershipLink?: string;
readingListLink?: string;
accountLink?: string;
isPlusUser?: boolean;
plusLink?: string;
isProMember?: boolean;
light?: boolean;
items?: ReactNode[];
Expand Down
Loading

0 comments on commit d97163e

Please sign in to comment.