Skip to content

Commit

Permalink
refactor(InsuredByDefinitionAndByAgeGroup): pass id prop to component…
Browse files Browse the repository at this point in the history
… and update section title
  • Loading branch information
jalezi committed Dec 10, 2024
1 parent a25f4d1 commit 2144190
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
/* eslint-disable react/prop-types */
/* eslint-disable no-shadow */

Expand Down Expand Up @@ -98,7 +99,7 @@ const useCharts = (initialFilterState, options, init) => {
};
};

const InsuredByDefinitionAndByAgeGroup = function InsuredByDefinitionAndByAgeGroup() {
const InsuredByDefinitionAndByAgeGroup = function InsuredByDefinitionAndByAgeGroup({ id }) {
const [init, setInit] = useState(false);
const { filterState, setFilterState, mapChartOptions, barChartOptions } = useCharts(
DEFAULTS,
Expand Down Expand Up @@ -126,6 +127,7 @@ const InsuredByDefinitionAndByAgeGroup = function InsuredByDefinitionAndByAgeGro

return (
<Card
id={id}
style={{
display: 'grid',
gridTemplateAreas: '"header header" "filters scorecards" "map chart"',
Expand Down
102 changes: 51 additions & 51 deletions src/pages/Analytics/data/sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
*
*/

// import { mapOptions as RomanLustrikCardMapOptions } from '../Cards/DataByYearAndAgeGroupCard/char-options';
// import { mapOptions as RichInfoClickOptions } from '../Cards/RichInfoClick/chart-options';
// import { availabilityChangeByInstitutionType } from './production/availability-change-by-institution-type';
import { mapOptions as RomanLustrikCardMapOptions } from '../Cards/DataByYearAndAgeGroupCard/char-options';
import { mapOptions as RichInfoClickOptions } from '../Cards/RichInfoClick/chart-options';
import { availabilityChangeByInstitutionType } from './production/availability-change-by-institution-type';

export const charts = [
{
section: 'production',
section: 'Analitični prikaz podatkov o dostopnosti do primarne zdravstvene oskrbe',
order: 1,
componentName: 'InsuredByDefinitionAndByAgeGroup',
fakeHeight: '500px',
Expand All @@ -24,53 +24,53 @@ export const charts = [
},
},
},
// {
// section: 'real section 1',
// order: 5,
// componentName: 'MotionCard',
// fakeHeight: '2876px',
// options: {
// title: {
// text: 'MotionCard',
// },
// },
// },
// {
// section: 'real section 1',
// order: 0,
// componentName: 'DashboardCard',
// fakeHeight: '683px',
// options: {
// title: {
// text: 'Dashboard',
// },
// },
// },
// availabilityChangeByInstitutionType,
// {
// section: 'real section 1',
// order: 1,
// componentName: 'DataByYearAndAgeGroupCard',
// fakeHeight: '1358px',
// options: {
// title: {
// text: RomanLustrikCardMapOptions.title.text
// ? RomanLustrikCardMapOptions.title.text
// : 'Missing Title',
// },
// },
// },
// {
// section: 'real section 1',
// order: 2,
// componentName: 'RichInfoClick',
// fakeHeight: '822px',
// options: {
// title: {
// text: RichInfoClickOptions.title.text ? RichInfoClickOptions.title.text : 'Missing Title',
// },
// },
// },
{
section: 'real section 1',
order: 5,
componentName: 'MotionCard',
fakeHeight: '2876px',
options: {
title: {
text: 'MotionCard',
},
},
},
{
section: 'real section 1',
order: 0,
componentName: 'DashboardCard',
fakeHeight: '683px',
options: {
title: {
text: 'Dashboard',
},
},
},
availabilityChangeByInstitutionType,
{
section: 'real section 1',
order: 1,
componentName: 'DataByYearAndAgeGroupCard',
fakeHeight: '1358px',
options: {
title: {
text: RomanLustrikCardMapOptions.title.text
? RomanLustrikCardMapOptions.title.text
: 'Missing Title',
},
},
},
{
section: 'real section 1',
order: 2,
componentName: 'RichInfoClick',
fakeHeight: '822px',
options: {
title: {
text: RichInfoClickOptions.title.text ? RichInfoClickOptions.title.text : 'Missing Title',
},
},
},
];

const groupedCharts = charts.reduce((acc, chart) => {
Expand Down

0 comments on commit 2144190

Please sign in to comment.