Merge pull request #2154 from omnivore-app/fix/title-size

Reduce the title font size
This commit is contained in:
Jackson Harper 2023-05-02 14:21:22 +08:00 committed by GitHub
commit 1970e18ddd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 20 deletions

View file

@ -60,9 +60,9 @@ const textVariants = {
},
articleTitle: {
fontWeight: 'bold',
fontSize: '32px',
'@md': {
fontSize: '47px',
fontSize: '35px',
'@mdDown': {
fontSize: '25px',
},
margin: 0,
},

View file

@ -40,14 +40,28 @@ export function ArticleSubtitle(props: ArticleSubtitleProps): JSX.Element {
}
type ReaderSavedInfoProps = {
wordsCount?: number
rawDisplayDate: string
}
export function ReaderSavedInfo(props: ReaderSavedInfoProps): JSX.Element {
return (
<Box>
<StyledText css={{ wordBreak: 'break-word', fontSize: '15' }}>
<StyledText
css={{
wordBreak: 'break-word',
fontSize: '15',
color: '$thTextSubtle2',
fontFamily: '$inter',
}}
>
{formattedLongDate(props.rawDisplayDate)}{' '}
{props.wordsCount ?? 0 > 0
? `${Math.max(
1,
Math.round((props.wordsCount ?? 0) / 235)
)} min read`
: null}
</StyledText>
</Box>
)

View file

@ -118,21 +118,16 @@ export function ArticleContainer(props: ArticleContainerProps): JSX.Element {
props.highlightOnRelease
)
// iOS app embed can overide the original margin and line height
const [maxWidthPercentageOverride, setMaxWidthPercentageOverride] = useState<
number | null
>(null)
const [lineHeightOverride, setLineHeightOverride] = useState<number | null>(
null
)
const [fontFamilyOverride, setFontFamilyOverride] = useState<string | null>(
null
)
const [highContrastTextOverride, setHighContrastTextOverride] = useState<
boolean | undefined
>(undefined)
const [justifyTextOverride, setJustifyTextOverride] = useState<
boolean | undefined
>(undefined)
const [maxWidthPercentageOverride, setMaxWidthPercentageOverride] =
useState<number | null>(null)
const [lineHeightOverride, setLineHeightOverride] =
useState<number | null>(null)
const [fontFamilyOverride, setFontFamilyOverride] =
useState<string | null>(null)
const [highContrastTextOverride, setHighContrastTextOverride] =
useState<boolean | undefined>(undefined)
const [justifyTextOverride, setJustifyTextOverride] =
useState<boolean | undefined>(undefined)
const highlightHref = useRef(
window.location.hash ? window.location.hash.split('#')[1] : null
)
@ -403,6 +398,7 @@ export function ArticleContainer(props: ArticleContainerProps): JSX.Element {
rawDisplayDate={
props.article.publishedAt ?? props.article.createdAt
}
wordsCount={props.article.wordsCount}
/>
<StyledText
style="articleTitle"

View file

@ -270,7 +270,7 @@ const darkThemeSpec = {
thBorderColor: '#4F4F4F',
thBorderSubtle: '#6A6968',
thProgressFg: '#FFEA9F',
thProgressFg: '#FFD234',
thHighContrast: '#D9D9D9',
},

View file

@ -20,6 +20,7 @@ export const articleFragment = gql`
description
linkId
state
wordsCount
}
`

View file

@ -48,6 +48,7 @@ export type ArticleAttributes = {
createdAt: string
publishedAt?: string
description?: string
wordsCount?: number
contentReader: ContentReader
readingProgressPercent: number
readingProgressTopPercent?: number