-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recoil installation and defining global states (#417)
* created tag modal component * added recoil in root.components.tsx * feat: define recoil state Co-authored-by: Kyoungjun Han <[email protected]>
- Loading branch information
1 parent
47b4d3d
commit fda43bd
Showing
6 changed files
with
106 additions
and
3 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
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,74 @@ | ||
import React from "react"; | ||
import { useState, useEffect } from "react"; | ||
|
||
const TagsModal = () => { | ||
const [show, setShow] = useState(false); | ||
|
||
const handleClose = () => setShow(false); | ||
const handleShow = () => setShow(true); | ||
|
||
|
||
const tags: Array<string> = ["tag1", "tag2", "tag3"]; | ||
const [selectedTags, setSelectedTags] = useState([]); | ||
|
||
return ( | ||
<> | ||
<button | ||
type="button" | ||
className="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out" | ||
data-bs-toggle="modal" | ||
data-bs-target="#staticBackdrop" | ||
onClick={handleShow} | ||
> | ||
Choose Tags | ||
</button> | ||
|
||
<div | ||
className="modal fade fixed top-0 left-0 hidden w-full h-full outline-none overflow-x-hidden overflow-y-auto" | ||
id="staticBackdrop" | ||
data-bs-backdrop="static" | ||
data-bs-keyboard="false" | ||
tabIndex={-1} | ||
aria-labelledby="staticBackdropLabel" | ||
aria-hidden="true" | ||
> | ||
<div className="modal-dialog relative w-auto pointer-events-none"> | ||
<div className="modal-content border-none shadow-lg relative flex flex-col w-full pointer-events-auto bg-white bg-clip-padding rounded-md outline-none text-current"> | ||
<div className="modal-header flex flex-shrink-0 items-center justify-between p-4 border-b border-gray-200 rounded-t-md"> | ||
<h5 | ||
className="text-xl font-medium leading-normal text-gray-800" | ||
id="exampleModalLabel" | ||
> | ||
Choose Your Tags | ||
</h5> | ||
<button | ||
type="button" | ||
className="btn-close box-content w-4 h-4 p-1 text-black border-none rounded-none opacity-50 focus:shadow-none focus:outline-none focus:opacity-100 hover:text-black hover:opacity-75 hover:no-underline" | ||
data-bs-dismiss="modal" | ||
aria-label="Close" | ||
></button> | ||
</div> | ||
<div className="modal-body relative p-4">...</div> | ||
<div className="modal-footer flex flex-shrink-0 flex-wrap items-center justify-end p-4 border-t border-gray-200 rounded-b-md"> | ||
<button | ||
type="button" | ||
className="inline-block px-6 py-2.5 bg-purple-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-purple-700 hover:shadow-lg focus:bg-purple-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-purple-800 active:shadow-lg transition duration-150 ease-in-out" | ||
data-bs-dismiss="modal" | ||
> | ||
Close | ||
</button> | ||
<button | ||
type="button" | ||
className="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out ml-1" | ||
> | ||
Apply | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default TagsModal; |
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,6 @@ | ||
export interface AtomOptions<T> { | ||
key: NodeKey; | ||
default: RecoilValue<T> | Promise<T> | T; | ||
effects_UNSTABLE?: ReadonlyArray<AtomEffect<T>>; | ||
dangerouslyAllowMutability?: boolean; | ||
} |
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,16 @@ | ||
import { atom } from "recoil"; | ||
|
||
export const currentBoardIdState = atom<string>({ | ||
key: "currentBoardId", | ||
default: "Default Board", | ||
}); | ||
|
||
export const currentTagsState = atom<string[]>({ | ||
key: "currentTags", | ||
default: [], | ||
}); | ||
|
||
export const currentGroupsState = atom<string[]>({ | ||
key: "currentGroups", | ||
default: [], | ||
}); |
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