-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some Release Fixes + Component Improvements (#147)
- Loading branch information
Showing
7 changed files
with
83 additions
and
51 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,19 @@ | ||
import {useState} from 'react'; | ||
|
||
import { | ||
useFloating, | ||
autoUpdate, | ||
offset, | ||
flip, | ||
shift, | ||
} from '@floating-ui/react'; | ||
import Popper from '~/components/tools/Popper/Popper'; | ||
|
||
const Dropdown = ({list=[], selected}) => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
// todo | ||
const {refs, floatingStyles, context} = useFloating({ | ||
open: isOpen, | ||
onOpenChange: setIsOpen, | ||
middleware: [offset(10), flip(), shift()], | ||
whileElementsMounted: autoUpdate, | ||
}); | ||
|
||
return <div>Dropdown</div>; | ||
const PopElem = () => { | ||
return <ul className='bg-white px-2 py-2 shadow-lg rounded-md'> | ||
{list.map((item, index) => { | ||
return <li key={index}>{item.value}</li>; | ||
})} | ||
</ul>; | ||
}; | ||
return <div> | ||
<Popper open={true} placement="bottom-start" popperName="dropdown" pop={<PopElem/>}> | ||
<span>Dropdown</span> | ||
</Popper> | ||
</div>; | ||
}; | ||
|
||
export default Dropdown; |
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