Skip to content

Commit

Permalink
fix/adjust-types-publishDate
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodolfo Ensides committed Jan 22, 2024
1 parent edcb80a commit 5f7cb91
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
8 changes: 2 additions & 6 deletions packages/xprog-prensa/news/Teaser/PublishedDate/component.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
import React from 'react'

import { Link } from '../../../primitives/Link'
import * as S from './styles'
import * as t from './types'

const PublishedDate: React.FC<t.DateProps> = ({
children,
css,
customLink,
customLinkProps,
customProps,
publishedDate,
linkProps,
path,
variant
}) => {
let variantCss: t.PublishedDateCSSType = {}
return (
<S.Container
css={css}
customProps={customProps}
>
<S.Text variant={variant}>
<S.Text css={variantCss} variant={variant}>

{publishedDate || children}

Expand Down
9 changes: 3 additions & 6 deletions packages/xprog-prensa/news/Teaser/PublishedDate/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { PrensaEngineTypeof } from '@xprog/prensa-system'

import { LinkProps } from '../../../primitives/Link/types'
import { BlockType, CSSType, CSSVariant, ContainerDefaultProps } from '../types'

Expand All @@ -9,18 +7,17 @@ interface DateContainerProps extends ContainerDefaultProps {
}

interface DateProps extends DateContainerProps {
customLink?: any;
css?: CSSType;
customLinkProps?: LinkProps;
linkProps?: LinkProps;
path?: string;
publishedDate?: string;
variant?: CSSVariant;
}

type PublishedDateCSSType = CSSType;
type PublishedDateVariant = CSSVariant

export {
DateContainerProps,
DateProps,
PublishedDateCSSType,
PublishedDateVariant
}
7 changes: 2 additions & 5 deletions packages/xprog-prensa/news/Teaser/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const Teaser: React.FC<t.TeaserProps> = ({
titleVariant,
wrapImage,
publishedDate,
publishedDateCSS,
publishedDateVariant
}) => {
const TeaserNumber: React.FC<t.NumberProps> | undefined = components?.number
Expand Down Expand Up @@ -96,11 +97,7 @@ const Teaser: React.FC<t.TeaserProps> = ({

const TeaserPublishedDate: React.FC<t.DateProps> | undefined = components?.publishedDate
const TeaserPublishedDateProps: t.DateProps = {
customLink,
customLinkProps,
css: subjectCss,
linkProps,
path,
css: publishedDateCSS,
publishedDate,
variant: publishedDateVariant
}
Expand Down
1 change: 1 addition & 0 deletions packages/xprog-prensa/news/Teaser/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ interface TeaserProps extends TeaserDefaultProps, TeaserStyledProps {
subjectBgColor?: CSSColorType;
subjectColor?: CSSColorType;
subjectCss?: CSSType;
publishedDateCSS?: CSSType;
subjectTextVariant?: CSSVariant;
subjectVariant?: SubjectVariant;
subtitle?: string;
Expand Down

0 comments on commit 5f7cb91

Please sign in to comment.