Skip to content

Commit

Permalink
update finality provider components
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-babylonlabs committed Dec 12, 2024
1 parent 4a30f40 commit 20bda9a
Show file tree
Hide file tree
Showing 20 changed files with 4,672 additions and 3,379 deletions.
7,311 changes: 4,226 additions & 3,085 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions src/app/assets/warning-icon.svg

This file was deleted.

3 changes: 3 additions & 0 deletions src/app/assets/warning-octagon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/app/assets/warning-triangle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/app/components/Modals/UnbondErrorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from "@babylonlabs-io/bbn-core-ui";
import Image from "next/image";

import warningIcon from "@/app/assets/warning-icon.svg";
import warningIcon from "@/app/assets/warning-triangle.svg";

import { ResponsiveDialog } from "./ResponsiveDialog";

Expand Down
145 changes: 0 additions & 145 deletions src/app/components/Staking/FinalityProviders/FinalityProvider.tsx

This file was deleted.

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}`}
/>
);
};
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}
/>
);
};
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>
);
};
Loading

0 comments on commit 20bda9a

Please sign in to comment.