Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie committed May 11, 2020
1 parent 2ba3cf2 commit 988a8c8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions demo-projects/todo/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Keystone } = require('@keystonejs/keystone');
const { MongooseAdapter } = require('@keystonejs/adapter-mongoose');
const { Text, CalendarDay, Checkbox } = require('@keystonejs/fields');
const { Text, CalendarDay } = require('@keystonejs/fields');
const { GraphQLApp } = require('@keystonejs/app-graphql');
const { AdminUIApp } = require('@keystonejs/app-admin-ui');
const { StaticApp } = require('@keystonejs/app-static');
Expand All @@ -15,7 +15,6 @@ keystone.createList('Todo', {
fields: {
name: { type: Text, schemaDoc: 'This is the thing you need to do', isRequired: true },
date: { type: CalendarDay, adminDoc: 'For testing only' },
something: { type: Checkbox, adminDoc: 'Whats up?' },
},
});

Expand Down
6 changes: 2 additions & 4 deletions packages/arch/packages/fields/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export const FieldLabel = props => {
const accessError = (props.errors || []).find(
error => error instanceof Error && error.name === 'AccessDeniedError'
);
const { field } = props;
const { label, isRequired } = field;
return (
<label
css={{
Expand All @@ -29,11 +27,11 @@ export const FieldLabel = props => {
className={props.className}
htmlFor={props.htmlFor}
>
{label}{' '}
{props.field.label}{' '}
{accessError ? (
<ShieldIcon title={accessError.message} css={{ color: colors.N20, marginRight: '1em' }} />
) : null}{' '}
{isRequired ? <Lozenge appearance="primary"> Required </Lozenge> : null}
{props.field.isRequired ? <Lozenge appearance="primary"> Required </Lozenge> : null}
</label>
);
};
Expand Down
1 change: 1 addition & 0 deletions packages/fields/src/types/CalendarDay/views/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const CalendarDayField = ({
onChange,
}) => {
const htmlID = `ks-daypicker-${path}`;

return (
<FieldContainer>
<FieldLabel htmlFor={htmlID} field={{ label, isRequired }} errors={errors} />
Expand Down
2 changes: 1 addition & 1 deletion packages/fields/src/types/Checkbox/views/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const CheckboxField = ({ onChange, autoFocus, field, value, errors }) => {

return (
<FieldContainer>
<FieldDescription text={field.adminDoc} />
<FieldInput css={{ height: 35, alignItems: 'center' }}>
<FieldDescription text={field.adminDoc} />
<CheckboxPrimitive
autoFocus={autoFocus}
checked={checked}
Expand Down

0 comments on commit 988a8c8

Please sign in to comment.