forked from React-Group/interstellar_ai
Further Refactoring of the Settings
This commit is contained in:
parent
003e353073
commit
92f880c3f8
11 changed files with 557 additions and 496 deletions
31
app/components/settings/FontSize.tsx
Normal file
31
app/components/settings/FontSize.tsx
Normal file
|
@ -0,0 +1,31 @@
|
|||
// FontSizeSetting.tsx
|
||||
import React from 'react';
|
||||
|
||||
interface FontSizeSettingProps {
|
||||
fontSize: string; // The current font size
|
||||
setFontSize: (newSize: string) => void; // Function to update the font size
|
||||
}
|
||||
|
||||
const FontSizeSetting: React.FC<FontSizeSettingProps> = ({ fontSize, setFontSize }) => {
|
||||
const handleFontSizeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const newSize = `${e.target.value}px`;
|
||||
setFontSize(newSize);
|
||||
document.documentElement.style.setProperty('--font-size', newSize);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="settings-option">
|
||||
<p>Font Size</p>
|
||||
<input
|
||||
type="range"
|
||||
min="12"
|
||||
max="30"
|
||||
value={parseInt(fontSize, 10)} // Ensure value is a number
|
||||
onChange={handleFontSizeChange}
|
||||
/>
|
||||
<span>{fontSize}</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default FontSizeSetting;
|
Loading…
Add table
Add a link
Reference in a new issue