|
1 | 1 | import React, { ForwardedRef, forwardRef } from "react";
|
2 | 2 | import { View } from "react-native";
|
3 | 3 | import { useIONewTypeface, useIOTheme } from "../../core";
|
4 |
| -import { IOFontSize, IOFontWeight } from "../../utils/fonts"; |
| 4 | +import { IOFontSize } from "../../utils/fonts"; |
5 | 5 | import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
6 | 6 |
|
7 |
| -type H3StyleProps = TypographicStyleProps & { |
8 |
| - weight?: Extract<IOFontWeight, "Semibold" | "Bold">; |
9 |
| -}; |
10 |
| - |
11 | 7 | /* Common typographic styles */
|
12 | 8 | export const h3FontSize: IOFontSize = 22;
|
13 | 9 | export const h3LineHeight = 33;
|
14 | 10 |
|
15 | 11 | /**
|
16 | 12 | * `H3` typographic style
|
17 | 13 | */
|
18 |
| -export const H3 = forwardRef<View, H3StyleProps>( |
19 |
| - ( |
20 |
| - { weight: customWeight, color: customColor, ...props }, |
21 |
| - ref?: ForwardedRef<View> |
22 |
| - ) => { |
| 14 | +export const H3 = forwardRef<View, TypographicStyleProps>( |
| 15 | + ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => { |
23 | 16 | const theme = useIOTheme();
|
24 | 17 | const { newTypefaceEnabled } = useIONewTypeface();
|
25 | 18 |
|
26 | 19 | const H3Props: IOTextProps = {
|
27 | 20 | ...props,
|
28 | 21 | dynamicTypeRamp: "title2", // iOS only
|
29 | 22 | font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
30 |
| - weight: customWeight ?? "Semibold", |
| 23 | + weight: "Semibold", |
31 | 24 | size: h3FontSize,
|
32 | 25 | lineHeight: h3LineHeight,
|
33 | 26 | color: customColor ?? theme["textHeading-default"]
|
|
0 commit comments