-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #507 from Riddhi162/riddhi
Made the user section responsive for mobile view
- Loading branch information
Showing
4 changed files
with
136 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.custom-dropdown { | ||
position: relative; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 5px 5px; | ||
background-color: rgba(217, 148, 249, 0.519); | ||
} | ||
|
||
.custom-dropdown-header { | ||
display: flex; | ||
width: 400px; | ||
height: 100%; | ||
justify-content: space-between; | ||
align-items: center; | ||
cursor: pointer; | ||
margin: 0px; | ||
padding: 10px; | ||
|
||
background-color: rgb(248, 235, 255); | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
} | ||
|
||
.custom-dropdown-selected { | ||
flex-grow: 1; | ||
} | ||
|
||
.custom-dropdown-arrow { | ||
margin-left: 10px; | ||
} | ||
|
||
.custom-dropdown-options { | ||
position: absolute; | ||
top: 100%; | ||
left: 0; | ||
right: 0; | ||
z-index: 10; | ||
background-color: rgba(228, 152, 245, 0.563); | ||
border: 1px solid #ccc; | ||
backdrop-filter: blur(30px); | ||
border-radius: 4px; | ||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | ||
margin-top: 5px; | ||
} | ||
|
||
.custom-dropdown-option { | ||
padding: 10px; | ||
cursor: pointer; | ||
border-bottom: 1px solid rgba(50, 0, 56, 0.227); | ||
} | ||
|
||
.custom-dropdown-option:hover { | ||
background-color: var(--color-hover); | ||
color: #fff; | ||
} |
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,35 @@ | ||
import React from 'react'; | ||
import './CustomDropdown.css'; | ||
|
||
const CustomDropdown = ({ className, options, onChange, value, isOpen, setIsOpen }) => { | ||
const handleOptionClick = (optionValue) => { | ||
onChange(optionValue); | ||
setIsOpen(false); | ||
}; | ||
|
||
return ( | ||
<div className={`custom-dropdown ${className}`}> | ||
<div className="custom-dropdown-header" onClick={() => setIsOpen(!isOpen)}> | ||
<div className="custom-dropdown-selected"> | ||
{options.find((option) => option.value === value)?.label || 'Select'} | ||
</div> | ||
<div className="custom-dropdown-arrow">▾</div> | ||
</div> | ||
{isOpen && ( | ||
<div className="custom-dropdown-options"> | ||
{options.map((option) => ( | ||
<div | ||
key={option.value} | ||
className="custom-dropdown-option" | ||
onClick={() => handleOptionClick(option.value)} | ||
> | ||
{option.label} | ||
</div> | ||
))} | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default CustomDropdown; |
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