shortening info tag
This commit is contained in:
parent
dfc154b711
commit
29beb1dc80
@ -43,9 +43,9 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
overflowY: 'hidden',
|
overflowY: 'hidden',
|
||||||
},
|
},
|
||||||
short_subinfoContainer:{
|
short_subinfoContainer:{
|
||||||
[theme.breakpoints.up("xs")]:{
|
[theme.breakpoints.down("md")]:{
|
||||||
display:'none',
|
display:'none',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
short_root:{
|
short_root:{
|
||||||
overflowY:'hidden',
|
overflowY:'hidden',
|
||||||
@ -103,8 +103,10 @@ export const ContentInfo = (props: {
|
|||||||
<Link className={propclasses.thumbnail_anchor || thumbnail_anchor} component={RouterLink} to={{
|
<Link className={propclasses.thumbnail_anchor || thumbnail_anchor} component={RouterLink} to={{
|
||||||
pathname:makeContentReaderUrl(document.id)
|
pathname:makeContentReaderUrl(document.id)
|
||||||
}}>
|
}}>
|
||||||
<ThumbnailContainer content={document}
|
{document.deleted_at === null ?
|
||||||
className={propclasses.thumbnail_content || thumbnail_content}/>
|
(<ThumbnailContainer content={document}
|
||||||
|
className={propclasses.thumbnail_content || thumbnail_content}/>)
|
||||||
|
: (<Typography className={propclasses.thumbnail_content || thumbnail_content} variant='h4'>Deleted</Typography>)}
|
||||||
</Link>
|
</Link>
|
||||||
<Box className={propclasses.infoContainer || classes.infoContainer}>
|
<Box className={propclasses.infoContainer || classes.infoContainer}>
|
||||||
<Link variant='h5' color='inherit' component={RouterLink} to={{
|
<Link variant='h5' color='inherit' component={RouterLink} to={{
|
||||||
@ -114,14 +116,20 @@ export const ContentInfo = (props: {
|
|||||||
{document.title}
|
{document.title}
|
||||||
</Link>
|
</Link>
|
||||||
<Box className={propclasses.subinfoContainer || subinfoContainer}>
|
<Box className={propclasses.subinfoContainer || subinfoContainer}>
|
||||||
<Typography variant='subtitle1'>Artist</Typography>
|
{props.short ? (<Box className={propclasses.tag_list || classes.tag_list}>{document.tags.map(x =>
|
||||||
<Box style={{ alignSelf: "center" }}>{artists.join(", ")}</Box>
|
(<TagChip key={x} label={x} clickable={true} tagname={x} size="small"></TagChip>)
|
||||||
<Typography variant='subtitle1'>Tags</Typography>
|
)}</Box>) : (
|
||||||
<Box className={propclasses.tag_list || classes.tag_list}>
|
<>
|
||||||
{allTag.map(x => {
|
<Typography variant='subtitle1'>Artist</Typography>
|
||||||
return (<TagChip key={x} label={x} clickable={true} tagname={x} size="small"></TagChip>);
|
<Box style={{ alignSelf: "center" }}>{artists.join(", ")}</Box>
|
||||||
})}
|
<Typography variant='subtitle1'>Tags</Typography>
|
||||||
</Box>
|
<Box className={propclasses.tag_list || classes.tag_list}>
|
||||||
|
{allTag.map(x => {
|
||||||
|
return (<TagChip key={x} label={x} clickable={true} tagname={x} size="small"></TagChip>);
|
||||||
|
})}
|
||||||
|
</Box>
|
||||||
|
</>)
|
||||||
|
}
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</Paper>);
|
</Paper>);
|
||||||
|
@ -59,6 +59,15 @@ export const ColorChip = (props:Omit<ChipProps,"color"> & {color: string})=>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const TagChip = (props:Omit<ChipProps,"color"> & {tagname: string})=>{
|
export const TagChip = (props:Omit<ChipProps,"color"> & {tagname: string})=>{
|
||||||
const {tagname,...rest} = props;
|
const {tagname,label,...rest} = props;
|
||||||
return <ColorChip color={getTagColorName(tagname)} {...rest}></ColorChip>;
|
let newlabel:string|undefined = undefined;
|
||||||
|
if(typeof label === "string"){
|
||||||
|
if(label.startsWith("female:")){
|
||||||
|
newlabel ="♀ "+label.substr(7);
|
||||||
|
}
|
||||||
|
else if(label.startsWith("male:")){
|
||||||
|
newlabel = "♂ "+label.substr(5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return <ColorChip color={getTagColorName(tagname)} label={newlabel||label} {...rest}></ColorChip>;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user