-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mantine theme #1287
base: master
Are you sure you want to change the base?
Add mantine theme #1287
Changes from 2 commits
3d15716
3324a53
9f2a597
b4dc6e1
54b86ba
2b57f0a
578f25b
3ecbdc4
e1f7429
343d39d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
import { List, Group, Box } from '@mantine/core'; | ||
import React, { ReactNode } from 'react'; | ||
import { connectField } from 'uniforms'; | ||
import { List, Group, Box } from '@mantine/core'; | ||
|
||
import AutoField from './AutoField'; | ||
import ListDelField from './ListDelField'; | ||
|
||
export type ListItemFieldProps = { children?: ReactNode; value?: unknown }; | ||
|
||
function ListItem({ | ||
children = <AutoField label={null} name="" />, | ||
children = <AutoField label={null} name="" style={{ width: '100%' }} />, | ||
}: ListItemFieldProps) { | ||
return ( | ||
<List.Item mb={12}> | ||
<Group mt="xs" align="center"> | ||
<List.Item | ||
mb={12} | ||
styles={{ itemLabel: { width: '100%' }, itemWrapper: { width: '100%' } }} | ||
pos="relative" | ||
> | ||
<Group mt="xs" align="flex-start" w="100%"> | ||
{children} | ||
<Box mt={20}> | ||
<Box pos="absolute" right={0} top={10}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can those styles be moved to the |
||
<ListDelField name="" /> | ||
</Box> | ||
</Group> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { Label } from '@mantine/core'; | ||
import React from 'react'; | ||
piotrpospiech marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import { HTMLFieldProps, connectField, filterDOMProps } from 'uniforms'; | ||
import { Text } from '@mantine/core'; | ||
|
||
import AutoField from './AutoField'; | ||
|
||
export type NestFieldProps = HTMLFieldProps< | ||
|
@@ -18,7 +19,7 @@ function Nest({ | |
}: NestFieldProps) { | ||
return ( | ||
<div {...filterDOMProps(props)}> | ||
{label && <Text>{label}</Text>} | ||
{label && <Label>{label}</Label>} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think, it should be updated also in other fields e.g. |
||
{children || | ||
fields.map(field => ( | ||
<AutoField key={field} name={field} {...itemProps} /> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test it with custom children? We don't want to pass
width
manually to every child component.