-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(controlbar): 🎉 add controlbar with functions flow
- Loading branch information
1 parent
eb8072e
commit 2d99c8c
Showing
11 changed files
with
56 additions
and
34 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 |
---|---|---|
|
@@ -4,7 +4,6 @@ on: | |
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ReactElement } from "react"; | ||
import { MdKeyboardArrowDown, MdKeyboardArrowUp } from "react-icons/md"; | ||
|
||
interface IControlBarArrow { | ||
isOpened: boolean; | ||
onClick: () => void; | ||
} | ||
|
||
export default function ControlBarArrow({ | ||
isOpened, | ||
onClick, | ||
}: IControlBarArrow): ReactElement { | ||
return ( | ||
<button | ||
onClick={onClick} | ||
className="flex items-center justify-center border border-gray-200 bg-white py-0.5 px-2 rounded-t cursor-pointer" | ||
> | ||
{isOpened ? <MdKeyboardArrowDown /> : <MdKeyboardArrowUp />} | ||
</button> | ||
); | ||
} |
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,23 +1,17 @@ | ||
import { MdKeyboardArrowDown, MdKeyboardArrowUp } from "react-icons/md"; | ||
import WebsocketInput from "../WebsocketInput/WebsocketInput"; | ||
import ControlBarArrow from "../ControBarArrow/ControBarArrow"; | ||
import ControlBarBody from "../ControlBarBody/ControlBarBody"; | ||
import { ReactElement, useState } from "react"; | ||
|
||
export default function ControlBar(): ReactElement { | ||
const [isOpened, setIsOpened] = useState<boolean>(false); | ||
|
||
return ( | ||
<div className="absolute bottom-0 left-1/2 right-1/2 flex flex-col items-center"> | ||
<button | ||
<ControlBarArrow | ||
isOpened={isOpened} | ||
onClick={() => setIsOpened(!isOpened)} | ||
className="flex items-center justify-center bg-slate-50 py-0.5 px-2 rounded-t cursor-pointer border border-slate-300" | ||
> | ||
{isOpened ? <MdKeyboardArrowDown /> : <MdKeyboardArrowUp />} | ||
</button> | ||
{isOpened && ( | ||
<div className="flex gap-4 bg-slate-50 py-2 px-4 rounded-t border border-slate-300"> | ||
<WebsocketInput /> | ||
</div> | ||
)} | ||
/> | ||
{isOpened && <ControlBarBody />} | ||
</div> | ||
); | ||
} |
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,10 @@ | ||
import { ReactElement } from "react"; | ||
import WebsocketInput from "../WebsocketInput/WebsocketInput"; | ||
|
||
export default function ControlBarBody(): ReactElement { | ||
return ( | ||
<div className="flex gap-4 bg-white py-2 px-4 rounded-t border border-gray-200"> | ||
<WebsocketInput /> | ||
</div> | ||
); | ||
} |
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
File renamed without changes.