Files
Homarr/src/components/Settings/AppCardWidthSelector.tsx

33 lines
737 B
TypeScript
Raw Normal View History

import React from 'react';
2022-08-02 00:21:51 +02:00
import { Text, Slider, Stack } from '@mantine/core';
import { useConfig } from '../../tools/state';
export function AppCardWidthSelector() {
const { config, setConfig } = useConfig();
const setappCardWidth = (appCardWidth: number) => {
setConfig({
...config,
settings: {
...config.settings,
appCardWidth,
},
});
};
return (
<Stack spacing="xs">
<Text>App Width</Text>
<Slider
2022-06-14 22:09:30 +02:00
label={null}
defaultValue={config.settings.appCardWidth}
step={0.2}
min={0.8}
max={2}
styles={{ markLabel: { fontSize: 'xx-small' } }}
onChange={(value) => setappCardWidth(value)}
/>
</Stack>
);
}