diff --git a/assets/src/components/DetailCard.js b/assets/src/components/DetailCard.js index e48d54e5..ef6de367 100644 --- a/assets/src/components/DetailCard.js +++ b/assets/src/components/DetailCard.js @@ -1,171 +1,166 @@ import React, {useContext} from "react" import { makeStyles } from '@material-ui/core/styles'; import "./detailscard.css" import Typography from '@material-ui/core/Typography'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import Card from '@material-ui/core/Card'; import CardActions from '@material-ui/core/CardActions'; import CardContent from '@material-ui/core/CardContent'; import Button from '@material-ui/core/Button'; import { HiLink } from "react-icons/hi"; - +import DoneIcon from '@material-ui/icons/Done'; import "./termcard.css" const useStyles = makeStyles((theme) => ({ root: { '& > *': { margin: theme.spacing(1), display: 'grid', }, flexGrow: 1, }, formControl: { margin: theme.spacing(1), width: 200, }, selectEmpty: { marginTop: theme.spacing(1), }, chip: { margin: 0.5, }, heading: { fontSize: theme.typography.pxToRem(15), fontWeight: theme.typography.fontWeightRegular, }, })); function DetailsCard({details}) { const classes = useStyles(); if (details !== 'null') { console.log(details) return (

{details.name}

{details.country && details.country.map(item => { return
{item.name}
; })} {details.starting_year &&
{details.starting_year}
}
{details.oa_status ?
{details.oa_status.status !== "UNKNOWN" ?

Open Acces Status: {details.oa_status.status}

{details.oa_status.description}

:null}
:null} {details.publisher && details.publisher.map(item => { return
Publisher: {item.name}
; })}
{details.doaj_seal &&
- +
} {details.doaj_status &&
+ target="blank" rel="noopener noreferrer" size="small"> Journal listed on DOAJ
} {details.lockss &&
- +
} {details.portico &&
- +
} {details.nlch &&
- +
} {details.qoam_av_score &&
- +
}
{details.website ? :null} {details.oa_options ? :null}
- - - {/* */} - {/* - */}
) } else if (details !== 'null' && details2 !== 'null') { return (
{details2.name}
) } else { return null } } export default DetailsCard \ No newline at end of file diff --git a/assets/src/components/TermCard.js b/assets/src/components/TermCard.js index ff33c3f0..2530a64a 100644 --- a/assets/src/components/TermCard.js +++ b/assets/src/components/TermCard.js @@ -1,251 +1,248 @@ import React from "react" import { makeStyles } from '@material-ui/core/styles'; import "./termcard.css" import Chip from '@material-ui/core/Chip'; import DoneIcon from '@material-ui/icons/Done'; import HighlightOffIcon from '@material-ui/icons/HighlightOff'; import Accordion from '@material-ui/core/Accordion'; import AccordionSummary from '@material-ui/core/AccordionSummary'; import AccordionDetails from '@material-ui/core/AccordionDetails'; import Typography from '@material-ui/core/Typography'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import DateRangeIcon from '@material-ui/icons/DateRange'; import { FaCoins } from 'react-icons/fa'; import { RiFilePaper2Line } from 'react-icons/ri'; import Button from '@material-ui/core/Button'; import { HiLink } from "react-icons/hi"; import { GrInfo } from "react-icons/gr"; import Container from '@material-ui/core/Container' import Grid from '@material-ui/core/Grid' import Card from '@material-ui/core/Card'; import CardActions from '@material-ui/core/CardActions'; import CardContent from '@material-ui/core/CardContent'; const useStyles = makeStyles((theme) =>({ card: { width: '100%', marginTop: "1rem", textAlign:'left' }, root: { flexGrow: 1, textAlign:'left', }, chip: { margin: 0.5, }, heading: { fontSize: theme.typography.pxToRem(15), fontWeight: theme.typography.fontWeightRegular, }, })) function TermCard({term}) { const classes = useStyles(); const licenceIcon = term[0].licence?.map(i=>( <> )) function cost() { const price = term[0].cost_factor?.map(i => ( i.amount )) const price_symbol = term[0].cost_factor?.map(j => ( j.symbol )) const cost_name = term[0].cost_factor?.map(k => ( k.cost_factor_type.name )) const id = term[0].cost_factor?.map(k => ( k.cost_factor_type.id )) const comment = term[0].cost_factor?.map(k => ( k.comment )) return ( <> } label={cost_name[0] + " : " + price[0] + " " + price_symbol} // clickable={handleClick} // color="secondary" // onDelete={handleDelete} className={classes.chip} style={{ background: "#FFFFFF"}} title={comment} /> ) } const termArchive = term[0].ir_archiving && term[0].ir_archiving ? ( } label={"IR Archiving"} // variant="outlined" // clickable={handleClick} // color="secondary" // onDelete={handleDelete} style={{ background: "#FFFFFF"}} title="This is more information" /> ): ( } label="IR Archiving" // clickable={handleClick} // color="secondary" // onDelete={handleDelete} style={{ background: "#f50057"}} title="This is more information" /> ) const embargo = term[0].ir_archiving && term[0].ir_archiving ? ( } label={"Embargo: " + term[0].embargo_months + " Month(s)"} // variant="outlined" // clickable={handleClick} // color="secondary" // onDelete={handleDelete} style={{ background: "#FFFFFF"}} title="This is more information" /> ): () return ( +
{term.map( j=> ( j[0] &&

Condition set N° {j[0]}: {j[1]}

)) } Term ID: {term[0].id} {term[0].comment ?

{term[0].comment}

:null}
{cost()} {licenceIcon} {termArchive} {embargo} - - +
{term[0].source ? :null}
- - - - +
) } export default TermCard \ No newline at end of file