@@ -51,26 +51,24 @@ const leaders = {
5151const projectKey = 'nest'
5252
5353const About = ( ) => {
54- const {
55- data : projectMetadataResponse ,
56- error : projectMetadataRequestError ,
57- loading : projectMetadataLoading ,
58- } = useQuery ( GetProjectMetadataDocument , {
59- variables : { key : projectKey } ,
60- } )
54+ const { data : projectMetadataResponse , error : projectMetadataRequestError } = useQuery (
55+ GetProjectMetadataDocument ,
56+ {
57+ variables : { key : projectKey } ,
58+ }
59+ )
6160
62- const {
63- data : topContributorsResponse ,
64- error : topContributorsRequestError ,
65- loading : topContributorsLoading ,
66- } = useQuery ( GetTopContributorsDocument , {
67- variables : {
68- excludedUsernames : Object . keys ( leaders ) ,
69- hasFullName : true ,
70- key : projectKey ,
71- limit : 24 ,
72- } ,
73- } )
61+ const { data : topContributorsResponse , error : topContributorsRequestError } = useQuery (
62+ GetTopContributorsDocument ,
63+ {
64+ variables : {
65+ excludedUsernames : Object . keys ( leaders ) ,
66+ hasFullName : true ,
67+ key : projectKey ,
68+ limit : 24 ,
69+ } ,
70+ }
71+ )
7472
7573 const { leadersData, isLoading : leadersLoading } = useLeadersData ( )
7674
@@ -97,7 +95,12 @@ const About = () => {
9795 }
9896 } , [ topContributorsResponse , topContributorsRequestError ] )
9997
100- const isLoading = projectMetadataLoading || topContributorsLoading || leadersLoading
98+ const isLoading =
99+ ! projectMetadataResponse ||
100+ ! topContributorsResponse ||
101+ ( projectMetadataRequestError && ! projectMetadata ) ||
102+ ( topContributorsRequestError && ! topContributors ) ||
103+ leadersLoading
101104
102105 if ( isLoading ) {
103106 return < LoadingSpinner />
@@ -251,8 +254,15 @@ const About = () => {
251254 </ SecondaryCard >
252255 ) }
253256 < SecondaryCard icon = { faScroll } title = { < AnchorTitle title = "Our Story" /> } >
254- { projectStory . map ( ( text , index ) => (
255- < div key = { `story-${ index } ` } className = "mb-4" >
257+ { projectStory . map ( ( text ) => (
258+ < div
259+ key = { text
260+ . slice ( 0 , 40 )
261+ . trim ( )
262+ . replaceAll ( ' ' , '-' )
263+ . replaceAll ( / [ ^ \w - ] / g, '' ) }
264+ className = "mb-4"
265+ >
256266 < div >
257267 < Markdown content = { text } />
258268 </ div >
0 commit comments