Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions src/components/ContentTags/Inline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
CardProps
} from 'src/components/Card'
import { LinkContext } from 'src/components/ContentTags/Links'
import { InlineHighlightType } from 'src/types/ContentTagTypes'

export type InlineHighlightType = 'white' | 'none' | 'blue' | 'pink'

interface HighlightContextProps {
inHighlightType: InlineHighlightType
Expand Down Expand Up @@ -47,7 +48,7 @@ export const Italic = (props: JSX.IntrinsicElements['span']) => (
/>
)

export const Strong = ({
export const HighlightBold = ({
highlightType,
...props
}: {
Expand All @@ -74,9 +75,7 @@ export const Strong = ({
css={[
css`
font-weight: bold;
background: ${highlightType === 'yellow'
? colors('yellow100')
: highlightType === 'blue'
background: ${highlightType === 'blue'
? mix(color, colors('blue50'))
: highlightType === 'white'
? colors('white')
Expand All @@ -101,11 +100,11 @@ export const Strong = ({
}
}

Strong.defaultProps = {
HighlightBold.defaultProps = {
highlightType: 'default'
}

export const Em = ({
export const Highlight = ({
highlightType,
...props
}: {
Expand All @@ -132,8 +131,6 @@ export const Em = ({
font-style: normal;
background: ${highlightType === 'pink'
? colors('pink50')
: highlightType === 'yellow'
? colors('yellow100')
: highlightType === 'blue'
? mix(color, colors('blue50'))
: highlightType === 'white'
Expand All @@ -157,6 +154,6 @@ export const Em = ({
}
}

Em.defaultProps = {
Highlight.defaultProps = {
highlightType: 'default'
}
7 changes: 6 additions & 1 deletion src/components/ContentTags/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
export { Ul, Ol, OlLi, UlLi } from 'src/components/ContentTags/List'
export { P, PFullWidth } from 'src/components/ContentTags/P'
export { Hr } from 'src/components/ContentTags/Hr'
export { Strong, Em, Bold, Italic } from 'src/components/ContentTags/Inline'
export {
HighlightBold,
Highlight,
Bold,
Italic
} from 'src/components/ContentTags/Inline'
export { ExternalLink, InternalLink } from 'src/components/ContentTags/Links'
export { H3 } from 'src/components/ContentTags/Headings'
export { Img } from 'src/components/ContentTags/Img'
Expand Down
6 changes: 3 additions & 3 deletions src/components/EmojiWithText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { VariableNames } from 'src/types/VariableNames'
import Emoji, { EmojiProps } from 'src/components/Emoji'
import emojiLabelMapping from 'src/lib/emojiLabelMapping'
import letterEmojiMapping from 'src/lib/letterEmojiMapping'
import { Em } from 'src/components/ContentTags'
import { Highlight } from 'src/components/ContentTags'
import BubbleQuoteContext from 'src/components/BubbleQuoteContext'

interface EmojiWithTextProps {
Expand All @@ -20,9 +20,9 @@ const EmojiWithText = ({ letter, size }: EmojiWithTextProps) => {
throw new Error()
}
return (
<Em highlightType={inQuote ? 'blue' : 'white'}>
<Highlight highlightType={inQuote ? 'blue' : 'white'}>
{label[locale]} <Emoji size={size}>{emoji}</Emoji>{' '}
</Em>
</Highlight>
)
}

Expand Down
Loading