2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-09 21:30:54 +00:00

switch sx to style

This commit is contained in:
Matthias Mair
2024-04-15 12:25:03 +02:00
parent 5245b1ee56
commit a3da256724
10 changed files with 18 additions and 18 deletions

View File

@@ -165,7 +165,7 @@ function UploadModal({
const redColor = vars.colors.red[preferredColorScheme === 'dark' ? 4 : 6]; const redColor = vars.colors.red[preferredColorScheme === 'dark' ? 4 : 6];
return ( return (
<Paper sx={{ height: '220px' }}> <Paper style={{ height: '220px' }}>
<Dropzone <Dropzone
onDrop={(files) => setFile(files[0])} onDrop={(files) => setFile(files[0])}
maxFiles={1} maxFiles={1}

View File

@@ -35,13 +35,13 @@ export function HostOptionsForm({
<TextInput <TextInput
placeholder={t`Host`} placeholder={t`Host`}
withAsterisk withAsterisk
sx={{ flex: 1 }} style={{ flex: 1 }}
{...form.getInputProps(`${key}.host`)} {...form.getInputProps(`${key}.host`)}
/> />
<TextInput <TextInput
placeholder={t`Name`} placeholder={t`Name`}
withAsterisk withAsterisk
sx={{ flex: 1 }} style={{ flex: 1 }}
{...form.getInputProps(`${key}.name`)} {...form.getInputProps(`${key}.name`)}
/> />
<ActionIcon <ActionIcon
@@ -59,13 +59,13 @@ export function HostOptionsForm({
return ( return (
<form onSubmit={form.onSubmit(saveOptions)}> <form onSubmit={form.onSubmit(saveOptions)}>
<Box sx={{ maxWidth: 500 }} mx="auto"> <Box style={{ maxWidth: 500 }} mx="auto">
{fields.length > 0 ? ( {fields.length > 0 ? (
<Group mb="xs"> <Group mb="xs">
<Text fw={500} size="sm" sx={{ flex: 1 }}> <Text fw={500} size="sm" style={{ flex: 1 }}>
<Trans>Host</Trans> <Trans>Host</Trans>
</Text> </Text>
<Text fw={500} size="sm" sx={{ flex: 1 }}> <Text fw={500} size="sm" style={{ flex: 1 }}>
<Trans>Name</Trans> <Trans>Name</Trans>
</Text> </Text>
</Group> </Group>
@@ -84,7 +84,7 @@ export function HostOptionsForm({
<IconSquarePlus /> <IconSquarePlus />
<Trans>Add Host</Trans> <Trans>Add Host</Trans>
</Button> </Button>
<Space sx={{ flex: 1 }} /> <Space style={{ flex: 1 }} />
<Button type="submit"> <Button type="submit">
<Trans>Save</Trans> <Trans>Save</Trans>
</Button> </Button>

View File

@@ -19,7 +19,7 @@ export function NestedObjectField({
<Text>{definition.label}</Text> <Text>{definition.label}</Text>
</Accordion.Control> </Accordion.Control>
<Accordion.Panel> <Accordion.Panel>
<Divider sx={{ marginTop: '-10px', marginBottom: '10px' }} /> <Divider style={{ marginTop: '-10px', marginBottom: '10px' }} />
<Stack gap="xs"> <Stack gap="xs">
{Object.entries(definition.children ?? {}).map( {Object.entries(definition.children ?? {}).map(
([childFieldName, field]) => ( ([childFieldName, field]) => (

View File

@@ -150,7 +150,7 @@ export function QrCodeModal({
<Stack> <Stack>
<Group> <Group>
<Text size="sm">{camId?.label}</Text> <Text size="sm">{camId?.label}</Text>
<Space sx={{ flex: 1 }} /> <Space style={{ flex: 1 }} />
<Badge>{ScanningEnabled ? t`Scanning` : t`Not scanning`}</Badge> <Badge>{ScanningEnabled ? t`Scanning` : t`Not scanning`}</Badge>
</Group> </Group>
<Container px={0} id="reader" w={'100%'} mih="300px" /> <Container px={0} id="reader" w={'100%'} mih="300px" />
@@ -162,14 +162,14 @@ export function QrCodeModal({
<> <>
<Group> <Group>
<Button <Button
sx={{ flex: 1 }} style={{ flex: 1 }}
onClick={() => startScanning()} onClick={() => startScanning()}
disabled={camId != undefined && ScanningEnabled} disabled={camId != undefined && ScanningEnabled}
> >
<Trans>Start scanning</Trans> <Trans>Start scanning</Trans>
</Button> </Button>
<Button <Button
sx={{ flex: 1 }} style={{ flex: 1 }}
onClick={() => stopScanning()} onClick={() => stopScanning()}
disabled={!ScanningEnabled} disabled={!ScanningEnabled}
> >
@@ -181,7 +181,7 @@ export function QrCodeModal({
<Trans>No scans yet!</Trans> <Trans>No scans yet!</Trans>
</Text> </Text>
) : ( ) : (
<ScrollArea sx={{ height: 200 }} type="auto" offsetScrollbars> <ScrollArea style={{ height: 200 }} type="auto" offsetScrollbars>
{values.map((value, index) => ( {values.map((value, index) => (
<div key={index}>{value}</div> <div key={index}>{value}</div>
))} ))}

View File

@@ -23,7 +23,7 @@ export function MainMenu() {
<Menu.Target> <Menu.Target>
<UnstyledButton className={classes.layoutHeaderUser}> <UnstyledButton className={classes.layoutHeaderUser}>
<Group gap={7}> <Group gap={7}>
<Text fw={500} size="sm" sx={{ lineHeight: 1 }} mr={3}> <Text fw={500} size="sm" style={{ lineHeight: 1 }} mr={3}>
{userState.username() ? ( {userState.username() ? (
userState.username() userState.username()
) : ( ) : (

View File

@@ -55,7 +55,7 @@ export function NavHoverMenu({
</UnstyledButton> </UnstyledButton>
</HoverCard.Target> </HoverCard.Target>
<HoverCard.Dropdown sx={{ overflow: 'hidden' }}> <HoverCard.Dropdown style={{ overflow: 'hidden' }}>
<Group justify="apart" px="md"> <Group justify="apart" px="md">
<ActionIcon <ActionIcon
onClick={openDrawer} onClick={openDrawer}

View File

@@ -129,7 +129,7 @@ function ApiFormsPlayground() {
<Button onClick={() => openCreatePart()}>Create Part new Modal</Button> <Button onClick={() => openCreatePart()}>Create Part new Modal</Button>
{createPartModal} {createPartModal}
</Group> </Group>
<Card sx={{ padding: '30px' }}> <Card style={{ padding: '30px' }}>
<OptionsApiForm <OptionsApiForm
props={{ props={{
url: ApiEndpoints.part_list, url: ApiEndpoints.part_list,

View File

@@ -719,7 +719,7 @@ function InputImageBarcode({ action }: inputProps) {
<IconPlayerPlayFilled /> <IconPlayerPlayFilled />
</ActionIcon> </ActionIcon>
)} )}
<Space sx={{ flex: 1 }} /> <Space style={{ flex: 1 }} />
<Badge color={ScanningEnabled ? 'green' : 'orange'}> <Badge color={ScanningEnabled ? 'green' : 'orange'}>
{ScanningEnabled ? t`Scanning` : t`Not scanning`} {ScanningEnabled ? t`Scanning` : t`Not scanning`}
</Badge> </Badge>

View File

@@ -341,7 +341,7 @@ function MachineDrawer({
<Trans>Errors</Trans>: <Trans>Errors</Trans>:
</Text> </Text>
{machine && machine?.machine_errors.length > 0 ? ( {machine && machine?.machine_errors.length > 0 ? (
<Badge color="red" sx={{ marginLeft: '10px' }}> <Badge color="red" style={{ marginLeft: '10px' }}>
{machine?.machine_errors.length} {machine?.machine_errors.length}
</Badge> </Badge>
) : ( ) : (

View File

@@ -261,7 +261,7 @@ function MachineDriverDrawer({
<Trans>Errors</Trans>: <Trans>Errors</Trans>:
</Text> </Text>
{machineDriver && machineDriver?.driver_errors.length > 0 ? ( {machineDriver && machineDriver?.driver_errors.length > 0 ? (
<Badge color="red" sx={{ marginLeft: '10px' }}> <Badge color="red" style={{ marginLeft: '10px' }}>
{machineDriver.driver_errors.length} {machineDriver.driver_errors.length}
</Badge> </Badge>
) : ( ) : (