mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
rely on columnVisibility for visible state rather than bootstrap responsive
ref #531
This commit is contained in:
parent
83667c4540
commit
785182813e
10 changed files with 11 additions and 16 deletions
|
|
@ -38,8 +38,17 @@ export class Home extends React.Component<IProps, IState> {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setMobileColumnVisibility();
|
||||
this.updatePageSize();
|
||||
};
|
||||
|
||||
setMobileColumnVisibility() {
|
||||
if (window.innerWidth < 768) {
|
||||
this.state.columnVisibility.forEach((c: IColumnVisibility) => {
|
||||
c.visible = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
updatePageSize() {
|
||||
this.setState({
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ interface IProps {
|
|||
export const InfoCard = (props: IProps) =>
|
||||
<div className="col-9">
|
||||
<TagGroup tags={props.tags}/>
|
||||
<div className="d-md-none">
|
||||
<div>
|
||||
{props.syntax
|
||||
? props.syntax.supportedSoftware.map(
|
||||
(s: ISyntaxSupportedSoftware, i: number) =>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export const UpdatedDate = (props: IProps) =>
|
|||
props.discontinuedDate
|
||||
? null
|
||||
: props.updatedDate
|
||||
? <li className="d-md-none list-group-item">
|
||||
? <li className="list-group-item">
|
||||
<p>Updated: {moment(props.updatedDate).isValid()
|
||||
? moment(props.updatedDate).format("l")
|
||||
: "N/A"}</p>
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ export const Languages = (columnVisibility: IColumnVisibility[], languages: ILan
|
|||
Cell: (c: any) => Cell(c.value, languages),
|
||||
style: { whiteSpace: "inherit" },
|
||||
width: 95,
|
||||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block",
|
||||
show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Languages")[0].visible
|
||||
} as Column);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@ export const License = (columnVisibility: IColumnVisibility[], licenses: ILicens
|
|||
sortMethod: (a: number, b: number) => sortMethod(a, b, licenses),
|
||||
Cell: (c: any) => Cell(c.value, licenses),
|
||||
width: 140,
|
||||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block",
|
||||
show: columnVisibility.filter((c: IColumnVisibility) => c.column === "License")[0].visible
|
||||
} as Column);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@ export const Maintainers = (columnVisibility: IColumnVisibility[], maintainers:
|
|||
sortMethod: (a: number[], b: number[]) => sortMethod(a, b, maintainers),
|
||||
Cell: (c: any) => Cell(c.value, maintainers),
|
||||
width: 140,
|
||||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block",
|
||||
show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Maintainers")[0].visible
|
||||
} as Column);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ export const RuleCount = (columnVisibility: IColumnVisibility[]) =>
|
|||
Cell: (c: any) => Cell(c.value),
|
||||
style: { whiteSpace: "inherit" },
|
||||
width: 85,
|
||||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block",
|
||||
show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Rules")[0].visible
|
||||
} as Column);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@ export const Software = (columnVisibility: IColumnVisibility[], software: ISoftw
|
|||
sortable: false,
|
||||
Cell: (c: any) => Cell(c.value, software),
|
||||
width: 155,
|
||||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block",
|
||||
show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Software")[0].visible
|
||||
} as Column);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ export const Tags = (columnVisibility: IColumnVisibility[], tags: ITag[]) =>
|
|||
sortMethod: (a: number[], b: number[]) => sortMethod(a, b),
|
||||
Cell: (c: any) => Cell(c.value, tags),
|
||||
width: 215,
|
||||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block",
|
||||
show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Tags")[0].visible
|
||||
} as Column);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ export const UpdatedDate = (columnVisibility: IColumnVisibility[]) =>
|
|||
Cell: (c: any) => Cell(c.value),
|
||||
style: { whiteSpace: "inherit" },
|
||||
width: 100,
|
||||
headerClassName: "d-none d-md-block",
|
||||
className: "d-none d-md-block",
|
||||
show: columnVisibility.filter((c: IColumnVisibility) => c.column === "Updated")[0].visible
|
||||
} as Column);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue