Skip to content

Commit

Permalink
chore: allow ShipFitExtended to be used for preview (#148)
Browse files Browse the repository at this point in the history
This shows everything except name + history
  • Loading branch information
TrueBrain authored Jun 8, 2024
1 parent edd8e45 commit a6fb52c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/components/ShipFitExtended/ShipFitExtended.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
position: relative;
width: 100%;
}
.fitPreview {
padding-bottom: 0;
}

.fitName {
top: 35px;
Expand Down
20 changes: 12 additions & 8 deletions src/components/ShipFitExtended/ShipFitExtended.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit a6fb52c

Please sign in to comment.