-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
217 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Mobx React Form Devtools | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
CI: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- run: npm install --force | ||
- run: npm run cover | ||
- run: npm run coverage:check | ||
- run: npm run build | ||
- run: npm run coverage:report | ||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,55 @@ | ||
import React from 'react'; | ||
import React, { useRef } from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import cx from 'classnames'; | ||
import Draggable from 'react-draggable'; | ||
// import Draggable from 'react-draggable'; | ||
|
||
import { | ||
FaBars, | ||
FaChevronLeft, | ||
FaBook, | ||
FaWindows, | ||
} from '../icons'; | ||
|
||
import $U from '../styles/_.utils'; | ||
import style from '../styles/Draggable'; | ||
|
||
export default observer(({ handlers }) => ( | ||
<Draggable | ||
axis="y" | ||
handle=".devtools-handle-drag" | ||
defaultPosition={{ x: 0, y: 0 }} | ||
> | ||
<div> | ||
<div className={cx(style.draggable)}> | ||
<div className="devtools-handle-drag"> | ||
<FaBars className={cx(style.icon, style.dragIcon)} /> | ||
</div> | ||
<button | ||
className={cx($U.button, style.btn)} | ||
onClick={handlers.handleOnOpenTools} | ||
> | ||
<FaChevronLeft className={style.icon} /> | ||
</button> | ||
<button | ||
className={cx($U.button, style.btn)} | ||
onClick={handlers.handleOnOpenDoc} | ||
> | ||
<FaBook className={style.icon} /> | ||
</button> | ||
</div> | ||
export default observer(({ handlers }) => { | ||
|
||
const handleOnDragEnd = (e) => { | ||
e.target.style.top = (e.clientY - 100) + "px"; | ||
}; | ||
|
||
return ( | ||
// <div | ||
// axis="y" | ||
// handle=".devtools-handle-drag" | ||
// defaultPosition={{ x: 0, y: 0 }} | ||
// > | ||
<div className={cx(style.draggable)} draggable onDragEnd={handleOnDragEnd}> | ||
<button className={cx($U.button, style.dragButton)}> | ||
<FaBars className={cx(style.icon, style.dragIcon)} /> | ||
</button> | ||
<button | ||
className={cx($U.button, style.btn)} | ||
onClick={handlers.handleOnOpenTools} | ||
title="Open Tools" | ||
> | ||
<FaChevronLeft className={style.icon} /> | ||
</button> | ||
<button | ||
className={cx($U.button, style.btn)} | ||
onClick={handlers.handleOpenInWindow} | ||
title="Open in new Window" | ||
> | ||
<FaWindows className={style.icon} /> | ||
</button> | ||
<button | ||
className={cx($U.button, style.btn)} | ||
onClick={handlers.handleOnOpenDoc} | ||
title="Open Documentation" | ||
> | ||
<FaBook className={style.icon} /> | ||
</button> | ||
</div> | ||
</Draggable> | ||
)); | ||
// </Draggable> | ||
)}); |
Oops, something went wrong.