-
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.
Merge branch 'master' of https://github.com/hyundai-autoever-first-pr…
- Loading branch information
Showing
3 changed files
with
73 additions
and
2 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,29 @@ | ||
import React from 'react'; | ||
import { ReactSVG } from 'react-svg'; | ||
import Arrowdown from '../../assets/Arrow down.svg'; | ||
|
||
const Dropdown = ({ options, placeholder }) => { | ||
return ( | ||
<div className="relative w-full"> | ||
<select className="w-full px-4 py-2 text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm appearance-none focus:outline-none focus:ring-1 focus:ring-orange-200"> | ||
<option value="" disabled selected hidden> | ||
{placeholder} | ||
</option> | ||
{options.map((option, index) => ( | ||
<option key={index}>{option}</option> | ||
))} | ||
</select> | ||
<div className="absolute inset-y-0 flex items-center px-2 pointer-events-none right-1"> | ||
<ReactSVG | ||
src={Arrowdown} | ||
beforeInjection={(svg) => { | ||
svg.classList.add('text-gray-700'); | ||
svg.setAttribute('style', 'fill: currentColor'); | ||
}} | ||
/> | ||
</div> | ||
</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
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