Skip to content

Commit

Permalink
Merge branch 'master' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVandivier committed Jul 23, 2024
2 parents 95129e9 + 6c96827 commit 411afc7
Show file tree
Hide file tree
Showing 4 changed files with 779 additions and 922 deletions.
4 changes: 3 additions & 1 deletion adapter/src/components/AppWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const AppWrapper = ({
plugin={true}
onPluginError={onPluginError}
onRetry={() => {
clearPluginError()
if (clearPluginError) {
clearPluginError()
}
window.location.reload()
}}
>
Expand Down
42 changes: 19 additions & 23 deletions cli/config/init.entrypoint.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DataQuery } from '@dhis2/app-runtime'
import { useDataQuery } from '@dhis2/app-runtime'
import i18n from '@dhis2/d2-i18n'
import React from 'react'
import classes from './App.module.css'
Expand All @@ -9,27 +9,23 @@ const query = {
},
}

const MyApp = () => (
<div className={classes.container}>
<DataQuery query={query}>
{({ error, loading, data }) => {
if (error) {
return <span>ERROR</span>
}
if (loading) {
return <span>...</span>
}
return (
<>
<h1>
{i18n.t('Hello {{name}}', { name: data.me.name })}
</h1>
<h3>{i18n.t('Welcome to DHIS2!')}</h3>
</>
)
}}
</DataQuery>
</div>
)
const MyApp = () => {
const { error, loading, data } = useDataQuery(query)

if (error) {
return <span>{i18n.t('ERROR')}</span>
}

if (loading) {
return <span>{i18n.t('Loading...')}</span>
}

return (
<div className={classes.container}>
<h1>{i18n.t('Hello {{name}}', { name: data.me.name })}</h1>
<h3>{i18n.t('Welcome to DHIS2!')}</h3>
</div>
)
}

export default MyApp
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"html-webpack-plugin": "^5.5.0",
"http-proxy": "^1.18.1",
"i18next-conv": "^9",
"i18next-scanner": "^2.10.3",
"i18next-scanner": "^3.3.0",
"inquirer": "^7.3.3",
"lodash": "^4.17.11",
"mini-css-extract-plugin": "^2.5.3",
Expand Down
Loading

0 comments on commit 411afc7

Please sign in to comment.