Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-8070: fix heading styles with hds #544

Merged
merged 2 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/js/linkedevents.min.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion hdbt.theme
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,9 @@ function hdbt_preprocess_paragraph__event_list(&$variables) {
$eventUrl = $linkedEvents->getEventsRequest($params, $settings['field_event_count']);
$settings['events_api_url'] = $eventUrl;
$settings['request_url'] = $eventUrl;
$settings['places'] = $linkedEvents->getPlaceslist($eventUrl);
if ($paragraph->get('field_event_location')->first()->getValue()['value']) {
$settings['places'] = $linkedEvents->getPlaceslist($eventUrl);
}
}

$booleanFields = [
Expand Down
1 change: 0 additions & 1 deletion src/js/react/apps/linkedevents/components/DateSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { DateInput } from 'hds-react';
import Collapsible from './Collapsible';
import { QueryBuilder } from '../utils/QueryBuilder';
Expand Down
3 changes: 3 additions & 0 deletions src/js/react/apps/linkedevents/containers/SearchContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import FormContainer from './FormContainer';
import ResultsContainer from './ResultsContainer';
import type Event from '../types/Event';
import { queryBuilderAtom, urlAtom } from '../store';
import removeHdsNormalizeStyleElementFromDom from '@/react/common/hooks/removeHdsNormalizeStyleElementFromDom';

type ResponseType = {
data: Event[];
Expand All @@ -27,6 +28,8 @@ const SearchContainer = () => {
const queryBuilder = useAtomValue(queryBuilderAtom);
const url = useAtomValue(urlAtom) || queryBuilder?.getUrl();

removeHdsNormalizeStyleElementFromDom();

if (!queryBuilder) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { useLayoutEffect } from 'react';

const removeHdsNormalizeStyleElementFromDom = () => {
useLayoutEffect(() => {
const styleElements = document.querySelectorAll('style');
Object.keys(styleElements).forEach((key: any) => {
if (styleElements[key].innerHTML.startsWith('/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */')) {
styleElements[key].remove();
}
});
});
};

export default removeHdsNormalizeStyleElementFromDom;