@@ -12,23 +12,23 @@ import { Container } from '../components/Container'
12
12
import { Showcase } from '../components/Showcase'
13
13
import Layout from '@theme/Layout'
14
14
15
- const HomeSplash = props => {
15
+ const HomeSplash = ( props ) => {
16
16
const { language = '' } = props
17
17
const { siteConfig } = useDocusaurusContext ( )
18
18
const { baseUrl, customFields } = siteConfig
19
19
const docsPart = `${ customFields . docsPath ? `${ customFields . docsPath } /` : '' } `
20
20
const langPart = `${ language ? `${ language } /` : '' } `
21
- const docUrl = doc => `${ baseUrl } ${ docsPart } ${ langPart } ${ doc } `
21
+ const docUrl = ( doc ) => `${ baseUrl } ${ docsPart } ${ langPart } ${ doc } `
22
22
23
- const SplashContainer = props => (
23
+ const SplashContainer = ( props ) => (
24
24
< div className = "homeContainer" >
25
25
< div className = "homeSplashFade" >
26
26
< div className = "wrapper homeWrapper" > { props . children } </ div >
27
27
</ div >
28
28
</ div >
29
29
)
30
30
31
- const Logo = props => (
31
+ const Logo = ( props ) => (
32
32
< div className = "projectLogo" >
33
33
< img src = { props . img_src } alt = "Project Logo" />
34
34
</ div >
@@ -43,7 +43,7 @@ const HomeSplash = props => {
43
43
</ div >
44
44
)
45
45
46
- const Button = props => (
46
+ const Button = ( props ) => (
47
47
< div className = "pluginWrapper buttonWrapper" >
48
48
< a
49
49
className = "button button--primary button--outline"
@@ -71,7 +71,7 @@ export default class Index extends React.Component {
71
71
const { config : siteConfig , language = '' } = this . props
72
72
const { baseUrl } = siteConfig
73
73
74
- const Block = props => (
74
+ const Block = ( props ) => (
75
75
< Container
76
76
padding = { [ 'bottom' , 'top' ] }
77
77
id = { props . id }
@@ -241,36 +241,17 @@ export default class Index extends React.Component {
241
241
if ( ( siteConfig . customFields . users || [ ] ) . length === 0 ) {
242
242
return null
243
243
}
244
- const NUMBER_OF_UNPINNED_USERS_TO_SHOWCASE = 3
245
244
246
- const randomizedList = ( arr , n ) => {
247
- var result = new Array ( n ) ,
248
- len = arr . length ,
249
- taken = new Array ( len )
250
- if ( n > len ) return arr
251
- while ( n -- ) {
252
- var x = Math . floor ( Math . random ( ) * len )
253
- result [ n ] = arr [ x in taken ? taken [ x ] : x ]
254
- taken [ x ] = -- len in taken ? taken [ len ] : len
255
- }
256
- return result
257
- }
258
-
259
- const userShowcase = [
260
- ...siteConfig . customFields . users . filter ( u => u . pinned ) ,
261
- ...randomizedList (
262
- siteConfig . customFields . users . filter ( u => ! u . pinned ) ,
263
- NUMBER_OF_UNPINNED_USERS_TO_SHOWCASE
264
- ) ,
265
- ]
266
-
267
- const pageUrl = page => baseUrl + ( language ? `${ language } /` : '' ) + page
245
+ const pageUrl = ( page ) =>
246
+ baseUrl + ( language ? `${ language } /` : '' ) + page
268
247
269
248
return (
270
249
< div className = "productShowcaseSection paddingBottom paddingTop" >
271
250
< h2 > Who is Using This?</ h2 >
272
251
< div className = "logos" >
273
- < Showcase users = { userShowcase } />
252
+ < Showcase
253
+ users = { siteConfig . customFields . users . filter ( ( u ) => u . pinned ) }
254
+ />
274
255
</ div >
275
256
< a
276
257
className = "button button--primary button--outline"
0 commit comments