diff --git a/.gitignore b/.gitignore index a8ccb251..c7376d35 100644 --- a/.gitignore +++ b/.gitignore @@ -76,3 +76,4 @@ typings/ # DS_Store .DS_Store +*.tsbuildinfo diff --git a/components/AccountModal/index.tsx b/components/AccountModal/index.tsx index 87f0851a..a5156276 100644 --- a/components/AccountModal/index.tsx +++ b/components/AccountModal/index.tsx @@ -44,7 +44,6 @@ const AccountModal = () => { const privateSelect = React.createRef() useEffect(() => { - console.log(cookies.user) if (cookies.user) setPicture(cookies.user.picture) if (cookies.user) setLanguage(cookies.user.language) }, [cookies]) diff --git a/components/FilterBar/index.tsx b/components/FilterBar/index.tsx index b34873ee..f3446142 100644 --- a/components/FilterBar/index.tsx +++ b/components/FilterBar/index.tsx @@ -9,48 +9,61 @@ import './index.scss' interface Props { children: React.ReactNode scrolled: boolean - onFilter: (element?: number, raid?: string, recency?: number) => void + element?: number + raidSlug?: string + recency?: number + onFilter: ({element, raidSlug, recency} : { element?: number, raidSlug?: string, recency?: number}) => void } const FilterBar = (props: Props) => { + // Set up translation const { t } = useTranslation('common') + // Set up refs for filter dropdowns const elementSelect = React.createRef() const raidSelect = React.createRef() const recencySelect = React.createRef() + // Set up classes object for showing shadow on scroll const classes = classNames({ 'FilterBar': true, 'shadow': props.scrolled }) - function selectChanged(event: React.ChangeEvent) { + function elementSelectChanged() { const elementValue = (elementSelect.current) ? parseInt(elementSelect.current.value) : -1 - const raidValue = (raidSelect.current) ? raidSelect.current.value : '' - const recencyValue = (recencySelect.current) ? parseInt(recencySelect.current.value) : -1 + props.onFilter({ element: elementValue }) + } - props.onFilter(elementValue, raidValue, recencyValue) + function recencySelectChanged() { + const recencyValue = (recencySelect.current) ? parseInt(recencySelect.current.value) : -1 + props.onFilter({ recency: recencyValue }) + } + + function raidSelectChanged(slug?: string) { + props.onFilter({ raidSlug: slug }) } return (
{props.children} - + + + + + + + + - diff --git a/components/GridRep/index.tsx b/components/GridRep/index.tsx index 14543b06..227a0dcd 100644 --- a/components/GridRep/index.tsx +++ b/components/GridRep/index.tsx @@ -117,13 +117,18 @@ const GridRep = (props: Props) => {

{ (props.name) ? props.name : t('no_title') }

{ (props.raid) ? props.raid.name[locale] : t('no_raid') }
- { (account.authorized && (props.user && account.user && account.user.id !== props.user.id)) ? -