Skip to content

Commit

Permalink
search fix
Browse files Browse the repository at this point in the history
  • Loading branch information
remko48 committed Sep 11, 2024
1 parent b8b0bfe commit 9c7dc38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ export const PublicationsDetailTemplate: React.FC<PublicationsDetailTemplateProp
{_getPublication.data?.metaData &&
<Table>
<TableBody>
{_getPublication.data?.data?.reference &&
{_getPublication.data?.reference &&
<TableRow>
<TableCell><b>{t("Reference")}</b></TableCell>
<TableCell>{_getPublication.data.data.reference}</TableCell>
<TableCell>{_getPublication.data.reference}</TableCell>
</TableRow>
}
{_getPublication.data?.license &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import * as React from "react";
import * as styles from "./SearchComponentTemplate.module.css";
import { useTranslation } from "react-i18next";
import { useForm } from "react-hook-form";
import { IFiltersContext, useFiltersContext } from "../../../context/filters";
import { navigate } from "gatsby";
import { FormField, Textbox, ButtonGroup, Button } from "@utrecht/component-library-react/dist/css-module";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowRight, faSearch } from "@fortawesome/free-solid-svg-icons";
import { usePaginationContext } from "../../../context/pagination";
import { IPublicationFiltersContext, usePublicationFiltersContext } from "../../../context/publicationFilters";

interface SearchComponentTemplateProps {
layoutClassName?: string;
}

export const SearchComponentTemplate: React.FC<SearchComponentTemplateProps> = ({ layoutClassName }) => {
const { setFilters } = useFiltersContext();
const { setPublicationFilters } = usePublicationFiltersContext();
const { pagination, setPagination } = usePaginationContext();
const { t } = useTranslation();

Expand All @@ -25,9 +25,9 @@ export const SearchComponentTemplate: React.FC<SearchComponentTemplateProps> = (
} = useForm();

const onSubmit = (data: any): void => {
setFilters({
setPublicationFilters({
_search: data.name,
} as IFiltersContext);
} as IPublicationFiltersContext);
setPagination({
...pagination,
componentsCurrentPage: pagination.componentsCurrentPage,
Expand Down

0 comments on commit 9c7dc38

Please sign in to comment.