Skip to content

Commit

Permalink
Make clearer the responsibilities of 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 06f5b4a commit 6197fd0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
@@ -0,0 +1,6 @@
import { ClientClassification } from './client-classification';
import { HtmlPageHead } from '../../html-page';

export type DynamicHeadViewModel = HtmlPageHead & {
clientClassification: ClientClassification,
};
6 changes: 1 addition & 5 deletions src/read-side/html-pages/shared-components/head/head.ts
Expand Up @@ -2,14 +2,10 @@ import { htmlEscape } from 'escape-goat';
import * as O from 'fp-ts/Option';
import { pipe } from 'fp-ts/function';
import { ClientClassification } from './client-classification';
import { DynamicHeadViewModel } from './dynamic-head-view-model';
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 DynamicHeadViewModel = HtmlPageHead & {
clientClassification: ClientClassification,
};

const renderWithClientClassification = (headTagContents: string, clientClassification: ClientClassification) => `
<head data-user-agent="${htmlEscape(clientClassification.userAgent ?? '')}">
Expand Down
3 changes: 2 additions & 1 deletion src/read-side/html-pages/shared-components/head/index.ts
@@ -1,2 +1,3 @@
export { DynamicHeadViewModel, head } from './head';
export { ClientClassification } from './client-classification';
export { DynamicHeadViewModel } from './dynamic-head-view-model';
export { head } from './head';

0 comments on commit 6197fd0

Please sign in to comment.