From f89eae85c45c192255ea314249eb702584fccefd Mon Sep 17 00:00:00 2001 From: francesco Date: Mon, 27 Sep 2021 10:54:55 +0200 Subject: [PATCH] Design tweaks --- example/src/SampleApp/SampleApp.tsx | 2 +- example/src/SampleApp/schemas/test_schema.tsx | 33 +++++++++++++++++++ src/collection/components/styles.tsx | 7 +++- src/core/CMSDrawer.tsx | 7 ++-- src/core/components/FireCMSLogo.tsx | 4 +-- .../components/FirebaseLoginView.tsx | 12 ++++--- src/models/collections.ts | 4 +-- src/models/properties.ts | 3 +- 8 files changed, 56 insertions(+), 16 deletions(-) diff --git a/example/src/SampleApp/SampleApp.tsx b/example/src/SampleApp/SampleApp.tsx index 61784a1..555ad51 100644 --- a/example/src/SampleApp/SampleApp.tsx +++ b/example/src/SampleApp/SampleApp.tsx @@ -183,7 +183,7 @@ function SampleApp() { ]} textSearchController={textSearchController} allowSkipLogin={true} - // logo={logo} + logo={logo} navigation={navigation} schemaResolver={customSchemaResolver} firebaseConfig={firebaseConfig} diff --git a/example/src/SampleApp/schemas/test_schema.tsx b/example/src/SampleApp/schemas/test_schema.tsx index ee00acf..7292921 100644 --- a/example/src/SampleApp/schemas/test_schema.tsx +++ b/example/src/SampleApp/schemas/test_schema.tsx @@ -1,5 +1,6 @@ import { buildEnumValueConfig, + buildProperties, buildProperty, buildSchema, resolveNavigationFrom @@ -61,6 +62,38 @@ export const testEntitySchema = buildSchema({ }); }, properties: { + source: ({ values }) => { + + const properties = buildProperties({ + type: { + dataType: "string", + config: { + enumValues: { + "facebook": "FacebookId", + "apple": "Apple" + } + } + } + }); + + if (values.source) { + if ((values.source as any).type === "facebook") { + properties["facebookId"] = buildProperty({ + dataType: "string" + }); + } else if ((values.source as any).type === "apple") { + properties["appleId"] = buildProperty({ + dataType: "number" + }); + } + } + + return ({ + dataType: "map", + title: "Source", + properties: properties + }); + }, test_date: { title: "Test date", dataType: "timestamp" diff --git a/src/collection/components/styles.tsx b/src/collection/components/styles.tsx index ff37c16..699242a 100644 --- a/src/collection/components/styles.tsx +++ b/src/collection/components/styles.tsx @@ -17,6 +17,11 @@ export const useTableStyles = makeStyles(theme => createStyles({ height: "100%", flexGrow: 1 }, + headerTypography: { + fontSize: "0.750rem", + fontWeight: 600, + textTransform: "uppercase" + }, header: { width: "calc(100% + 24px)", margin: "0px -12px", @@ -27,7 +32,7 @@ export const useTableStyles = makeStyles(theme => createStyles({ height: "100%", fontSize: "0.750rem", textTransform: "uppercase", - fontWeight: 600, + fontWeight: 600 }, tableRow: { display: "flex", diff --git a/src/core/CMSDrawer.tsx b/src/core/CMSDrawer.tsx index d3af420..735b8eb 100644 --- a/src/core/CMSDrawer.tsx +++ b/src/core/CMSDrawer.tsx @@ -73,7 +73,9 @@ export function CMSDrawer({ src={logo} alt={"Logo"}/>; } else { - logoComponent = ; + logoComponent =
+ +
; } return <> @@ -83,9 +85,6 @@ export function CMSDrawer({ color="inherit" onClick={closeDrawer} component={ReactLink} - style={{ - padding: "16px" - }} to={"/"}> {logoComponent} diff --git a/src/core/components/FireCMSLogo.tsx b/src/core/components/FireCMSLogo.tsx index 39c3e97..208da64 100644 --- a/src/core/components/FireCMSLogo.tsx +++ b/src/core/components/FireCMSLogo.tsx @@ -3,7 +3,7 @@ import React from "react"; export function FireCMSLogo() { return ( @@ -41,7 +41,7 @@ export function FireCMSLogo() { offset="100%"/> -
+ +
; } return ( diff --git a/src/models/collections.ts b/src/models/collections.ts index 68d726a..359f51b 100644 --- a/src/models/collections.ts +++ b/src/models/collections.ts @@ -237,7 +237,7 @@ export interface PermissionsBuilderProps * Context of the app status */ context: CMSAppContext; -}; +} /** @@ -320,5 +320,5 @@ export interface ExportMappingFunction { * valid, otherwise it reverts to the simpler valid case * @category Models */ -export type CompositeIndex = Partial> +export type CompositeIndex = Partial>; diff --git a/src/models/properties.ts b/src/models/properties.ts index abb0821..5831369 100644 --- a/src/models/properties.ts +++ b/src/models/properties.ts @@ -688,6 +688,7 @@ export interface MapFieldConfig extends FieldConfig { /** * MIME types for storage fields + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types * @category Entity properties */ export type StorageFileTypes = @@ -697,7 +698,7 @@ export type StorageFileTypes = | "application/*" | "text/*" | "font/*" - | string; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types + | string; /** * @category Entity properties