2022-06-14 17:45:22 +00:00
|
|
|
import React from 'react';
|
2022-08-02 00:21:51 +02:00
|
|
|
import { Text, Slider, Stack } from '@mantine/core';
|
2022-06-14 17:45:22 +00:00
|
|
|
import { useConfig } from '../../tools/state';
|
|
|
|
|
|
|
|
|
|
export function AppCardWidthSelector() {
|
|
|
|
|
const { config, setConfig } = useConfig();
|
|
|
|
|
|
|
|
|
|
const setappCardWidth = (appCardWidth: number) => {
|
|
|
|
|
setConfig({
|
|
|
|
|
...config,
|
|
|
|
|
settings: {
|
|
|
|
|
...config.settings,
|
|
|
|
|
appCardWidth,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
2022-07-26 00:51:55 +02:00
|
|
|
<Stack spacing="xs">
|
2022-06-14 17:45:22 +00:00
|
|
|
<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}
|
2022-06-14 17:45:22 +00:00
|
|
|
styles={{ markLabel: { fontSize: 'xx-small' } }}
|
|
|
|
|
onChange={(value) => setappCardWidth(value)}
|
|
|
|
|
/>
|
2022-07-26 00:51:55 +02:00
|
|
|
</Stack>
|
2022-06-14 17:45:22 +00:00
|
|
|
);
|
|
|
|
|
}
|