Skip to content

Commit

Permalink
chore: organize
Browse files Browse the repository at this point in the history
organize filters in file
  • Loading branch information
jlangy committed Dec 19, 2023
1 parent 1983d84 commit ddf0c13
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions app/pages/custom-realm-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,6 @@ const Table = styled.table`
}
`;

const columnHelper = createColumnHelper<CustomRealmFormData>();
interface Props {
defaultRealmRequests: CustomRealmFormData[];
alert: BottomAlert;
}

const listFilter: FilterFn<any> = (row, columnId, value) => {
return value.includes(row.getValue(columnId));
};

const FilterBox = styled.div`
font-weight: normal;
box-sizing: border-box;
Expand Down Expand Up @@ -153,6 +143,15 @@ const FilterBox = styled.div`
}
`;

// Filter Functions
const listFilter: FilterFn<any> = (row, columnId, value) => {
return value.includes(row.getValue(columnId));
};
const searchFilter: FilterFn<any> = (row, columnId, value) => {
return (row.getValue(columnId) as string).includes(value);
};

// Filter Components
function ApprovalFilter(props: { in: boolean; column: Column<any, any> }) {
const [showApproved, setShowApproved] = useState(true);
const [showDeclined, setShowDeclined] = useState(true);
Expand Down Expand Up @@ -295,10 +294,11 @@ function Filter(props: { column: Column<any, any> }) {
);
}

const searchFilter: FilterFn<any> = (row, columnId, value) => {
return (row.getValue(columnId) as string).includes(value);
};

const columnHelper = createColumnHelper<CustomRealmFormData>();
interface Props {
defaultRealmRequests: CustomRealmFormData[];
alert: BottomAlert;
}
const realmCreatingStatuses = ['pending', 'prSuccess', 'planned'];

function CustomRealmDashboard({ defaultRealmRequests, alert }: Props) {
Expand Down

0 comments on commit ddf0c13

Please sign in to comment.