File tree 4 files changed +27
-37
lines changed
4 files changed +27
-37
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ const Parent: React.FC = () => {
42
42
43
43
const [ childKey , setChildKey ] = useState < number > ( 0 ) ;
44
44
const [ childrenLoading , setChildrenLoading ] = useState ( false ) ;
45
- const [ children , setChildren ] = useState ( [ ] ) ;
45
+ const [ children , setChildren ] = useState < string [ ] > ( [ ] ) ;
46
46
// const [stakeContract, setStakeContract] = useState<StakeContract>();
47
47
const [ familyDetails , setFamilyDetails ] = useState ( { } as User ) ;
48
48
@@ -320,7 +320,7 @@ const Parent: React.FC = () => {
320
320
bg = { useColorModeValue ( "gray.100" , "gray.900" ) }
321
321
borderRadius = { isMobileSize ? "0" : "10px" }
322
322
>
323
- < FamilyStatistics />
323
+ < FamilyStatistics members = { userDetails . children || [ ] } />
324
324
</ GridItem >
325
325
</ Grid >
326
326
</ Flex >
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export const ExpandedDashboardMenu = ({
45
45
onOpenAirdropModal,
46
46
} : {
47
47
familyDetails : User ;
48
- children : User [ ] ;
48
+ children : string [ ] ;
49
49
onAddChildOpen : ( ) => void ;
50
50
setSelectedTab : ( tab : ParentDashboardTabs ) => void ;
51
51
onToggleCollapsedMenu : ( ) => void ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const ButtonMenu = ({
28
28
onOpenNetworkModal : ( ) => void ;
29
29
onOpenMembersTableModal : ( ) => void ;
30
30
onOpenAirdropModal : ( ) => void ;
31
- children ?: User [ ] ;
31
+ children ?: string [ ] ;
32
32
} ) => {
33
33
const { userDetails } = useAuthStore (
34
34
( state ) => ( {
Original file line number Diff line number Diff line change 1
- import { Fragment } from "react" ;
2
1
import {
3
2
Container ,
4
3
Flex ,
5
- Stack ,
6
- VStack ,
7
- Icon ,
8
- Divider ,
9
4
useColorModeValue ,
10
- Avatar ,
11
5
Text ,
12
6
Heading ,
13
- Button ,
14
- Badge ,
15
7
Grid ,
16
8
GridItem ,
17
9
} from "@chakra-ui/react" ;
18
- import { SlOptions } from "react-icons/sl" ;
19
10
20
11
interface Notification {
21
12
title : string ;
22
13
value : string ;
23
14
unit : string ;
24
15
}
25
16
26
- const stats : Notification [ ] = [
27
- {
28
- title : "Members" ,
29
- value : "3" ,
30
- unit : "" ,
31
- } ,
32
- {
33
- title : "Currently Staked" ,
34
- value : "31,573" ,
35
- unit : "ETH" ,
36
- } ,
37
- {
38
- title : "Rewards Earned" ,
39
- value : "5" ,
40
- unit : "ETH" ,
41
- } ,
42
- {
43
- title : "Custom Contracts" ,
44
- value : "7" ,
45
- unit : "" ,
46
- } ,
47
- ] ;
48
-
49
- const FamilyStatistics = ( ) => {
17
+ const FamilyStatistics = ( { members } : { members : string [ ] } ) => {
18
+ const stats : Notification [ ] = [
19
+ {
20
+ title : "Members" ,
21
+ value : members . length . toString ( ) ,
22
+ unit : "" ,
23
+ } ,
24
+ {
25
+ title : "Currently Staked" ,
26
+ value : "31,573" ,
27
+ unit : "ETH" ,
28
+ } ,
29
+ {
30
+ title : "Rewards Earned" ,
31
+ value : "5" ,
32
+ unit : "ETH" ,
33
+ } ,
34
+ {
35
+ title : "Custom Contracts" ,
36
+ value : "7" ,
37
+ unit : "" ,
38
+ } ,
39
+ ] ;
50
40
return (
51
41
< Container maxW = "5xl" bg = { useColorModeValue ( "gray.100" , "gray.900" ) } >
52
42
< Flex justify = "space-between" my = "1rem" align = "center" >
You can’t perform that action at this time.
0 commit comments