Skip to content

Commit

Permalink
refactor(features): change feature split structure (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
onetdev authored Nov 29, 2024
1 parent 872ac66 commit cced6b1
Show file tree
Hide file tree
Showing 29 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/molecules/MarqueeText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Link from 'next/link';
import { FunctionComponent, useState } from 'react';
import MarqueePlugin from 'react-fast-marquee';

import { ArticleService } from '@/features/articles';
import { ArticleService } from '@/features/content';
import { useRuntimeStore } from '@/lib/state/runtime';

export type MarqueeTextProps = {
Expand Down
6 changes: 4 additions & 2 deletions src/components/templates/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import CookieBar from '@/components/organisms/CookieConsent';
import Footer from '@/components/organisms/Footer';
import Header from '@/components/organisms/Header';
import { ChatBubbleHost } from '@/features/chat_bubble';
import { DeadPixelHost } from '@/features/dead_pixel';
import { ContainerGiftFlaps } from '@/features/gifts';
import { AdblockerSuspectBar } from '@/features/gifts';
import { StickyVideoExperienceHost } from '@/features/sticky_video';
import {
DeadPixelHost,
StickyVideoExperienceHost,
} from '@/features/obstruction_decor';
import { WheelOfFortuneHost } from '@/features/wheel_of_fortune';
import { useExperienceFlagsStore } from '@/lib/state/experience_flags';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Head from 'next/head';
import { useEffect, useState } from 'react';

import string_marquee from '@/features/page_title/utils/string_marquee';
import { string_marquee } from '@/features/browser_core';

type MarqueeTitleProps = {
enabled: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { default as useContextMenu } from './hooks/useContextMenu';
export { default as PageTitleExperienceHost } from './PageTitleExperienceHost';
export { default as string_marquee } from './utils/string_marquee';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @jest-environment jsdom
*/
import string_marquee from '@/features/page_title/utils/string_marquee';
import { string_marquee } from '@/features/browser_core';

describe('String Marquee', () => {
const base = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FunctionComponent } from 'react';

import { type ArticleDatum, TextListItem } from '@/features/articles';
import { type ArticleDatum, TextListItem } from '@/features/content';

type DenseTextListProps = JSXProxyProps<'ul'> & {
items: ArticleDatum[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FunctionComponent } from 'react';

import { CoverPlaceholder } from './CoverPlaceholder';

import { type ArticleDatum } from '@/features/articles';
import { type ArticleDatum } from '@/features/content';

type LargeCoverItemProps = JSXProxyProps<'div'> & {
article: ArticleDatum;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FunctionComponent } from 'react';

import { CoverPlaceholder } from './CoverPlaceholder';

import { type ArticleDatum } from '@/features/articles';
import { type ArticleDatum } from '@/features/content';

type SmallCoverListItemProps = {
article: ArticleDatum;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from 'next/link';
import { FunctionComponent } from 'react';

import { type ArticleDatum } from '@/features/articles';
import { type ArticleDatum } from '@/features/content';

type TextListItemProps = {
article: ArticleDatum;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export { LargeCoverItem } from './components/LargeCoverItem';
export { SmallCoverListItem } from './components/SmallCoverListItem';
export { TextListItem } from './components/TextListItem';
export { ArticleServiceSingleton as ArticleService } from './services/ArticleService';
export { default as PartitionalLockedContent } from './components/PartitionalLockedContent';
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ArticleLookupIdentifier,
ArticleSearchFilter,
ArticleSearchResult,
} from '@/features/articles';
} from '@/features/content';
import { ArticleIndexEntrySchema } from '@/lib/schemas/article-index-entry';
import { fuzzy_search } from '@/lib/utils/string';
import articlesRaw from '@/public/assets/articles/index.json';
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion src/features/content_limiter/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/features/context_menu/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/features/dead_pixel/index.ts

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default as StickyVideoExperienceHost } from './StickyVideoExperienceHost';
export { default as DeadPixelHost } from './DeadPixelHost';
4 changes: 2 additions & 2 deletions src/lib/providers/ExperienceProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { FunctionComponent, PropsWithChildren, useEffect } from 'react';
import { useBeforeUnload } from 'react-use';

import CopyMarker from '@/components/atoms/CopyMarker';
import { useContextMenu } from '@/features/context_menu';
import { useContextMenu } from '@/features/browser_core';
import { PageTitleExperienceHost } from '@/features/browser_core';
import useAdblockerDetector from '@/features/gifts/hooks/useAdblockerDetector';
import { NewsletterModalExperienceHost } from '@/features/newsletter';
import { NotificationPermissionExperienceHost } from '@/features/notification';
import { PageTitleExperienceHost } from '@/features/page_title';
import { useExperienceFlagsStore } from '@/lib/state/experience_flags';
import { useUserGrantsStore } from '@/lib/state/user_grants';

Expand Down
3 changes: 1 addition & 2 deletions src/pages/articles/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import Head from 'next/head';
import Image from 'next/image';
import { useTranslation } from 'next-i18next';

import { ArticleService } from '@/features/articles';
import { PartitionalLockedContent } from '@/features/content_limiter';
import { ArticleService, PartitionalLockedContent } from '@/features/content';
import { useExperienceFlagsStore } from '@/lib/state/experience_flags';
import { getI18nProps } from '@/lib/utils/i18n';
import styles from '@/styles/content.module.css';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
DenseTextList,
LargeCoverItem,
SmallCoverListItem,
} from '@/features/articles';
} from '@/features/content';
import { OneByOneGift } from '@/features/gifts';
import { makeI18nStaticProps } from '@/lib/utils/i18n';

Expand Down
2 changes: 1 addition & 1 deletion src/pages/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import DotDotDotText from '@/components/atoms/DotDotDotText';
import PageHeadline from '@/components/atoms/PageHeadline';
import SiteTitle from '@/components/atoms/SiteTitle';
import SearchForm from '@/components/organisms/SearchForm';
import { ArticleSearchResult, ArticleService } from '@/features/articles';
import { ArticleSearchResult, ArticleService } from '@/features/content';
import { useExperienceFlagsStore } from '@/lib/state/experience_flags';
import { arrayShuffle } from '@/lib/utils/array';
import { makeI18nStaticProps } from '@/lib/utils/i18n';
Expand Down

0 comments on commit cced6b1

Please sign in to comment.