Skip to content

Commit 33282e2

Browse files
authored
Merge pull request #977 from primer/cb/ts-pagehead
Migrate Pagehead to TypeScript
2 parents 9f76c5d + 755a1a5 commit 33282e2

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.changeset/slimy-rats-mix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/components": patch
3+
---
4+
5+
Migrate `Pagehead` to TypeScript

src/Pagehead.js renamed to src/Pagehead.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import PropTypes from 'prop-types'
22
import styled from 'styled-components'
3-
import {COMMON, get} from './constants'
3+
import {COMMON, get, SystemCommonProps} from './constants'
4+
import sx, {SxProp} from './sx'
45
import theme from './theme'
5-
import sx from './sx'
66

7-
const Pagehead = styled.div`
7+
const Pagehead = styled.div<SystemCommonProps & SxProp>`
88
position: relative;
99
padding-top: ${get('space.4')};
1010
padding-bottom: ${get('space.4')};
@@ -24,4 +24,5 @@ Pagehead.propTypes = {
2424
...sx.propTypes
2525
}
2626

27+
export type PageheadProps = React.ComponentProps<typeof Pagehead>
2728
export default Pagehead
File renamed without changes.

0 commit comments

Comments
 (0)