Skip to content

Commit

Permalink
feat: update to modal 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Zakharov committed May 2, 2022
1 parent e905a99 commit a145856
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 30 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -39,7 +39,7 @@
"@eslint-kit/eslint-config-patch": "^1.0.0",
"@eslint-kit/eslint-config-prettier": "^3.0.0",
"@eslint-kit/eslint-config-typescript": "^5.2.0",
"@react-above/modal": "^0.1.8",
"@react-above/modal": "^0.2.1",
"@testing-library/react-hooks": "^7.0.2",
"@types/jest": "^26.0.14",
"@types/react": "^16.9.23",
Expand Down
17 changes: 0 additions & 17 deletions src/extend.d.ts

This file was deleted.

26 changes: 18 additions & 8 deletions src/index.ts
@@ -1,23 +1,33 @@
import { createTheme } from '@react-above/modal'
import { createTheme, ModalFC } from '@react-above/modal'
import { Frame } from './frame'
import { Body } from './body'
import { Close } from './close'
import { Header } from './header'
import { HeaderBox } from './header-box'
import { Surface } from './surface'
import { Title } from './title'
import './extend.d'

export type DefaultModal = ModalFC & {
Surface: typeof Surface
Header: typeof Header
HeaderBox: typeof HeaderBox
Title: typeof Title
Close: typeof Close
Body: typeof Body
}

export const ThemeDefault = createTheme({
build: () => ({
frame: Frame,
extend: (modal) => {
modal.Surface = Surface
modal.Header = Header
modal.HeaderBox = HeaderBox
modal.Title = Title
modal.Close = Close
modal.Body = Body
const compound = modal as DefaultModal
compound.Surface = Surface
compound.Header = Header
compound.HeaderBox = HeaderBox
compound.Title = Title
compound.Close = Close
compound.Body = Body
return compound
},
}),
})
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -649,10 +649,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@react-above/modal@^0.1.8":
version "0.1.8"
resolved "https://registry.yarnpkg.com/@react-above/modal/-/modal-0.1.8.tgz#785b29424ed8e0d2a41dcf7e1e856df2e0fe52b0"
integrity sha512-3T4RcHANcDyTvA8M9Ss1ExxAuAblZIMwBtJx49tfeHrqZ4ABRH/NMsTYaayQmdgf5OG0sm1l2l6e0S6Ce/ufAg==
"@react-above/modal@^0.2.1":
version "0.2.1"
resolved "https://registry.yarnpkg.com/@react-above/modal/-/modal-0.2.1.tgz#0d289199d84d0d6db3f420db49efe294c407699a"
integrity sha512-gCREyZP8nL7Ja9VF+HMo8I7BhEeggYqdROBpWdWQiYOb145ugS4+mq51VGJwpk/8vPT08hDD61+727WPmfZqeg==
dependencies:
"@types/body-scroll-lock" "^3.1.0"
body-scroll-lock "^4.0.0-beta.0"
Expand Down

0 comments on commit a145856

Please sign in to comment.