File tree Expand file tree Collapse file tree 3 files changed +14
-20
lines changed Expand file tree Collapse file tree 3 files changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -356,6 +356,8 @@ export const PreviewTab = (props: Props) => {
356356 { usefulLinks . map ( identifier => {
357357 const url = identifier . url ?? identifier . subjectOf ?. url ;
358358
359+ if ( ! url ) return null ;
360+
359361 return (
360362 < LogoURLButton
361363 key = { url ?. toString ( ) }
Original file line number Diff line number Diff line change @@ -92,7 +92,10 @@ export function AuthorCard(props: Props) {
9292 { author . identifiers ?. map ( identifier => {
9393 return (
9494 < div className = { classes . externalLinkButtons } >
95- < LogoURLButton url = { identifier . url } labelFromURL = { true } />
95+ < LogoURLButton
96+ url = { identifier . url ?? identifier . subjectOf ?. url }
97+ labelFromURL = { true }
98+ />
9699 </ div >
97100 ) ;
98101 } ) }
Original file line number Diff line number Diff line change @@ -66,9 +66,13 @@ const resolveLogoFromURL = (
6666 return resolveLogoFromType ( "CNLL" ) ;
6767 }
6868
69+ if ( urlString . includes ( "framalibre" ) ) {
70+ return resolveLogoFromType ( "FramaLibre" ) ;
71+ }
72+
6973 return {
7074 URLlogo : undefined ,
71- textFromURL : undefined
75+ textFromURL : new URL ( urlString ) . hostname . replace ( "www." , "" )
7276 } ;
7377} ;
7478
@@ -167,17 +171,15 @@ export function LogoURLButton(props: Props) {
167171 iconId
168172 } = props ;
169173
174+ if ( ! url ) return null ;
175+
170176 const urlString = typeof url === "string" ? url : url ?. href ;
171177
172178 const { classes } = useStyles ( ) ;
173179
174180 const getUrlMetadata = ( ) => {
175181 if ( type ) return resolveLogoFromType ( type ) ;
176- if ( url ) return resolveLogoFromURL ( url ) ;
177- return {
178- URLlogo : undefined ,
179- textFromURL : undefined
180- } ;
182+ return resolveLogoFromURL ( url ) ;
181183 } ;
182184
183185 const { URLlogo, textFromURL } = getUrlMetadata ( ) ;
@@ -211,16 +213,3 @@ const useStyles = tss.withName({ LogoURLButton }).create({
211213 marginLeft : "7px"
212214 }
213215} ) ;
214-
215- const yo = [
216- {
217- "@type" : "PropertyValue" ,
218- value : "93" ,
219- subjectOf : {
220- url : "https://cnll.fr/" ,
221- name : "Union des entreprises du logiciel libre et du numérique ouvert" ,
222- "@type" : "Website" ,
223- additionalType : "cnll"
224- }
225- }
226- ] ;
You can’t perform that action at this time.
0 commit comments