1
1
import React , { useEffect , useState , useMemo } from 'react' ;
2
- import { Box , Container , styled } from '@mui/system' ;
2
+ import { Box , styled } from '@mui/system' ;
3
3
import { useDispatch , useSelector } from 'react-redux' ;
4
4
import { AppDispatch , RootState , store } from '../../store' ;
5
5
import { generatePermutations } from '../../features/armor-optimization/generate-permutations' ;
@@ -16,7 +16,6 @@ import {
16
16
Character ,
17
17
CharacterClass ,
18
18
DecodedLoadoutData ,
19
- DestinyArmor ,
20
19
FilteredPermutation ,
21
20
FragmentStatModifications ,
22
21
StatName ,
@@ -44,53 +43,28 @@ import { decodeLoadout } from '../../features/loadouts/util/loadout-encoder';
44
43
import {
45
44
resetDashboard ,
46
45
updateSelectedCharacter ,
47
- updateSelectedExoticClassCombo ,
48
46
updateSelectedExoticItemHash ,
49
47
} from '../../store/DashboardReducer' ;
50
48
import StatModifications from '../../features/subclass/StatModifications' ;
51
- import { Grid , Paper } from '@mui/material' ;
49
+ import { Grid } from '@mui/material' ;
52
50
import { ManifestArmorStatMod , ManifestExoticArmor } from '../../types/manifest-types' ;
53
51
import { SharedLoadoutDto } from '../../features/loadouts/types' ;
54
52
import { updateProfileCharacters } from '../../store/ProfileReducer' ;
55
53
import { getProfileData } from '../../util/profile-characters' ;
56
54
import RefreshCharacters from '../../components/RefreshCharacters' ;
57
55
58
- const PageContainer = styled ( Box ) ( ( { theme } ) => ( {
59
- display : 'flex' ,
60
- flexDirection : 'column' ,
61
- height : '100vh' ,
62
- overflow : 'hidden' ,
63
- } ) ) ;
64
-
65
- const ContentContainer = styled ( Box ) ( ( { theme } ) => ( {
66
- flex : 1 ,
67
- width : '100vw' ,
68
- overflowY : 'auto' ,
56
+ const DashboardContent = styled ( Grid ) ( ( { theme } ) => ( {
69
57
backgroundImage : `url(${ greyBackground } )` ,
70
58
backgroundSize : 'cover' ,
71
59
backgroundPosition : 'center' ,
72
- padding : theme . spacing ( 3 ) ,
73
- paddingTop : '200px' ,
74
60
} ) ) ;
75
61
76
- const HeaderWrapper = styled ( Box ) ( {
77
- position : 'fixed' ,
78
- top : 0 ,
79
- left : 0 ,
80
- right : 0 ,
81
- zIndex : 1100 ,
82
- } ) ;
83
-
84
62
const NumberBoxesContainer = styled ( Box ) ( ( { theme } ) => ( {
85
63
marginTop : theme . spacing ( 4 ) ,
86
64
marginLeft : theme . spacing ( 25 ) ,
87
65
backgroundColor : 'rgba(0, 0, 0, 0.1)' ,
88
66
backdropFilter : 'blur(5px)' ,
89
67
borderRadius : 0 ,
90
- padding : theme . spacing ( 2 ) ,
91
- alignSelf : 'flex-start' ,
92
- width : 'auto' ,
93
- maxWidth : '100%' ,
94
68
} ) ) ;
95
69
96
70
export const Dashboard : React . FC = ( ) => {
@@ -430,7 +404,7 @@ export const Dashboard: React.FC = () => {
430
404
} ;
431
405
432
406
return (
433
- < PageContainer >
407
+ < >
434
408
{ showAbilitiesModification && customizingSubclass ? (
435
409
< SubclassCustomizationWrapper
436
410
onBackClick = { ( ) => setShowAbilitiesModification ( false ) }
@@ -448,43 +422,56 @@ export const Dashboard: React.FC = () => {
448
422
/>
449
423
) : sharedLoadoutDto === undefined && selectedSubclass ? (
450
424
< >
425
+ < HeaderComponent
426
+ emblemUrl = { characters [ selectedCharacterIndex ] ?. emblem ?. secondarySpecial || '' }
427
+ overlayUrl = { characters [ selectedCharacterIndex ] ?. emblem ?. secondaryOverlay || '' }
428
+ displayName = { membership . bungieGlobalDisplayName }
429
+ characters = { characters }
430
+ selectedCharacter = { characters [ selectedCharacterIndex ] ! }
431
+ onCharacterClick = { handleCharacterClick }
432
+ />
451
433
< RefreshCharacters />
452
- < HeaderWrapper >
453
- < HeaderComponent
454
- emblemUrl = { characters [ selectedCharacterIndex ] ?. emblem ?. secondarySpecial || '' }
455
- overlayUrl = { characters [ selectedCharacterIndex ] ?. emblem ?. secondaryOverlay || '' }
456
- displayName = { membership . bungieGlobalDisplayName }
457
- characters = { characters }
458
- selectedCharacter = { characters [ selectedCharacterIndex ] ! }
459
- onCharacterClick = { handleCharacterClick }
460
- />
461
- </ HeaderWrapper >
462
- < ContentContainer >
463
- < Grid container spacing = { 3 } justifyContent = { 'center' } alignItems = { 'flex-start' } >
464
- < Grid item md = { 4.5 } >
465
- < SingleDiamondButton
466
- subclasses = { subclasses }
467
- selectedSubclass = { selectedSubclass }
468
- onSubclassSelect = { handleSubclassSelect }
469
- onSubclassRightClick = { handleSubclassRightClick }
470
- />
471
- < NumberBoxesContainer >
472
- < NumberBoxes />
473
- </ NumberBoxesContainer >
434
+ < Grid
435
+ container
436
+ sx = { { width : '100vw' , height : '100vh' , overflowY : 'auto' , paddingTop : '130px' } }
437
+ >
438
+ < DashboardContent item container md = { 12 } >
439
+ < Grid item container direction = "column" md = { 4.5 } spacing = { 6 } sx = { { marginTop : '3%' } } >
440
+ < Grid item >
441
+ < SingleDiamondButton
442
+ subclasses = { subclasses }
443
+ selectedSubclass = { selectedSubclass }
444
+ onSubclassSelect = { handleSubclassSelect }
445
+ onSubclassRightClick = { handleSubclassRightClick }
446
+ />
447
+ </ Grid >
448
+ < Grid item >
449
+ < NumberBoxesContainer >
450
+ < NumberBoxes />
451
+ </ NumberBoxesContainer >
452
+ </ Grid >
474
453
</ Grid >
475
-
476
- < Grid container item md = { 3 } justifyContent = { 'center' } alignItems = { 'flex-start' } >
477
- < Grid item md = { 12 } >
454
+ < Grid
455
+ container
456
+ item
457
+ md = { 3 }
458
+ spacing = { 3 }
459
+ direction = "column"
460
+ justifyContent = { 'flex-start' }
461
+ alignItems = { 'center' }
462
+ sx = { { marginTop : '3%' } }
463
+ >
464
+ < Grid item >
478
465
< ExoticSelector
479
466
selectedCharacter = { characters [ selectedCharacterIndex ] ! }
480
467
selectedExoticItemHash = { selectedExotic . itemHash }
481
468
/>
482
469
</ Grid >
483
- < Grid item md = { 8 } lg = { 6 } >
470
+ < Grid item >
484
471
< StatModifications />
485
472
</ Grid >
486
473
</ Grid >
487
- < Grid item md = { 4.5 } >
474
+ < Grid item md = { 4.5 } sx = { { marginTop : '3%' } } >
488
475
{ generatingPermutations ? (
489
476
< p > Loading...</ p >
490
477
) : filteredPermutations ? (
@@ -496,13 +483,13 @@ export const Dashboard: React.FC = () => {
496
483
< p > Loading....</ p >
497
484
) }
498
485
</ Grid >
499
- </ Grid >
500
- </ ContentContainer >
486
+ </ DashboardContent >
487
+ </ Grid >
501
488
</ >
502
489
) : (
503
490
< div > loading...</ div >
504
491
) }
505
- </ PageContainer >
492
+ </ >
506
493
) ;
507
494
} ;
508
495
0 commit comments