Skip to content

Commit

Permalink
linux padding fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CrawlingTug committed Sep 5, 2024
1 parent 7103040 commit febf4e9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/MinecraftInventory/MinecraftInventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import React from "react";
import MinecraftSlot from "../MinecraftSlot/MinecraftSlot";
import styles from "./styles.module.css";
import BrowserOnly from "@docusaurus/BrowserOnly";

type MinecraftInventoryProps = {
slots: { itemName: string; tooltip: string; link?: string }[];
Expand All @@ -13,12 +14,9 @@ const MinecraftInventory: React.FC<MinecraftInventoryProps> = ({
slots,
headerText,
}) => {
/*if (/\blinux\b/i.test(navigator.userAgent)) {
document.body.className += " linux";
}*/

return (
<div className={styles.inventoryContainer}>
<BrowserOnly>{() => <LinuxClassAppender />}</BrowserOnly>
<div className={styles.inventory}>
{headerText && <div className={styles.header}>{headerText}</div>}
{(slots.length % 9 > 0
Expand All @@ -43,3 +41,10 @@ const MinecraftInventory: React.FC<MinecraftInventoryProps> = ({
};

export default MinecraftInventory;

function LinuxClassAppender() {
if (/\blinux\b/i.test(navigator.userAgent)) {
document.body.className += " linux";
}
return null;
}

0 comments on commit febf4e9

Please sign in to comment.