mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
standardize indents at 2 spaces
This commit is contained in:
parent
852e532aa4
commit
4a3745bdd8
21 changed files with 274 additions and 274 deletions
|
|
@ -1,9 +1,9 @@
|
|||
const { override, fixBabelImports } = require('customize-cra');
|
||||
|
||||
module.exports = override(
|
||||
fixBabelImports('import', {
|
||||
libraryName: 'antd',
|
||||
libraryDirectory: 'es',
|
||||
style: 'css',
|
||||
}),
|
||||
fixBabelImports('import', {
|
||||
libraryName: 'antd',
|
||||
libraryDirectory: 'es',
|
||||
style: 'css',
|
||||
}),
|
||||
);
|
||||
|
|
@ -41,4 +41,4 @@
|
|||
]
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
||||
}
|
||||
|
|
@ -10,27 +10,27 @@ import { Tag } from '../../interfaces/Tag';
|
|||
import { ListInfoDrawer } from '../ListInfoDrawer';
|
||||
|
||||
interface Props {
|
||||
lists: List[];
|
||||
languages: Language[];
|
||||
licenses: License[];
|
||||
software: Software[];
|
||||
syntaxes: Syntax[];
|
||||
tags: Tag[];
|
||||
lists: List[];
|
||||
languages: Language[];
|
||||
licenses: License[];
|
||||
software: Software[];
|
||||
syntaxes: Syntax[];
|
||||
tags: Tag[];
|
||||
};
|
||||
|
||||
export const ListDrawer = (props: Props) => {
|
||||
const renderDrawer = (rp: RouteComponentProps<any, StaticContext, any>) => {
|
||||
const list = props.lists.find(l => l.slug === rp.match.params.listSlug);
|
||||
return list
|
||||
? <ListInfoDrawer
|
||||
list={list as List}
|
||||
languages={list.languageIds && props.languages.filter((l: Language) => list.languageIds.includes(l.id))}
|
||||
license={list.licenseId ? props.licenses.find((l: License) => list.licenseId === l.id) : props.licenses.find((l: License) => l.id === 5)}
|
||||
software={list.syntaxId ? props.software.filter((s: Software) => s.syntaxIds.includes(list.syntaxId)) : []}
|
||||
syntax={list.syntaxId ? props.syntaxes.find(s => s.id === list.syntaxId) : undefined}
|
||||
tags={list.tagIds && props.tags.filter((t: Tag) => list.tagIds.includes(t.id))}
|
||||
{...rp} />
|
||||
: (props.lists && props.lists.length) ? <Redirect to={{ pathname: "/", }} /> : null;
|
||||
};
|
||||
return <Route path="/lists/:listSlug" render={renderDrawer} />;
|
||||
const renderDrawer = (rp: RouteComponentProps<any, StaticContext, any>) => {
|
||||
const list = props.lists.find(l => l.slug === rp.match.params.listSlug);
|
||||
return list
|
||||
? <ListInfoDrawer
|
||||
list={list as List}
|
||||
languages={list.languageIds && props.languages.filter((l: Language) => list.languageIds.includes(l.id))}
|
||||
license={list.licenseId ? props.licenses.find((l: License) => list.licenseId === l.id) : props.licenses.find((l: License) => l.id === 5)}
|
||||
software={list.syntaxId ? props.software.filter((s: Software) => s.syntaxIds.includes(list.syntaxId)) : []}
|
||||
syntax={list.syntaxId ? props.syntaxes.find(s => s.id === list.syntaxId) : undefined}
|
||||
tags={list.tagIds && props.tags.filter((t: Tag) => list.tagIds.includes(t.id))}
|
||||
{...rp} />
|
||||
: (props.lists && props.lists.length) ? <Redirect to={{ pathname: "/", }} /> : null;
|
||||
};
|
||||
return <Route path="/lists/:listSlug" render={renderDrawer} />;
|
||||
};
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
interface ArraySortableEntity {
|
||||
id: number;
|
||||
name: string;
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
|
||||
export const arraySorter = (a: number[], b: number[], entities: ArraySortableEntity[]) =>
|
||||
a && a.length
|
||||
? b && b.length
|
||||
? a.length === b.length
|
||||
? entities.filter((e: ArraySortableEntity) => a.includes(e.id)).map((e: ArraySortableEntity) => e.name).join().toLowerCase()
|
||||
> entities.filter((e: ArraySortableEntity) => b.includes(e.id)).map((e: ArraySortableEntity) => e.name).join().toLowerCase()
|
||||
? 1
|
||||
: -1
|
||||
: a.length > b.length
|
||||
? -1
|
||||
: 1
|
||||
: -1
|
||||
: 1;
|
||||
a && a.length
|
||||
? b && b.length
|
||||
? a.length === b.length
|
||||
? entities.filter((e: ArraySortableEntity) => a.includes(e.id)).map((e: ArraySortableEntity) => e.name).join().toLowerCase()
|
||||
> entities.filter((e: ArraySortableEntity) => b.includes(e.id)).map((e: ArraySortableEntity) => e.name).join().toLowerCase()
|
||||
? 1
|
||||
: -1
|
||||
: a.length > b.length
|
||||
? -1
|
||||
: 1
|
||||
: -1
|
||||
: 1;
|
||||
|
|
@ -1,97 +1,97 @@
|
|||
import * as React from 'react';
|
||||
|
||||
import {
|
||||
img01,
|
||||
img02,
|
||||
img03,
|
||||
img04,
|
||||
img05,
|
||||
img06,
|
||||
img07,
|
||||
img08,
|
||||
img10,
|
||||
img11,
|
||||
img12,
|
||||
img13,
|
||||
img14,
|
||||
img15,
|
||||
img16,
|
||||
img17,
|
||||
img18,
|
||||
img19,
|
||||
img20,
|
||||
img21,
|
||||
img22,
|
||||
img23,
|
||||
img24,
|
||||
img25,
|
||||
img26,
|
||||
img27,
|
||||
img28,
|
||||
img29,
|
||||
img30,
|
||||
img31,
|
||||
img32,
|
||||
img33,
|
||||
img34,
|
||||
img35,
|
||||
img36,
|
||||
img37
|
||||
img01,
|
||||
img02,
|
||||
img03,
|
||||
img04,
|
||||
img05,
|
||||
img06,
|
||||
img07,
|
||||
img08,
|
||||
img10,
|
||||
img11,
|
||||
img12,
|
||||
img13,
|
||||
img14,
|
||||
img15,
|
||||
img16,
|
||||
img17,
|
||||
img18,
|
||||
img19,
|
||||
img20,
|
||||
img21,
|
||||
img22,
|
||||
img23,
|
||||
img24,
|
||||
img25,
|
||||
img26,
|
||||
img27,
|
||||
img28,
|
||||
img29,
|
||||
img30,
|
||||
img31,
|
||||
img32,
|
||||
img33,
|
||||
img34,
|
||||
img35,
|
||||
img36,
|
||||
img37
|
||||
} from './imgs';
|
||||
|
||||
interface Props {
|
||||
id: number;
|
||||
id: number;
|
||||
};
|
||||
|
||||
export const SoftwareIcon = (props: Props) =>
|
||||
icons[props.id]
|
||||
? <img
|
||||
src={icons[props.id].image}
|
||||
height="20"
|
||||
alt={icons[props.id].imageTitle}
|
||||
title={icons[props.id].imageTitle} />
|
||||
: null;
|
||||
icons[props.id]
|
||||
? <img
|
||||
src={icons[props.id].image}
|
||||
height="20"
|
||||
alt={icons[props.id].imageTitle}
|
||||
title={icons[props.id].imageTitle} />
|
||||
: null;
|
||||
|
||||
interface Icon {
|
||||
image: any;
|
||||
imageTitle: string;
|
||||
image: any;
|
||||
imageTitle: string;
|
||||
};
|
||||
|
||||
const icons: { [id: number]: Icon; } = {
|
||||
1: { image: img01, imageTitle: "uBlock Origin" },
|
||||
2: { image: img02, imageTitle: "Adblock Plus" },
|
||||
3: { image: img03, imageTitle: "AdGuard" },
|
||||
4: { image: img04, imageTitle: "DNS66" },
|
||||
5: { image: img05, imageTitle: "Nano Adblocker" },
|
||||
6: { image: img06, imageTitle: "AdBlock" },
|
||||
7: { image: img07, imageTitle: "AdAway" },
|
||||
8: { image: img08, imageTitle: "Personal Blocklist" },
|
||||
10: { image: img10, imageTitle: "Redirector" },
|
||||
11: { image: img11, imageTitle: "Hosts File Editor" },
|
||||
12: { image: img12, imageTitle: "Gas Mask" },
|
||||
13: { image: img13, imageTitle: "MinerBlock" },
|
||||
14: { image: img14, imageTitle: "Pi-hole" },
|
||||
15: { image: img15, imageTitle: "uBlock" },
|
||||
16: { image: img16, imageTitle: "Internet Explorer (TPL)" },
|
||||
17: { image: img17, imageTitle: "Google Hit Hider by Domain" },
|
||||
18: { image: img18, imageTitle: "FireHOL" },
|
||||
19: { image: img19, imageTitle: "Samsung Knox" },
|
||||
20: { image: img20, imageTitle: "Little Snitch" },
|
||||
21: { image: img21, imageTitle: "Privoxy" },
|
||||
22: { image: img22, imageTitle: "Diversion" },
|
||||
23: { image: img23, imageTitle: "dnsmasq" },
|
||||
24: { image: img24, imageTitle: "Slimjet" },
|
||||
25: { image: img25, imageTitle: "uMatrix" },
|
||||
26: { image: img26, imageTitle: "Blokada" },
|
||||
27: { image: img27, imageTitle: "hostsmgr" },
|
||||
28: { image: img28, imageTitle: "personalDNSfilter" },
|
||||
29: { image: img29, imageTitle: "Unbound" },
|
||||
30: { image: img30, imageTitle: "BIND" },
|
||||
31: { image: img31, imageTitle: "AdGuard Home" },
|
||||
32: { image: img32, imageTitle: "AdNauseam" },
|
||||
33: { image: img33, imageTitle: "Legacy Unix derivatives" },
|
||||
34: { image: img34, imageTitle: "Windows command line" },
|
||||
35: { image: img35, imageTitle: "Shadowsocks" },
|
||||
36: { image: img36, imageTitle: "ShadowsocksR" },
|
||||
37: { image: img37, imageTitle: "Shadowrocket" }
|
||||
1: { image: img01, imageTitle: "uBlock Origin" },
|
||||
2: { image: img02, imageTitle: "Adblock Plus" },
|
||||
3: { image: img03, imageTitle: "AdGuard" },
|
||||
4: { image: img04, imageTitle: "DNS66" },
|
||||
5: { image: img05, imageTitle: "Nano Adblocker" },
|
||||
6: { image: img06, imageTitle: "AdBlock" },
|
||||
7: { image: img07, imageTitle: "AdAway" },
|
||||
8: { image: img08, imageTitle: "Personal Blocklist" },
|
||||
10: { image: img10, imageTitle: "Redirector" },
|
||||
11: { image: img11, imageTitle: "Hosts File Editor" },
|
||||
12: { image: img12, imageTitle: "Gas Mask" },
|
||||
13: { image: img13, imageTitle: "MinerBlock" },
|
||||
14: { image: img14, imageTitle: "Pi-hole" },
|
||||
15: { image: img15, imageTitle: "uBlock" },
|
||||
16: { image: img16, imageTitle: "Internet Explorer (TPL)" },
|
||||
17: { image: img17, imageTitle: "Google Hit Hider by Domain" },
|
||||
18: { image: img18, imageTitle: "FireHOL" },
|
||||
19: { image: img19, imageTitle: "Samsung Knox" },
|
||||
20: { image: img20, imageTitle: "Little Snitch" },
|
||||
21: { image: img21, imageTitle: "Privoxy" },
|
||||
22: { image: img22, imageTitle: "Diversion" },
|
||||
23: { image: img23, imageTitle: "dnsmasq" },
|
||||
24: { image: img24, imageTitle: "Slimjet" },
|
||||
25: { image: img25, imageTitle: "uMatrix" },
|
||||
26: { image: img26, imageTitle: "Blokada" },
|
||||
27: { image: img27, imageTitle: "hostsmgr" },
|
||||
28: { image: img28, imageTitle: "personalDNSfilter" },
|
||||
29: { image: img29, imageTitle: "Unbound" },
|
||||
30: { image: img30, imageTitle: "BIND" },
|
||||
31: { image: img31, imageTitle: "AdGuard Home" },
|
||||
32: { image: img32, imageTitle: "AdNauseam" },
|
||||
33: { image: img33, imageTitle: "Legacy Unix derivatives" },
|
||||
34: { image: img34, imageTitle: "Windows command line" },
|
||||
35: { image: img35, imageTitle: "Shadowsocks" },
|
||||
36: { image: img36, imageTitle: "ShadowsocksR" },
|
||||
37: { image: img37, imageTitle: "Shadowrocket" }
|
||||
};
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
declare module "*.svg" {
|
||||
const content: any;
|
||||
export default content;
|
||||
const content: any;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module "*.png" {
|
||||
const content: any;
|
||||
export default content;
|
||||
const content: any;
|
||||
export default content;
|
||||
}
|
||||
|
|
@ -36,40 +36,40 @@ import img36 from './36-ShadowsocksR.png';
|
|||
import img37 from './37-Shadowrocket.png';
|
||||
|
||||
export {
|
||||
img01,
|
||||
img02,
|
||||
img03,
|
||||
img04,
|
||||
img05,
|
||||
img06,
|
||||
img07,
|
||||
img08,
|
||||
img10,
|
||||
img11,
|
||||
img12,
|
||||
img13,
|
||||
img14,
|
||||
img15,
|
||||
img16,
|
||||
img17,
|
||||
img18,
|
||||
img19,
|
||||
img20,
|
||||
img21,
|
||||
img22,
|
||||
img23,
|
||||
img24,
|
||||
img25,
|
||||
img26,
|
||||
img27,
|
||||
img28,
|
||||
img29,
|
||||
img30,
|
||||
img31,
|
||||
img32,
|
||||
img33,
|
||||
img34,
|
||||
img35,
|
||||
img36,
|
||||
img37
|
||||
img01,
|
||||
img02,
|
||||
img03,
|
||||
img04,
|
||||
img05,
|
||||
img06,
|
||||
img07,
|
||||
img08,
|
||||
img10,
|
||||
img11,
|
||||
img12,
|
||||
img13,
|
||||
img14,
|
||||
img15,
|
||||
img16,
|
||||
img17,
|
||||
img18,
|
||||
img19,
|
||||
img20,
|
||||
img21,
|
||||
img22,
|
||||
img23,
|
||||
img24,
|
||||
img25,
|
||||
img26,
|
||||
img27,
|
||||
img28,
|
||||
img29,
|
||||
img30,
|
||||
img31,
|
||||
img32,
|
||||
img33,
|
||||
img34,
|
||||
img35,
|
||||
img36,
|
||||
img37
|
||||
};
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
|
||||
export const useApiData = <T extends {}>(url: string) => {
|
||||
const [data, setData] = useState<T>();
|
||||
useEffect(() => {
|
||||
const fetchData = async () => (await fetch(url)).json().then(r => setData(r));
|
||||
fetchData();
|
||||
}, [url]);
|
||||
return data;
|
||||
const [data, setData] = useState<T>();
|
||||
useEffect(() => {
|
||||
const fetchData = async () => (await fetch(url)).json().then(r => setData(r));
|
||||
fetchData();
|
||||
}, [url]);
|
||||
return data;
|
||||
};
|
||||
|
|
@ -2,4 +2,4 @@ import { Language } from '../interfaces/Language';
|
|||
import { useApiData } from './useApiData';
|
||||
|
||||
export const useLanguages = () => (useApiData<Language[]>("/api/v1/languages") || [])
|
||||
.sort((a: Language, b: Language) => a.name.localeCompare(b.name));
|
||||
.sort((a: Language, b: Language) => a.name.localeCompare(b.name));
|
||||
|
|
@ -2,4 +2,4 @@ import { License } from '../interfaces/License';
|
|||
import { useApiData } from './useApiData';
|
||||
|
||||
export const useLicenses = () => (useApiData<License[]>("/api/v1/licenses") || [])
|
||||
.sort((a: License, b: License) => a.name.localeCompare(b.name));
|
||||
.sort((a: License, b: License) => a.name.localeCompare(b.name));
|
||||
|
|
@ -4,8 +4,8 @@ import { List } from '../interfaces/List';
|
|||
import { useApiData } from './useApiData';
|
||||
|
||||
export const useLists = () => {
|
||||
const lists = useApiData<List[]>("/api/v1/lists");
|
||||
lists && lists.forEach(l => l.slug = slugify(l.name));
|
||||
return (lists || [])
|
||||
.sort((a: List, b: List) => a.name.localeCompare(b.name));
|
||||
const lists = useApiData<List[]>("/api/v1/lists");
|
||||
lists && lists.forEach(l => l.slug = slugify(l.name));
|
||||
return (lists || [])
|
||||
.sort((a: List, b: List) => a.name.localeCompare(b.name));
|
||||
};
|
||||
|
|
@ -3,55 +3,55 @@ import { FilterDropdownProps } from 'antd/lib/table';
|
|||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
interface FilterPropsState<T> {
|
||||
filterDropdown?: React.ReactNode | ((props: FilterDropdownProps) => React.ReactNode);
|
||||
filterIcon?: React.ReactNode | ((filtered: boolean) => React.ReactNode);
|
||||
onFilter?: (value: any, record: T) => boolean;
|
||||
filterDropdown?: React.ReactNode | ((props: FilterDropdownProps) => React.ReactNode);
|
||||
filterIcon?: React.ReactNode | ((filtered: boolean) => React.ReactNode);
|
||||
onFilter?: (value: any, record: T) => boolean;
|
||||
}
|
||||
|
||||
export const useSearchColumnFilter = <T extends {}>(dataIndex: string) => {
|
||||
const [filterProps, setFilterProps] = useState<FilterPropsState<T>>({
|
||||
filterDropdown: undefined,
|
||||
filterIcon: undefined,
|
||||
onFilter: undefined
|
||||
});
|
||||
useEffect(() => {
|
||||
const handleSearch = (confirm?: () => void) => {
|
||||
confirm && confirm();
|
||||
};
|
||||
const handleReset = (clearFilters?: (selectedKeys: string[]) => void) => {
|
||||
clearFilters && clearFilters([]);
|
||||
};
|
||||
setFilterProps({
|
||||
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
|
||||
<div style={{ padding: 8 }}>
|
||||
<Input
|
||||
placeholder={`Search ${dataIndex.charAt(0).toUpperCase() + dataIndex.slice(1)}`}
|
||||
value={selectedKeys && selectedKeys[0]}
|
||||
onChange={e => setSelectedKeys && setSelectedKeys(e.target.value ? [e.target.value] : [])}
|
||||
onPressEnter={() => handleSearch(confirm)}
|
||||
style={{ width: 188, marginBottom: 8, display: 'block' }} />
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => handleSearch(confirm)}
|
||||
icon="search"
|
||||
size="small"
|
||||
style={{ width: 90, marginRight: 8 }} >
|
||||
Search
|
||||
const [filterProps, setFilterProps] = useState<FilterPropsState<T>>({
|
||||
filterDropdown: undefined,
|
||||
filterIcon: undefined,
|
||||
onFilter: undefined
|
||||
});
|
||||
useEffect(() => {
|
||||
const handleSearch = (confirm?: () => void) => {
|
||||
confirm && confirm();
|
||||
};
|
||||
const handleReset = (clearFilters?: (selectedKeys: string[]) => void) => {
|
||||
clearFilters && clearFilters([]);
|
||||
};
|
||||
setFilterProps({
|
||||
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
|
||||
<div style={{ padding: 8 }}>
|
||||
<Input
|
||||
placeholder={`Search ${dataIndex.charAt(0).toUpperCase() + dataIndex.slice(1)}`}
|
||||
value={selectedKeys && selectedKeys[0]}
|
||||
onChange={e => setSelectedKeys && setSelectedKeys(e.target.value ? [e.target.value] : [])}
|
||||
onPressEnter={() => handleSearch(confirm)}
|
||||
style={{ width: 188, marginBottom: 8, display: 'block' }} />
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => handleSearch(confirm)}
|
||||
icon="search"
|
||||
size="small"
|
||||
style={{ width: 90, marginRight: 8 }} >
|
||||
Search
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => handleReset(clearFilters)}
|
||||
size="small"
|
||||
style={{ width: 90 }} >
|
||||
Reset
|
||||
<Button
|
||||
onClick={() => handleReset(clearFilters)}
|
||||
size="small"
|
||||
style={{ width: 90 }} >
|
||||
Reset
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
filterIcon: filtered => <Icon type="search" style={{ color: filtered ? '#1890ff' : undefined }} />,
|
||||
onFilter: (value, record) => {
|
||||
const searchValue = (record as any)[dataIndex];
|
||||
return searchValue && searchValue.toString().toLowerCase().includes(value.toString().toLowerCase())
|
||||
}
|
||||
})
|
||||
}, [dataIndex]);
|
||||
return filterProps;
|
||||
</div>
|
||||
),
|
||||
filterIcon: filtered => <Icon type="search" style={{ color: filtered ? '#1890ff' : undefined }} />,
|
||||
onFilter: (value, record) => {
|
||||
const searchValue = (record as any)[dataIndex];
|
||||
return searchValue && searchValue.toString().toLowerCase().includes(value.toString().toLowerCase())
|
||||
}
|
||||
})
|
||||
}, [dataIndex]);
|
||||
return filterProps;
|
||||
};
|
||||
|
|
@ -2,4 +2,4 @@ import { Software } from '../interfaces/Software';
|
|||
import { useApiData } from './useApiData';
|
||||
|
||||
export const useSoftware = () => (useApiData<Software[]>("/api/v1/software") || [])
|
||||
.sort((a: Software, b: Software) => a.name.localeCompare(b.name));
|
||||
.sort((a: Software, b: Software) => a.name.localeCompare(b.name));
|
||||
|
|
@ -2,4 +2,4 @@ import { Syntax } from '../interfaces/Syntax';
|
|||
import { useApiData } from './useApiData';
|
||||
|
||||
export const useSyntaxes = () => (useApiData<Syntax[]>("/api/v1/syntaxes") || [])
|
||||
.sort((a: Syntax, b: Syntax) => a.name.localeCompare(b.name));
|
||||
.sort((a: Syntax, b: Syntax) => a.name.localeCompare(b.name));
|
||||
|
|
@ -1,21 +1,21 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
|
||||
interface TablePageSize {
|
||||
pageSize: number;
|
||||
isNarrowWindow: boolean;
|
||||
pageSize: number;
|
||||
isNarrowWindow: boolean;
|
||||
};
|
||||
|
||||
export const useTablePageSizer = () => {
|
||||
const [state, setState] = useState<TablePageSize>(calculateSize());
|
||||
useEffect(() => {
|
||||
const updatePageSize = () => setState(calculateSize());
|
||||
window.addEventListener('resize', updatePageSize);
|
||||
return () => window.removeEventListener('resize', updatePageSize);
|
||||
}, []);
|
||||
return state;
|
||||
const [state, setState] = useState<TablePageSize>(calculateSize());
|
||||
useEffect(() => {
|
||||
const updatePageSize = () => setState(calculateSize());
|
||||
window.addEventListener('resize', updatePageSize);
|
||||
return () => window.removeEventListener('resize', updatePageSize);
|
||||
}, []);
|
||||
return state;
|
||||
};
|
||||
|
||||
const calculateSize = () => ({
|
||||
pageSize: Math.floor((window.innerHeight - 208) / 57),
|
||||
isNarrowWindow: window.innerWidth < 576 ? true : false
|
||||
pageSize: Math.floor((window.innerHeight - 208) / 57),
|
||||
isNarrowWindow: window.innerWidth < 576 ? true : false
|
||||
});
|
||||
|
|
@ -2,4 +2,4 @@ import { Tag } from '../interfaces/Tag';
|
|||
import { useApiData } from './useApiData';
|
||||
|
||||
export const useTags = () => (useApiData<Tag[]>("/api/v1/tags") || [])
|
||||
.sort((a: Tag, b: Tag) => a.name.localeCompare(b.name));
|
||||
.sort((a: Tag, b: Tag) => a.name.localeCompare(b.name));
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
export interface Language {
|
||||
id: number;
|
||||
filterListIds: number[];
|
||||
iso6391: string;
|
||||
name: string;
|
||||
id: number;
|
||||
filterListIds: number[];
|
||||
iso6391: string;
|
||||
name: string;
|
||||
};
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
export interface License {
|
||||
id: number;
|
||||
descriptionUrl: string;
|
||||
filterListIds: number[];
|
||||
name: string;
|
||||
id: number;
|
||||
descriptionUrl: string;
|
||||
filterListIds: number[];
|
||||
name: string;
|
||||
};
|
||||
|
|
@ -1,25 +1,25 @@
|
|||
export interface List {
|
||||
id: number;
|
||||
chatUrl: string;
|
||||
description: string;
|
||||
descriptionSourceUrl: string;
|
||||
donateUrl: string;
|
||||
emailAddress: string;
|
||||
forumUrl: string;
|
||||
homeUrl: string;
|
||||
issuesUrl: string;
|
||||
languageIds: number[];
|
||||
licenseId: number;
|
||||
maintainerIds: number[];
|
||||
name: string;
|
||||
policyUrl: string;
|
||||
publishedDate: string;
|
||||
submissionUrl: string;
|
||||
syntaxId: number;
|
||||
tagIds: number[];
|
||||
viewUrl: string;
|
||||
viewUrlMirrors: string[];
|
||||
id: number;
|
||||
chatUrl: string;
|
||||
description: string;
|
||||
descriptionSourceUrl: string;
|
||||
donateUrl: string;
|
||||
emailAddress: string;
|
||||
forumUrl: string;
|
||||
homeUrl: string;
|
||||
issuesUrl: string;
|
||||
languageIds: number[];
|
||||
licenseId: number;
|
||||
maintainerIds: number[];
|
||||
name: string;
|
||||
policyUrl: string;
|
||||
publishedDate: string;
|
||||
submissionUrl: string;
|
||||
syntaxId: number;
|
||||
tagIds: number[];
|
||||
viewUrl: string;
|
||||
viewUrlMirrors: string[];
|
||||
|
||||
// auto-generated by useLists hook
|
||||
slug: string;
|
||||
// auto-generated by useLists hook
|
||||
slug: string;
|
||||
};
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
export interface Software {
|
||||
id: number;
|
||||
homeUrl: string;
|
||||
isAbpSubscribable: boolean;
|
||||
name: string;
|
||||
syntaxIds: number[];
|
||||
id: number;
|
||||
homeUrl: string;
|
||||
isAbpSubscribable: boolean;
|
||||
name: string;
|
||||
syntaxIds: number[];
|
||||
};
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
export interface Syntax {
|
||||
id: number;
|
||||
definitionUrl: string;
|
||||
filterListIds: number[];
|
||||
name: string;
|
||||
softwareIds: number[];
|
||||
id: number;
|
||||
definitionUrl: string;
|
||||
filterListIds: number[];
|
||||
name: string;
|
||||
softwareIds: number[];
|
||||
};
|
||||
Loading…
Reference in a new issue