chore: allow ShipFitExtended to be used for preview (#148)

This shows everything except name + history
This commit is contained in:
Patric Stout
2024-06-08 15:20:02 +02:00
committed by GitHub
parent edd8e453a0
commit a6fb52cd86
2 changed files with 15 additions and 8 deletions

View File

@@ -7,6 +7,9 @@
position: relative;
width: 100%;
}
.fitPreview {
padding-bottom: 0;
}
.fitName {
top: 35px;

View File

@@ -143,25 +143,29 @@ const FitName = () => {
* also adds the cargo hold, drone bay, and CPU/PG usage at the
* bottom of the fit.
*/
export const ShipFitExtended = () => {
export const ShipFitExtended = (props: { isPreview?: boolean }) => {
const currentFit = useCurrentFit();
return (
<div className={styles.fit}>
<div className={clsx(styles.fit, { [styles.fitPreview]: props.isPreview })}>
<ShipFit withStats />
<div className={styles.fitName}>
<FitName />
</div>
{props.isPreview !== true && (
<div className={styles.fitName}>
<FitName />
</div>
)}
<div className={styles.cargoHold}>
<ShipCargoHold />
<ShipDroneBay />
</div>
<div className={styles.history}>
<FitHistory historySize={25} />
</div>
{props.isPreview !== true && (
<div className={styles.history}>
<FitHistory historySize={25} />
</div>
)}
<div className={styles.cpuPg}>
<CpuPg title="CPU">