From 29beb1dc8090e9cec31915319cb02970c37842cc Mon Sep 17 00:00:00 2001 From: monoid Date: Fri, 15 Jan 2021 21:51:36 +0900 Subject: [PATCH] shortening info tag --- src/client/component/contentinfo.tsx | 32 +++++++++++++++++----------- src/client/component/tagchip.tsx | 13 +++++++++-- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/client/component/contentinfo.tsx b/src/client/component/contentinfo.tsx index 5d2d484..3e90593 100644 --- a/src/client/component/contentinfo.tsx +++ b/src/client/component/contentinfo.tsx @@ -43,9 +43,9 @@ const useStyles = makeStyles((theme: Theme) => ({ overflowY: 'hidden', }, short_subinfoContainer:{ - [theme.breakpoints.up("xs")]:{ + [theme.breakpoints.down("md")]:{ display:'none', - } + }, }, short_root:{ overflowY:'hidden', @@ -103,8 +103,10 @@ export const ContentInfo = (props: { - + {document.deleted_at === null ? + () + : (Deleted)} - Artist - {artists.join(", ")} - Tags - - {allTag.map(x => { - return (); - })} - + {props.short ? ({document.tags.map(x => + () + )}) : ( + <> + Artist + {artists.join(", ")} + Tags + + {allTag.map(x => { + return (); + })} + + ) + } ); diff --git a/src/client/component/tagchip.tsx b/src/client/component/tagchip.tsx index 9e2bb2e..08ca771 100644 --- a/src/client/component/tagchip.tsx +++ b/src/client/component/tagchip.tsx @@ -59,6 +59,15 @@ export const ColorChip = (props:Omit & {color: string})=>{ } export const TagChip = (props:Omit & {tagname: string})=>{ - const {tagname,...rest} = props; - return ; + const {tagname,label,...rest} = props; + 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 ; } \ No newline at end of file