1
+ import React , { useEffect , useState , useMemo } from "react" ;
1
2
import { styled } from "@mui/system" ;
2
3
import SingleDiamondButton from "../../components/SingleDiamondButton" ;
3
4
import NumberBoxes from "../../components/NumberBoxes" ;
4
5
import StatsTable from "../../components/StatsTable" ;
5
- import { useEffect , useState } from "react" ;
6
6
import { store } from "../../store" ;
7
7
import { getDestinyMembershipId } from "../../features/membership/BungieAccount" ;
8
8
import { updateMembership } from "../../store/MembershipReducer" ;
@@ -13,7 +13,7 @@ import { updateManifest } from "../../lib/bungie_api/Manifest";
13
13
import { separateArmor } from "../../features/armor-optimization/separatedArmor" ;
14
14
import { generatePermutations } from "../../features/armor-optimization/generatePermutations" ;
15
15
import { filterPermutations } from "../../features/armor-optimization/filterPermutations" ;
16
- import { DestinyArmor , ArmorByClass } from "../../types" ;
16
+ import { DestinyArmor , ArmorByClass } from "../../types" ; // Corrected import
17
17
18
18
const Container = styled ( "div" ) ( {
19
19
display : "flex" ,
@@ -27,8 +27,8 @@ const HeaderContainer = styled("div")({
27
27
display : "flex" ,
28
28
justifyContent : "center" ,
29
29
alignItems : "center" ,
30
- marginBottom : "10px" , // Further reduced margin to bring items closer
31
- gap : "20px" , // Add gap to ensure proper spacing
30
+ marginBottom : "10px" ,
31
+ gap : "20px" ,
32
32
} ) ;
33
33
34
34
const ContentContainer = styled ( "div" ) ( {
@@ -37,11 +37,11 @@ const ContentContainer = styled("div")({
37
37
justifyContent : "center" ,
38
38
alignItems : "flex-start" ,
39
39
width : "100%" ,
40
- padding : "10px" , // Further reduced padding to bring items closer
40
+ padding : "10px" ,
41
41
} ) ;
42
42
43
43
const LeftPane = styled ( "div" ) ( {
44
- marginRight : "10px" , // Reduced margin
44
+ marginRight : "10px" ,
45
45
} ) ;
46
46
47
47
const RightPane = styled ( "div" ) ( {
@@ -65,30 +65,15 @@ export const Dashboard = () => {
65
65
66
66
useEffect ( ( ) => {
67
67
const updateProfile = async ( ) => {
68
- // update / get manifest
69
68
await updateManifest ( ) ;
70
-
71
- console . log ( "Manifest updated" ) ;
72
-
73
- // store membership details into store
74
69
const destinyMembership = await getDestinyMembershipId ( ) ;
75
-
76
70
dispatch ( updateMembership ( destinyMembership ) ) ;
77
-
78
- // store profile armor array into store
79
71
const armor = await getProfileArmor ( ) ;
80
-
81
72
dispatch ( updateProfileArmor ( armor ) ) ;
82
-
83
- console . log ( store . getState ( ) . profile . armor ) ;
84
73
const separated = separateArmor ( armor ) ;
85
-
86
- console . log ( separated ) ;
87
74
const warlockPermutations = generatePermutations ( separated . warlock ) ;
88
75
setPermutations ( warlockPermutations ) ;
89
76
setFilteredPermutations ( warlockPermutations ) ;
90
-
91
- console . log ( "Warlock Armor Permutations:" , warlockPermutations ) ;
92
77
} ;
93
78
94
79
updateProfile ( ) . catch ( console . error ) ;
@@ -98,13 +83,11 @@ export const Dashboard = () => {
98
83
if ( permutations ) {
99
84
const filtered = filterPermutations ( permutations , selectedValues ) ;
100
85
setFilteredPermutations ( filtered ) ;
101
- console . log ( "Filtered permutations:" , filtered ) ;
102
86
}
103
87
} , [ selectedValues , permutations ] ) ;
104
88
105
89
const handleThresholdChange = ( thresholds : { [ key : string ] : number } ) => {
106
90
setSelectedValues ( thresholds ) ;
107
- console . log ( "Selected thresholds:" , thresholds ) ;
108
91
} ;
109
92
110
93
return (
@@ -118,7 +101,11 @@ export const Dashboard = () => {
118
101
</ LeftPane >
119
102
< RightPane >
120
103
< h1 style = { { fontSize : "16px" } } > Armour Combinations</ h1 >
121
- { filteredPermutations ? < StatsTable /> : < p > Loading...</ p > }
104
+ { filteredPermutations ? (
105
+ < StatsTable permutations = { filteredPermutations } />
106
+ ) : (
107
+ < p > Loading...</ p >
108
+ ) }
122
109
</ RightPane >
123
110
</ ContentContainer >
124
111
</ Container >
0 commit comments