Vibe-code дизайн light theme
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import {IShortWeapon, IWeapon} from "../types/IUnit";
|
||||
import {AccordionDetails, AccordionSummary} from "@mui/material";
|
||||
import {withTheme} from "../core/api";
|
||||
import {IconUrl} from "../core/api";
|
||||
import {ExpandMore} from "@mui/icons-material";
|
||||
import {IMod} from "../types/Imod";
|
||||
@@ -31,18 +32,21 @@ class Weapon extends React.Component<IWeaponProps, any> {
|
||||
|
||||
|
||||
render() {
|
||||
const theme = (this.props as any).theme;
|
||||
const isDark = theme.palette.mode === 'dark';
|
||||
const textColor = isDark ? '#dee2e6' : 'rgba(0, 0, 0, 0.85)';
|
||||
|
||||
const weapon = this.props.weapon
|
||||
|
||||
return (
|
||||
<div style={{marginBottom: 10}}><StyledAccordion TransitionProps={{ unmountOnExit: true, timeout: 100 }}>
|
||||
<AccordionSummary
|
||||
expandIcon={<ExpandMore sx={{color: '#dee2e6'}}/>}
|
||||
expandIcon={<ExpandMore sx={{color: textColor}}/>}
|
||||
aria-controls="panel1-content"
|
||||
id="panel1-header"
|
||||
sx={{color: '#dee2e6', '& .MuiAccordionSummary-content': { margin: '12px 0' }, '& .MuiAccordionSummary-content.Mui-expanded': { margin: '12px 0' }}}
|
||||
sx={{color: textColor, '& .MuiAccordionSummary-content': { margin: '12px 0' }, '& .MuiAccordionSummary-content.Mui-expanded': { margin: '12px 0' }}}
|
||||
>
|
||||
<span style={{fontSize: 18, color: '#dee2e6', display: 'flex', alignItems: 'center'}}> {!this.props.isDefault && weapon.icon && !weapon.icon.endsWith("upgrade.png") ?
|
||||
<span style={{fontSize: 18, color: textColor, display: 'flex', alignItems: 'center'}}> {!this.props.isDefault && weapon.icon && !weapon.icon.endsWith("upgrade.png") ?
|
||||
<img className="weaponIcon" src={IconUrl + weapon.icon.replaceAll('\\', '/')}/> : (
|
||||
weapon.isMeleeWeapon ?
|
||||
<img className="weaponIcon" src="/images/MeleeStance_icon_bw.jpg"/> :
|
||||
@@ -51,7 +55,7 @@ class Weapon extends React.Component<IWeaponProps, any> {
|
||||
{this.props.isDefault && <i style={{fontSize: 12, color: 'rgba(255,255,255,0.5)'}}> (default)</i>}
|
||||
</span>
|
||||
</AccordionSummary>
|
||||
<AccordionDetails sx={{color: '#dee2e6'}}>
|
||||
<AccordionDetails sx={{color: textColor}}>
|
||||
<WeaponFull weaponId={weapon.id} isDefault={this.props.isDefault} mod={this.props.mod} race={this.props.race} haveReinforceMenu={this.props.haveReinforceMenu}/>
|
||||
</AccordionDetails>
|
||||
</StyledAccordion></div>
|
||||
@@ -59,4 +63,4 @@ class Weapon extends React.Component<IWeaponProps, any> {
|
||||
}
|
||||
}
|
||||
|
||||
export default Weapon;
|
||||
export default withTheme(Weapon);
|
||||
|
||||
Reference in New Issue
Block a user