Skip to content

Commit

Permalink
use mantine styles as well
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyomo committed May 30, 2024
1 parent 5125165 commit fc8d53a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": true,
"dependencies": {
"@mantine/core": "^7.10.0",
"@mantine/hooks": "^7.10.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"react": "^18.3.1",
Expand Down Expand Up @@ -37,4 +36,4 @@
"devDependencies": {
"tailwindcss": "^3.4.3"
}
}
}
4 changes: 2 additions & 2 deletions src/LoopStart.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo, useState } from 'react';
import { getLoopStart, getMaxBars } from "./utils";
import { NumberInput } from "./NumberInput";
import { getLoopStart, getMaxBars } from "./utils";

export const LoopStart = () => {
const [bpm, setBPM] = useState(90);
Expand All @@ -20,7 +20,7 @@ export const LoopStart = () => {
<h1 className="text-3xl font-bold m-2"> SP 404 Perfect Loop Start Calculator:</h1>
BPM: <NumberInput defaultValue={bpm} onUpdate={setBPM} />
Sample Length: <NumberInput defaultValue={sampleLength} onUpdate={setSampleLength} />
Number of Bars (max. {maxBars}): <NumberInput defaultValue={numberOfBars} onUpdate={setNumberOfBars} max={maxBars}/>
Number of Bars (max. {maxBars}): <NumberInput defaultValue={numberOfBars} onUpdate={setNumberOfBars} max={maxBars} />
<label>Loop Start:</label>
<div className="text-lg">{loopStart}</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/NumberInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NumberInput as MantineNumberInput, NumberInputProps as MantineNumberInputProps} from "@mantine/core";
import { NumberInput as MantineNumberInput, NumberInputProps as MantineNumberInputProps } from "@mantine/core";

interface NumberInputProps extends MantineNumberInputProps {
onUpdate: (value: number) => void;
Expand All @@ -8,6 +8,6 @@ export const NumberInput = (props: NumberInputProps) => {

const onChange = (value: string | number) => props.onUpdate(+value)

return <MantineNumberInput className="border-2 border-gray-400 w-fit rounded" onChange={onChange} allowNegative={false} hideControls allowDecimal={false} {...props}/>
return <MantineNumberInput className="" onChange={onChange} allowNegative={false} hideControls allowDecimal={false} {...props} />

}
2 changes: 2 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@import "@mantine/core/styles.css";
11 changes: 6 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { MantineProvider } from "@mantine/core";
import React from 'react';
import ReactDOM from 'react-dom/client';
import {MantineProvider} from "@mantine/core";
import {LoopStart} from "./LoopStart";
import './index.css'
import { LoopStart } from "./LoopStart";
import './index.css';


const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<MantineProvider>
<LoopStart/>
<MantineProvider >
<LoopStart />
</MantineProvider>
</React.StrictMode>
);
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"noUnusedLocals": true,
"jsx": "react-jsx"
},
"include": [
Expand Down

0 comments on commit fc8d53a

Please sign in to comment.