Skip to content

Commit

Permalink
feat: start work on display
Browse files Browse the repository at this point in the history
  • Loading branch information
mediremi committed Jul 7, 2021
1 parent 264cb7c commit 466daa5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/data-workspace/data-workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState } from 'react'
import { useWorkflowContext } from '../workflow-context/index.js'
import { Navigation } from './navigation.js'
import { TitleBar } from './title-bar.js'
import { Display } from './display.js'

const DataWorkspace = () => {
const workflow = useWorkflowContext()
Expand All @@ -21,6 +22,10 @@ const DataWorkspace = () => {
selected={selectedDataSet}
onChange={setSelectedDataSet}
/>
<Display
workflowName={workflow.displayName}
dataSetId={selectedDataSet}
/>
</>
)
}
Expand Down
24 changes: 24 additions & 0 deletions src/data-workspace/display.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react'
import i18n from '@dhis2/d2-i18n'
import PropTypes from 'prop-types'
import { Card } from '@dhis2/ui'

const Display = ({ workflowName, dataSetId }) => {
if (true || !dataSetId) {
return (
<Card>
<h2>{i18n.t('Choose a data set to review')}</h2>
<p>{i18n.t('{{- workflowName}} has multiple data sets. Choose a data set from the tabs above.', { workflowName })}</p>
</Card>
)
}

return null
}

Display.propTypes = {
workflowName: PropTypes.string.isRequired,
dataSetId: PropTypes.string,
}

export { Display }

0 comments on commit 466daa5

Please sign in to comment.