Skip to content

Commit

Permalink
Created metadata directory and moving Metadata component to it.
Browse files Browse the repository at this point in the history
  • Loading branch information
erinesullivan committed Nov 21, 2024
1 parent cdc03d3 commit 49cd0e0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ const DescriptionItem = ({ browse, children, href, search }) => {
const { active: activeDatastore, datastores } = useSelector((state) => {
return state.datastores;
});
const { slug, uid } = datastores.find((datastore) => {
return datastore.uid === activeDatastore;
});

const anchorAttributes = { href };

if (search) {
const { slug, uid } = datastores.find((datastore) => {
return datastore.uid === activeDatastore;
});
const { scope, type, value } = search;
anchorAttributes.to = `/${slug}?${stringifySearch({
filter: type === 'filtered' ? { [scope]: value } : {},
Expand Down Expand Up @@ -103,7 +103,7 @@ Description.propTypes = {
viewType: PropTypes.string
};

export default function Metadata ({ data, viewType }) {
const Metadata = ({ data, viewType }) => {
return (
<dl className='flex__responsive metadata-list'>
{data.map((datum, datumIndex) => {
Expand Down Expand Up @@ -136,3 +136,5 @@ Metadata.propTypes = {
data: PropTypes.array,
viewType: PropTypes.string
};

export default Metadata;
5 changes: 5 additions & 0 deletions src/modules/metadata/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Metadata from './components/Metadata';

export {
Metadata
};
3 changes: 2 additions & 1 deletion src/modules/records/components/RecordMetadata/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ContextProvider, Metadata } from '../../../reusable';
import { ContextProvider } from '../../../reusable';
import { Metadata } from '../../../metadata';
import PropTypes from 'prop-types';
import React from 'react';

Expand Down
2 changes: 0 additions & 2 deletions src/modules/reusable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ContextProvider from './components/ContextProvider';
import Dialog from './components/Dialog';
import H1 from './components/H1';
import Icon from './components/Icon';
import Metadata from './components/Metadata';
import Tab from './components/Tab';
import TabPanel from './components/TabPanel';
import Tabs from './components/Tabs';
Expand All @@ -27,7 +26,6 @@ export {
ExpandableProvider,
H1,
Icon,
Metadata,
Tab,
Tabs,
TabPanel,
Expand Down

0 comments on commit 49cd0e0

Please sign in to comment.