Skip to content

Commit

Permalink
search results: render Mathjax in the requests results list
Browse files Browse the repository at this point in the history
  • Loading branch information
anikachurilova committed Sep 19, 2024
1 parent baaeb19 commit 4517a22
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { InvenioSearchPagination } from "@js/invenio_search_ui/components";
import { i18next } from "@translations/invenio_requests/i18next";
import PropTypes from "prop-types";
import React from "react";
import React, { useCallback } from "react";
import { Count, ResultsList, Sort } from "react-searchkit";
import { Grid, Segment } from "semantic-ui-react";

Expand All @@ -17,6 +17,10 @@ export const RequestsResults = ({
currentResultsState,
}) => {
const { total } = currentResultsState.data;

const handleMathjaxCallback = useCallback(() => {
window.MathJax?.typeset();
}, []);
return (
total && (
<Grid>
Expand Down Expand Up @@ -55,7 +59,7 @@ export const RequestsResults = ({
</Grid.Row>
<Grid.Row>
<Grid.Column>
<ResultsList />
<ResultsList mathjaxCallback={handleMathjaxCallback} />
</Grid.Column>
</Grid.Row>
</Grid>
Expand Down

0 comments on commit 4517a22

Please sign in to comment.