Skip to content

Commit

Permalink
remove overlapping commits for [MPT-45]
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffzy15 committed Nov 8, 2023
1 parent 25d4ea6 commit 503d723
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 43 deletions.
2 changes: 1 addition & 1 deletion components/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const ResponsiveDrawer = (props: Props) => {
};

return (
<Box sx={{ display: "flex", paddingBottom: "70px" }}>
<Box sx={{ display: "flex" }}>
<AppBar style={{ background: "white" }} className="toolbar-component">
<Toolbar style={{ display: "flex", justifyContent: "space-between" }}>
<Box style={{ display: "flex", justifyContent: "flex-start" }}>
Expand Down
8 changes: 2 additions & 6 deletions components/ResultView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ const fillHighlights = (snippet: string | null, full: string): string => {
}

const snippetRaw = htmlToText(snippet, { wordwrap: false });
const styledSnippet = snippet.replace(
/<em>/g,
'<em style= "font-weight: bold; color: #375ae6; font-style: normal; background-color: #edf6fe; padding: 3px; ">'
);
return full.replace(snippetRaw, styledSnippet);
return full.replace(snippetRaw, snippet);
};

const COLORS = [
Expand Down Expand Up @@ -112,7 +108,7 @@ const ResultView = ({ result }: { result: SearchResult }) => {
} = result;

const displayName =
name && name.raw ? fillHighlights(name.snippet, name.raw.bold()) : null;
name && name.raw ? fillHighlights(name.snippet, name.raw) : null;

const thumbnailImageUrl =
thumbnail_image_url && thumbnail_image_url.raw
Expand Down
42 changes: 6 additions & 36 deletions components/ResultViewList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ const ResultViewList = ({
{displayName && (
<span
className="sui-result__title"
dangerouslySetInnerHTML={{
__html: displayName.replace(
/<em[^>]*>/g,
'<em style="background-color: transparent;">'
),
}}
dangerouslySetInnerHTML={{ __html: displayName }}
/>
)}
</div>
Expand All @@ -61,12 +56,7 @@ const ResultViewList = ({
<span
className="sui-result__value"
style={{ fontSize: 16, fontWeight: 600 }}
dangerouslySetInnerHTML={{
__html: displayRole.replace(
/<em[^>]*>/g,
'<em style="background-color: transparent;">'
),
}}
dangerouslySetInnerHTML={{ __html: displayRole }}
/>
)}
{displayRole && displayOrganisation && (
Expand All @@ -79,12 +69,7 @@ const ResultViewList = ({
<span
className="sui-result__value"
style={{ fontSize: 16, fontWeight: 600 }}
dangerouslySetInnerHTML={{
__html: displayOrganisation.replace(
/<em[^>]*>/g,
'<em style="background-color: transparent;">'
),
}}
dangerouslySetInnerHTML={{ __html: displayOrganisation }}
/>
)}
</li>
Expand All @@ -95,12 +80,7 @@ const ResultViewList = ({
<span
className="sui-result__value"
style={{ fontSize: 16, fontWeight: 600 }}
dangerouslySetInnerHTML={{
__html: displayCourseOfStudy.replace(
/<em[^>]*>/g,
'<em style="background-color: transparent;">'
),
}}
dangerouslySetInnerHTML={{ __html: displayCourseOfStudy }}
/>
</li>
)}
Expand All @@ -110,12 +90,7 @@ const ResultViewList = ({
<span
className="sui-result__value"
style={{ fontSize: 16, fontWeight: 600 }}
dangerouslySetInnerHTML={{
__html: displaySchool.replace(
/<em[^>]*>/g,
'<em style="background-color: transparent;">'
),
}}
dangerouslySetInnerHTML={{ __html: displaySchool }}
/>
</li>
)}
Expand All @@ -125,12 +100,7 @@ const ResultViewList = ({
<span
className="sui-result__biography"
style={{ fontSize: 14 }}
dangerouslySetInnerHTML={{
__html: displayFullBio.replace(
/<em[^>]*>/g,
'<em style="background-color: transparent;">'
),
}}
dangerouslySetInnerHTML={{ __html: displayFullBio }}
/>
</li>
)}
Expand Down

0 comments on commit 503d723

Please sign in to comment.