We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17c5475 commit c7afe92Copy full SHA for c7afe92
src/components/Contributors/index.tsx
@@ -20,12 +20,20 @@ export interface Contributor {
20
21
const allContributors = JSON.parse(data)
22
23
-const Contributors = () => {
+interface ContributorsProps {
24
+ contributors?: Contributor[]
25
+}
26
+
27
+const Contributors = ({ contributors }: ContributorsProps) => {
28
const [contributorsList, setContributorsList] = useState<Contributor[]>([])
29
30
useEffect(() => {
- setContributorsList(shuffle(allContributors.contributors))
- }, [])
31
+ if (contributors) {
32
+ setContributorsList(contributors)
33
+ } else {
34
+ setContributorsList(shuffle(allContributors.contributors))
35
+ }
36
+ }, [contributors])
37
38
return (
39
<>
0 commit comments