standardizes custom component naming to proper nouns
This commit is contained in:
@@ -131,8 +131,8 @@ const Nav = () => {
|
||||
const {
|
||||
admin: {
|
||||
components: {
|
||||
nav: CustomNav,
|
||||
} = {}
|
||||
Nav: CustomNav,
|
||||
} = {},
|
||||
} = {},
|
||||
} = useConfig();
|
||||
|
||||
@@ -142,6 +142,6 @@ const Nav = () => {
|
||||
DefaultComponent={DefaultNav}
|
||||
/>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default Nav;
|
||||
|
||||
@@ -80,7 +80,7 @@ const Condition = (props) => {
|
||||
</div>
|
||||
<div className={`${baseClass}__value`}>
|
||||
<RenderCustomComponent
|
||||
CustomComponent={activeField?.props?.admin?.components?.filter}
|
||||
CustomComponent={activeField?.props?.admin?.components?.Filter}
|
||||
DefaultComponent={ValueComponent}
|
||||
componentProps={{
|
||||
...activeField.props,
|
||||
|
||||
@@ -87,7 +87,7 @@ const RenderFields = (props) => {
|
||||
return (
|
||||
<RenderCustomComponent
|
||||
key={i}
|
||||
CustomComponent={field?.admin?.components?.field}
|
||||
CustomComponent={field?.admin?.components?.Field}
|
||||
DefaultComponent={FieldComponent}
|
||||
componentProps={{
|
||||
...field,
|
||||
|
||||
@@ -25,7 +25,7 @@ const Icon = () => {
|
||||
admin: {
|
||||
components: {
|
||||
graphics: {
|
||||
icon: CustomIcon,
|
||||
Icon: CustomIcon,
|
||||
} = {},
|
||||
} = {},
|
||||
} = {},
|
||||
|
||||
@@ -55,7 +55,7 @@ const Logo = () => {
|
||||
admin: {
|
||||
components: {
|
||||
graphics: {
|
||||
logo: CustomLogo,
|
||||
Logo: CustomLogo,
|
||||
} = {},
|
||||
} = {},
|
||||
} = {},
|
||||
|
||||
@@ -20,7 +20,7 @@ const AccountView = () => {
|
||||
collections,
|
||||
admin: {
|
||||
components: {
|
||||
account: CustomAccount,
|
||||
Account: CustomAccount,
|
||||
} = {},
|
||||
} = {},
|
||||
} = useConfig();
|
||||
|
||||
@@ -15,7 +15,7 @@ const Dashboard = () => {
|
||||
globals,
|
||||
admin: {
|
||||
components: {
|
||||
dashboard: CustomDashboard,
|
||||
Dashboard: CustomDashboard,
|
||||
} = {},
|
||||
} = {},
|
||||
} = useConfig();
|
||||
|
||||
@@ -36,7 +36,7 @@ const GlobalView = (props) => {
|
||||
admin: {
|
||||
components: {
|
||||
views: {
|
||||
edit: CustomEdit,
|
||||
Edit: CustomEdit,
|
||||
} = {},
|
||||
} = {},
|
||||
} = {},
|
||||
@@ -100,6 +100,11 @@ GlobalView.propTypes = {
|
||||
label: PropTypes.string.isRequired,
|
||||
slug: PropTypes.string.isRequired,
|
||||
fields: PropTypes.arrayOf(PropTypes.shape({})),
|
||||
admin: PropTypes.shape({
|
||||
components: PropTypes.shape({
|
||||
Edit: PropTypes.node,
|
||||
}),
|
||||
}),
|
||||
}).isRequired,
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ const EditView = (props) => {
|
||||
useAsTitle,
|
||||
components: {
|
||||
views: {
|
||||
edit: CustomEdit,
|
||||
Edit: CustomEdit,
|
||||
} = {},
|
||||
} = {},
|
||||
},
|
||||
@@ -71,7 +71,7 @@ const EditView = (props) => {
|
||||
}
|
||||
|
||||
setStepNav(nav);
|
||||
}, [setStepNav, isEditing, pluralLabel, dataToRender, slug, useAsTitle]);
|
||||
}, [setStepNav, isEditing, pluralLabel, dataToRender, slug, useAsTitle, admin]);
|
||||
|
||||
useEffect(() => {
|
||||
const awaitInitialState = async () => {
|
||||
@@ -129,6 +129,9 @@ EditView.propTypes = {
|
||||
slug: PropTypes.string,
|
||||
admin: PropTypes.shape({
|
||||
useAsTitle: PropTypes.string,
|
||||
components: PropTypes.shape({
|
||||
Edit: PropTypes.node,
|
||||
}),
|
||||
}),
|
||||
fields: PropTypes.arrayOf(PropTypes.shape({})),
|
||||
preview: PropTypes.func,
|
||||
|
||||
@@ -61,7 +61,7 @@ const Cell = (props) => {
|
||||
field: {
|
||||
admin: {
|
||||
components: {
|
||||
cell: CustomCell,
|
||||
Cell: CustomCell,
|
||||
} = {},
|
||||
} = {},
|
||||
},
|
||||
@@ -110,7 +110,7 @@ const propTypes = {
|
||||
type: PropTypes.string,
|
||||
admin: PropTypes.shape({
|
||||
components: PropTypes.shape({
|
||||
cell: PropTypes.func,
|
||||
Cell: PropTypes.func,
|
||||
}),
|
||||
}),
|
||||
}).isRequired,
|
||||
|
||||
@@ -19,6 +19,11 @@ const ListView = (props) => {
|
||||
labels: {
|
||||
plural,
|
||||
},
|
||||
admin: {
|
||||
components: {
|
||||
List: CustomList,
|
||||
} = {},
|
||||
},
|
||||
},
|
||||
} = props;
|
||||
|
||||
@@ -70,7 +75,7 @@ const ListView = (props) => {
|
||||
return (
|
||||
<RenderCustomComponent
|
||||
DefaultComponent={DefaultList}
|
||||
path={`${slug}.views.List`}
|
||||
CustomComponent={CustomList}
|
||||
componentProps={{
|
||||
collection: { ...collection, fields },
|
||||
newDocumentURL,
|
||||
@@ -91,6 +96,11 @@ ListView.propTypes = {
|
||||
singular: PropTypes.string,
|
||||
plural: PropTypes.string,
|
||||
}),
|
||||
admin: PropTypes.shape({
|
||||
components: PropTypes.shape({
|
||||
List: PropTypes.node,
|
||||
}),
|
||||
}),
|
||||
slug: PropTypes.string,
|
||||
fields: PropTypes.arrayOf(PropTypes.shape),
|
||||
timestamps: PropTypes.bool,
|
||||
|
||||
Reference in New Issue
Block a user