-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added: Sorting for hosts and Better Dropdowns with icons (#7)
- Loading branch information
Showing
6 changed files
with
127 additions
and
24 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
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,28 @@ | ||
import React from 'react'; | ||
import { AiOutlineSortAscending, AiOutlineSortDescending } from "react-icons/ai"; | ||
import { TbSortDescendingNumbers, TbSortAscendingNumbers } from "react-icons/tb"; | ||
|
||
const ThemeDropdown = ({ value, onChange }) => { | ||
return ( | ||
<div className="relative inline-block w-full"> | ||
<select | ||
className="select select-bordered w-full pr-12" | ||
value={value} | ||
onChange={onChange} | ||
> | ||
<option value="name-asc">Name Ascending</option> | ||
<option value="name-desc">Name Descending</option> | ||
<option value="containers-asc">Container Amount Ascending</option> | ||
<option value="containers-desc">Container Amount Descending</option> | ||
</select> | ||
<div className="absolute inset-y-0 right-0 flex items-center mr-5 pr-3 pointer-events-none"> | ||
{value === 'name-asc' && <AiOutlineSortAscending className="text-xl" />} | ||
{value === 'name-desc' && <AiOutlineSortDescending className="text-xl" />} | ||
{value === 'containers-asc' && <TbSortAscendingNumbers className="text-xl" />} | ||
{value === 'containers-desc' && <TbSortDescendingNumbers className="text-xl" />} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ThemeDropdown; |
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,39 @@ | ||
import React from 'react'; | ||
import { FaRegSun, FaRegMoon } from "react-icons/fa"; | ||
|
||
|
||
const SortDropdown = ({ value, onChange }) => { | ||
return ( | ||
<div className="relative inline-block w-full"> | ||
<select | ||
className="select select-bordered w-full pr-12" | ||
value={value} | ||
onChange={onChange} | ||
> | ||
<option value="light">Light</option> | ||
<option value="nord">Nord</option> | ||
<option value="valentine">Pastel</option> | ||
<option value="business">Business</option> | ||
<option value="dracula">Dracula</option> | ||
<option value="sunset">Sunset</option> | ||
<option value="night">Night</option> | ||
<option value="forest">Forest</option> | ||
<option value="black">Amoled</option> | ||
</select> | ||
<div className="absolute inset-y-0 right-0 flex items-center mr-5 pr-3 pointer-events-none"> | ||
{value === '' && <FaRegSun className="text-xl" />} | ||
{value === 'light' && <FaRegSun className="text-xl" />} | ||
{value === 'nord' && <FaRegSun className="text-xl" />} | ||
{value === 'valentine' && <FaRegSun className="text-xl" />} | ||
{value === 'business' && <FaRegMoon className="text-xl" />} | ||
{value === 'dracula' && <FaRegMoon className="text-xl" />} | ||
{value === 'sunset' && <FaRegMoon className="text-xl" />} | ||
{value === 'night' && <FaRegMoon className="text-xl" />} | ||
{value === 'forest' && <FaRegMoon className="text-xl" />} | ||
{value === 'black' && <FaRegMoon className="text-xl" />} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SortDropdown; |