-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36d0721
commit c2b8364
Showing
16 changed files
with
344 additions
and
294 deletions.
There are no files selected for viewing
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
145 changes: 0 additions & 145 deletions
145
src/app/components/Staking/FinalityProviders/FinalityProvider.tsx
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/app/components/Staking/FinalityProviders/FinalityProviderFilter.tsx
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,22 @@ | ||
import { Select } from "@babylonlabs-io/bbn-core-ui"; | ||
|
||
import { useFinalityProviderService } from "@/app/hooks/services/useFinalityProviderService"; | ||
|
||
const options = [ | ||
{ value: "active", label: "Active" }, | ||
{ value: "inactive", label: "Inactive" }, | ||
]; | ||
|
||
export const FinalityProviderFilter = () => { | ||
const { filterValue, handleFilter } = useFinalityProviderService(); | ||
|
||
return ( | ||
<Select | ||
options={options} | ||
onSelect={handleFilter} | ||
placeholder="Select Status" | ||
defaultValue={filterValue} | ||
renderSelectedOption={(option) => `Showing ${option.label}`} | ||
/> | ||
); | ||
}; |
52 changes: 25 additions & 27 deletions
52
src/app/components/Staking/FinalityProviders/FinalityProviderSearch.tsx
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,33 +1,31 @@ | ||
import React from "react"; | ||
import { FiSearch } from "react-icons/fi"; | ||
import { Input } from "@babylonlabs-io/bbn-core-ui"; | ||
import { useCallback } from "react"; | ||
import { RiSearchLine } from "react-icons/ri"; | ||
|
||
interface FinalityProviderSearchProps { | ||
searchValue: string; | ||
onSearch: (searchTerm: string) => void; | ||
} | ||
import { useFinalityProviderService } from "@/app/hooks/services/useFinalityProviderService"; | ||
|
||
export const FinalityProviderSearch: React.FC<FinalityProviderSearchProps> = ({ | ||
searchValue, | ||
onSearch, | ||
}) => { | ||
const handleSearch = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
onSearch(e.target.value); | ||
}; | ||
export const FinalityProviderSearch = () => { | ||
const { handleSearch, searchValue } = useFinalityProviderService(); | ||
|
||
const onSearchChange = useCallback( | ||
(e: React.ChangeEvent<HTMLInputElement>) => { | ||
handleSearch(e.target.value); | ||
}, | ||
[handleSearch], | ||
); | ||
|
||
const searchSuffix = ( | ||
<span className="cursor-pointer"> | ||
<RiSearchLine size={20} /> | ||
</span> | ||
); | ||
|
||
return ( | ||
<div className="w-full"> | ||
<div className="relative"> | ||
<div className="absolute inset-y-0 left-0 flex items-center justify-center w-10"> | ||
<FiSearch className="text-sm md:text-lg" /> | ||
</div> | ||
<input | ||
type="text" | ||
placeholder="Search by Name or Public Key" | ||
value={searchValue} | ||
onChange={handleSearch} | ||
className="w-full pl-10 pr-4 py-2 text-sm bg-transparent border-b border-gray-300 focus:outline-none focus:border-primary" | ||
/> | ||
</div> | ||
</div> | ||
<Input | ||
placeholder="Search by Name or Public Key" | ||
suffix={searchSuffix} | ||
value={searchValue} | ||
onChange={onSearchChange} | ||
/> | ||
); | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/app/components/Staking/FinalityProviders/FinalityProviderSubtitle.tsx
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,9 @@ | ||
import { Text } from "@babylonlabs-io/bbn-core-ui"; | ||
|
||
export const FinalityProviderSubtitle = () => { | ||
return ( | ||
<Text variant="body1" className="text-primary-dark"> | ||
Select a Finality Provider | ||
</Text> | ||
); | ||
}; |
Oops, something went wrong.