Skip to content

Commit

Permalink
fix CardItem type
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed Mar 12, 2022
1 parent 6d002a3 commit e928904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/i18n/package.json
Expand Up @@ -2,14 +2,14 @@
"name": "@vulcanjs/i18n",
"version": "0.5.4-alpha.9",
"description": "Vulcan i18n helpers",
"main": "./dist/index.mjs",
"main": "./dist/index.js",
"files": [
"dist/"
],
"type": "module",
"exports": {
".": "./dist/index.mjs",
"./server": "./dist/server/index.mjs"
".": "./dist/index.js",
"./server": "./dist/server/index.js"
},
"types": "./dist/index.d.ts",
"typesVersions": {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-ui/components/cell/CardItem.tsx
Expand Up @@ -15,7 +15,7 @@ const getTypeName = (
// TODO: not 100% sure it works
const type = fieldSchema.type; //.singleType;
const typeName = typeof type === "function" ? type.name : type;
return typeName;
return typeName + "";
} else {
return typeof value;
}
Expand Down Expand Up @@ -64,7 +64,7 @@ export const CardItemSwitcher = (props: CellProps) => {
model && fieldName ? getFieldSchema(fieldName, model) : undefined;

if (!typeName) {
if (model) {
if (model && fieldName) {
typeName = getTypeName(value, fieldName, model);
} else {
typeName = typeof value;
Expand Down

0 comments on commit e928904

Please sign in to comment.