File tree 2 files changed +25
-39
lines changed
packages/@sanity/field/src/types/portableText/diff/components
2 files changed +25
-39
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { Heading } from '@sanity/ui'
1
2
import React from 'react'
2
- import styles from './Header.css'
3
+ import styled from 'styled-components'
4
+
5
+ const headingSizes = {
6
+ h1 : 2 ,
7
+ h2 : 1 ,
8
+ h3 : 0 ,
9
+ h4 : 0 ,
10
+ h5 : 0 ,
11
+ h6 : 0 ,
12
+ }
13
+
14
+ const StyledHeading = styled ( Heading ) `
15
+ &:not([hidden]) {
16
+ display: inline;
17
+ text-transform: none;
18
+ margin: 0;
19
+
20
+ &::before,
21
+ &::after {
22
+ content: unset;
23
+ }
24
+ }
25
+ `
3
26
4
27
export default function Header ( {
5
28
style,
@@ -8,5 +31,5 @@ export default function Header({
8
31
style : string
9
32
children : React . ReactNode
10
33
} ) : JSX . Element {
11
- return < div className = { styles [ style ] } > { children } </ div >
34
+ return < StyledHeading size = { headingSizes [ style ] } > { children } </ StyledHeading >
12
35
}
You can’t perform that action at this time.
0 commit comments