Skip to content

Commit 1c42527

Browse files
committed
Merge branch 'develop'
2 parents 80f678b + 7d6ebce commit 1c42527

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/fluffy-pandas-camp.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"protobuf-auto-form": patch
3+
---
4+
5+
feat: enable dark mode / hide one and only oneof field

packages/core/src/protobuf/input/primitive/Message.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ const Message: React.FC<Props> = ({ type, name = '', options }) => {
2323
);
2424
const isRoot = name === '';
2525
const isEmptyMessage = fields.length === 0 && oneofs.length === 0;
26-
const shouldHideLabel = isRoot && hasOneAndOnlyField;
26+
const hasOneAndOnlyOneof = oneofs.length === 1 && fields.length === 0;
27+
const shouldHideLabel = (isRoot && hasOneAndOnlyField) || hasOneAndOnlyOneof;
2728
const restFields = getRestFields(type.fieldsArray, fieldNodes);
2829
const { mode, hideEmptyMessage } = useAutoFormCtx();
2930

packages/core/tailwind.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ module.exports = {
1818
}),
1919
],
2020
daisyui: {
21-
themes: false,
2221
},
2322
};

0 commit comments

Comments
 (0)