Verified Commit f57fb0f6 authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Update general components, Add study documents upload hint

parent 0a01a7ce
...@@ -4,19 +4,8 @@ import { Link as MaterialLink } from '@material-ui/core' ...@@ -4,19 +4,8 @@ import { Link as MaterialLink } from '@material-ui/core'
import { Link as GatsbyPluginIntlLink } from 'gatsby-plugin-intl' import { Link as GatsbyPluginIntlLink } from 'gatsby-plugin-intl'
const Link = ({ children, ...props }) => { const Link = ({ children, ...props }) => {
// eslint-disable-next-line no-unused-vars
const MyGatsbyPluginIntlLink = React.forwardRef((nestedProps, ref) => {
return <GatsbyPluginIntlLink {...nestedProps} />
})
MyGatsbyPluginIntlLink.displayName = 'MyGatsbyPluginIntlLink'
return ( return (
<MaterialLink <MaterialLink {...props} component={GatsbyPluginIntlLink}>
{...props}
target="_blank"
rel="noopener noreferrer"
component={MyGatsbyPluginIntlLink}
>
{children} {children}
</MaterialLink> </MaterialLink>
) )
......
import React from 'react'
import PropTypes from 'prop-types'
import { FormattedMessage } from 'gatsby-plugin-intl'
import { makeStyles } from '@material-ui/styles'
import Alert from '@material-ui/lab/Alert'
import Link from '../general/link'
const useStyles = makeStyles(
{
root: {
margin: '2em 0',
},
link: {
cursor: 'pointer',
},
dialogContent: {
padding: '0 24px 16px 24px',
},
},
{ name: 'studydocumentsUploadHint' }
)
const StudydocumentsUploadHint = ({ className, ...props }) => {
const classes = useStyles()
return (
<Alert
className={[classes.root, className].join(' ')}
severity="info"
{...props}
>
<div>
<b>
<FormattedMessage id="studydocuments.uploadCatchphrase" />
</b>
&nbsp;
<Link to="/studydocuments/new" className={classes.link}>
<FormattedMessage id="studydocuments.upload" />
</Link>
</div>
</Alert>
)
}
StudydocumentsUploadHint.propTypes = {
/** @ignore */
className: PropTypes.string,
}
export default StudydocumentsUploadHint
...@@ -22,6 +22,10 @@ const useStyles = makeStyles( ...@@ -22,6 +22,10 @@ const useStyles = makeStyles(
}, },
link: { link: {
cursor: 'pointer', cursor: 'pointer',
'&:hover': {
textDecoration: 'underline',
},
}, },
dialogContent: { dialogContent: {
padding: '0 24px 16px 24px', padding: '0 24px 16px 24px',
......
...@@ -205,6 +205,7 @@ ...@@ -205,6 +205,7 @@
"studydocuments.files": "Dateien", "studydocuments.files": "Dateien",
"studydocuments.noFilesForUpload": "Keine Dateien ausgewählt. Nur die Meta-Informationen werden aktualisiert!", "studydocuments.noFilesForUpload": "Keine Dateien ausgewählt. Nur die Meta-Informationen werden aktualisiert!",
"studydocuments.noFiles": "Keine Dateien ausgewählt.", "studydocuments.noFiles": "Keine Dateien ausgewählt.",
"studydocuments.uploadCatchphrase": "Möchtest du deine Zusammenfassung(en) teilen?",
"studydocuments.upload": "Dokument(e) hochladen", "studydocuments.upload": "Dokument(e) hochladen",
"studydocuments.uploadTitle.new": "Ein neues Dokument hochladen", "studydocuments.uploadTitle.new": "Ein neues Dokument hochladen",
"studydocuments.uploadTitle.edit": "Dokument bearbeiten", "studydocuments.uploadTitle.edit": "Dokument bearbeiten",
......
...@@ -200,6 +200,7 @@ ...@@ -200,6 +200,7 @@
"studydocuments.files": "Files", "studydocuments.files": "Files",
"studydocuments.noFilesForUpload": "No files selected for upload. Only the meta data will be updated!", "studydocuments.noFilesForUpload": "No files selected for upload. Only the meta data will be updated!",
"studydocuments.noFiles": "No files selected.", "studydocuments.noFiles": "No files selected.",
"studydocuments.uploadCatchphrase": "Do you want to share your own summary?",
"studydocuments.upload": "Upload study document(s)", "studydocuments.upload": "Upload study document(s)",
"studydocuments.uploadTitle.new": "Upload a new study document", "studydocuments.uploadTitle.new": "Upload a new study document",
"studydocuments.uploadTitle.edit": "Edit a study document", "studydocuments.uploadTitle.edit": "Edit a study document",
......
...@@ -17,6 +17,7 @@ import StudydocumentSummary from '../../components/studydocuments/summary' ...@@ -17,6 +17,7 @@ import StudydocumentSummary from '../../components/studydocuments/summary'
import StudydocumentDetails from '../../components/studydocuments/details' import StudydocumentDetails from '../../components/studydocuments/details'
import StudydocumentsQuickFilter from '../../components/studydocuments/quickFilter' import StudydocumentsQuickFilter from '../../components/studydocuments/quickFilter'
import StudydocumentsOralExamsDialog from '../../components/studydocuments/oralExamsDialog' import StudydocumentsOralExamsDialog from '../../components/studydocuments/oralExamsDialog'
import StudydocumentsUploadHint from '../../components/studydocuments/documentUploadHint'
const useStyles = makeStyles( const useStyles = makeStyles(
{ {
...@@ -127,6 +128,9 @@ const StudydocumentsPage = ({ studydocumentId }) => { ...@@ -127,6 +128,9 @@ const StudydocumentsPage = ({ studydocumentId }) => {
{/* Hint for oral exam protocols */} {/* Hint for oral exam protocols */}
<StudydocumentsOralExamsDialog /> <StudydocumentsOralExamsDialog />
{/* Hint for uploading documents */}
<StudydocumentsUploadHint />
{/* Pinned studydocument */} {/* Pinned studydocument */}
{pinnedId && ( {pinnedId && (
<FilteredList> <FilteredList>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment