Skip to content

Commit

Permalink
Better encapulate the head shared component #3229
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcmoulton committed May 8, 2024
1 parent b668174 commit 2137b78
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/http/detect-client-classification.ts
@@ -1,5 +1,5 @@
import { ParameterizedContext } from 'koa';
import { ClientClassification } from '../shared-components/head';
import { ClientClassification } from '../read-side/html-pages/shared-components/head';

export const detectClientClassification = (context: ParameterizedContext): ClientClassification => ({
userAgent: context.req.headers['user-agent'],
Expand Down
2 changes: 1 addition & 1 deletion src/read-side/html-pages/construct-html-response.ts
Expand Up @@ -5,9 +5,9 @@ import { CompleteHtmlDocument } from './complete-html-document';
import { HtmlPage, toHtmlPage } from './html-page';
import { PageLayout } from './page-layout';
import { renderOopsMessage } from './render-oops-message';
import { ClientClassification } from './shared-components/head';
import { standardPageLayout } from './shared-components/standard-page-layout';
import { wrapInHtmlDocument } from './wrap-in-html-document';
import { ClientClassification } from '../../shared-components/head';
import * as DE from '../../types/data-error';
import { ErrorPageBodyViewModel } from '../../types/error-page-body-view-model';
import { UserDetails } from '../../types/user-details';
Expand Down
@@ -1,10 +1,10 @@
import { htmlEscape } from 'escape-goat';
import * as O from 'fp-ts/Option';
import { pipe } from 'fp-ts/function';
import { fathom, googleTagManager } from './analytics';
import { HtmlPageHead } from '../read-side/html-pages/html-page';
import { HtmlFragment, toHtmlFragment } from '../types/html-fragment';
import { UserId } from '../types/user-id';
import { fathom, googleTagManager } from '../../../../shared-components/analytics';
import { HtmlFragment, toHtmlFragment } from '../../../../types/html-fragment';
import { UserId } from '../../../../types/user-id';
import { HtmlPageHead } from '../../html-page';

export type ClientClassification = {
userAgent: string | undefined,
Expand Down
1 change: 1 addition & 0 deletions src/read-side/html-pages/shared-components/head/index.ts
@@ -0,0 +1 @@
export { ClientClassification, DynamicHeadViewModel, head } from './head';
2 changes: 1 addition & 1 deletion src/read-side/html-pages/to-default-error-html-document.ts
Expand Up @@ -3,8 +3,8 @@ import * as O from 'fp-ts/Option';
import { pipe } from 'fp-ts/function';
import { CompleteHtmlDocument } from './complete-html-document';
import { constructHtmlResponse } from './construct-html-response';
import { ClientClassification } from './shared-components/head';
import { standardPageLayout } from './shared-components/standard-page-layout';
import { ClientClassification } from '../../shared-components/head';
import * as DE from '../../types/data-error';
import { toErrorPageBodyViewModel } from '../../types/error-page-body-view-model';
import { toHtmlFragment } from '../../types/html-fragment';
Expand Down
2 changes: 1 addition & 1 deletion src/read-side/html-pages/wrap-in-html-document.ts
Expand Up @@ -2,8 +2,8 @@ import * as O from 'fp-ts/Option';
import { pipe } from 'fp-ts/function';
import { CompleteHtmlDocument, toCompleteHtmlDocument } from './complete-html-document';
import { ContentWrappedInLayout } from './content-wrapped-in-layout';
import { DynamicHeadViewModel, head } from './shared-components/head';
import { googleTagManagerNoScript } from '../../shared-components/analytics';
import { DynamicHeadViewModel, head } from '../../shared-components/head';
import { UserDetails } from '../../types/user-details';

const serverStartupTimestamp = new Date();
Expand Down

0 comments on commit 2137b78

Please sign in to comment.