Skip to content

Commit

Permalink
npm run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Sep 30, 2024
1 parent 028596a commit 2a65797
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 27 deletions.
12 changes: 6 additions & 6 deletions src/app/Systems/_Layout/Layout.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.container {
min-width: 20%;
max-width: 20%;
display: block;
max-height: "100%";
min-height: "100%";
}
min-width: 20%;
max-width: 20%;
display: block;
max-height: '100%';
min-height: '100%';
}
4 changes: 2 additions & 2 deletions src/app/Systems/_Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { SystemsNav } from '../_components';
import SystemToolbar from '../_components/SystemToolbar';
import { Router } from '../_Router';
import { SystemsHelp } from 'app/_components/Help';
import styles from './Layout.module.scss'
import styles from './Layout.module.scss';

const Layout: React.FC = () => {
const header = (
Expand All @@ -25,7 +25,7 @@ const Layout: React.FC = () => {
);

const sidebar = (
<div className={styles["container"]}>
<div className={styles['container']}>
<SystemsNav />
</div>
);
Expand Down
44 changes: 25 additions & 19 deletions src/app/Systems/_components/SystemsNav/SystemsNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type Group<T, V> = {
groupIcon?: ResolvableGroupValue<T, unknown>;
groupItemIcon?: ResolvableGroupItemValue<T, unknown>;
onClickItem?: (object: T) => void;
showDropdown?: boolean
showDropdown?: boolean;
};

type FilterScope = 'filter' | 'group' | 'order';
Expand All @@ -83,7 +83,7 @@ type FilterableObjectsListProps<T, V = string | undefined> = {
includeAllSelectorLabel?: string;
includeAllGroupLabel?: string;
includeAllToolTip?: string;
includeAllShowDropdown?: boolean
includeAllShowDropdown?: boolean;
defaultField?: PropsOfObjectWithValuesOfType<T, V> | '*';
defaultOnClickItem?: (object: T) => void;
defaultGroupIcon?: any;
Expand Down Expand Up @@ -149,14 +149,14 @@ const FilterableObjectsList: FilterableObjectsListComponentProps<{
filterScope: defaultFilterScope,
});

console.log({state})
console.log({ state });

useEffect(() => {
const modifiedState: FilterableObjectsListState = {
open: state.open,
groupedObjects: {},
groupBy: state.groupBy,
filterScope: state.filterScope
filterScope: state.filterScope,
};
for (let group of groups) {
modifiedState.groupedObjects = {
Expand Down Expand Up @@ -243,14 +243,14 @@ const FilterableObjectsList: FilterableObjectsListComponentProps<{
groupIcon: defaultGroupIcon,
groupItemIcon: defaultGroupItemIcon,
tooltip: includeAllToolTip,
showDropdown: includeAllShowDropdown
showDropdown: includeAllShowDropdown,
},
...groups,
];
}

return (
<div style={{maxHeight: "100%", minHeight: "100%", overflowY: "auto"}}>
<div style={{ maxHeight: '100%', minHeight: '100%', overflowY: 'auto' }}>
{title && (
<>
<List
Expand All @@ -271,23 +271,25 @@ const FilterableObjectsList: FilterableObjectsListComponentProps<{
<List
style={{ padding: '0px' }}
subheader={
(filterable || orderable || groupable) ? (
filterable || orderable || groupable ? (
<ListSubheader
style={{
paddingTop: '8px',
paddingBottom: '8px',
display: 'flex',
justifyContent: 'space-evenly',
gap: "16px"
gap: '16px',
}}
>
{filterable && (
<Button
size="small"
variant={state.filterScope === "filter" ? "contained" : "outlined"}
variant={
state.filterScope === 'filter' ? 'contained' : 'outlined'
}
startIcon={<FilterAlt />}
onClick={() => {
setState({...state, filterScope: "filter"})
setState({ ...state, filterScope: 'filter' });
}}
>
Filter
Expand All @@ -296,22 +298,26 @@ const FilterableObjectsList: FilterableObjectsListComponentProps<{
{groupable && (
<Button
size="small"
variant={state.filterScope === "group" ? "contained" : "outlined"}
variant={
state.filterScope === 'group' ? 'contained' : 'outlined'
}
startIcon={<Category />}
onClick={() => {
setState({...state, filterScope: "group"})
setState({ ...state, filterScope: 'group' });
}}
>
Group
</Button>
)}
{orderable && (
<Button
size="small"
variant={state.filterScope === "order" ? "contained" : "outlined"}
<Button
size="small"
variant={
state.filterScope === 'order' ? 'contained' : 'outlined'
}
startIcon={<SortByAlpha />}
onClick={() => {
setState({...state, filterScope: "order"})
setState({ ...state, filterScope: 'order' });
}}
>
Order
Expand All @@ -321,7 +327,7 @@ const FilterableObjectsList: FilterableObjectsListComponentProps<{
) : undefined
}
>
{groupable && state.filterScope === "group" && (
{groupable && state.filterScope === 'group' && (
<>
<Divider />
<span
Expand Down Expand Up @@ -401,8 +407,8 @@ const FilterableObjectsList: FilterableObjectsListComponentProps<{
<List
style={{ padding: '0px' }}
subheader={
(group.showDropdown || group.showDropdown === undefined) && (

(group.showDropdown ||
group.showDropdown === undefined) && (
<ListSubheader
style={{ cursor: 'pointer', userSelect: 'none' }}
onClick={() => {
Expand Down

0 comments on commit 2a65797

Please sign in to comment.