mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-23 04:19:48 +00:00
Fix style format and optimzed code
This commit is contained in:
@@ -41,7 +41,7 @@ interface IFilterProps {
|
||||
}[];
|
||||
}
|
||||
|
||||
function OrderBy({ options }: IFilterProps) {
|
||||
const OrderBy = ({ options }: IFilterProps) => {
|
||||
const field = 'orderBy';
|
||||
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
@@ -67,6 +67,6 @@ function OrderBy({ options }: IFilterProps) {
|
||||
))}
|
||||
</StyledFilter>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default OrderBy;
|
||||
|
||||
@@ -17,7 +17,7 @@ const StyledSelect = styled.select`
|
||||
font-weight: 500;
|
||||
`;
|
||||
|
||||
function Select({ options, value, onChange }: ISelect) {
|
||||
const Select = ({ options, value, onChange }: ISelect) => {
|
||||
return (
|
||||
<StyledSelect value={value} onChange={onChange}>
|
||||
{options.map((option) => (
|
||||
@@ -27,6 +27,6 @@ function Select({ options, value, onChange }: ISelect) {
|
||||
))}
|
||||
</StyledSelect>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default Select;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ReactNode, memo, useContext } from 'react';
|
||||
import { ReactNode, useContext } from 'react';
|
||||
|
||||
// Components
|
||||
import { StyledBody, StyledHeader, StyledRow, StyledTable } from './styled';
|
||||
@@ -19,10 +19,10 @@ const Table = ({ columns, children }: ITable) => {
|
||||
);
|
||||
};
|
||||
|
||||
const Header = memo(({ children }: ITable) => {
|
||||
const Header = ({ children }: ITable) => {
|
||||
const columns = useContext(TableContext);
|
||||
return <StyledHeader columns={columns}>{children}</StyledHeader>;
|
||||
});
|
||||
};
|
||||
|
||||
const Body = <T,>({ data, render }: ITableBody<T>) => {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user