Skip to content

Commit

Permalink
Minor styles
Browse files Browse the repository at this point in the history
  • Loading branch information
fgatti675 committed Nov 26, 2024
1 parent 84d2df9 commit a1229bc
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function ProductDetailPreview({
<div className="grid gap-4 md:gap-10 items-start h-full content-center">
<div className="flex items-start">
<div className="grid gap-4">
<h1 className="font-semibold text-3xl lg:text-4xl">{product.name ?? "Product name"} </h1>
<h1 className="font-medium text-3xl lg:text-4xl">{product.name ?? "Product name"} </h1>
<div>
{product.description}
</div>
Expand All @@ -86,7 +86,7 @@ export function ProductDetailPreview({
</div>
</div>
<div
className="text-4xl font-semibold ml-auto">{getCurrencySymbol(product.currency)}{product.price}</div>
className="text-4xl font-medium ml-auto">{getCurrencySymbol(product.currency)}{product.price}</div>
</div>
<form className="grid gap-4 md:gap-10">
<div className="grid gap-2">
Expand Down
6 changes: 3 additions & 3 deletions examples/example_next/src/app/cms/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export function App() {
canAccessMainView,
notAllowedError
} = useValidateAuthenticator({
authController: userManagement,
authController,
disabled: userManagement.loading,
authenticator: () => true,// TODO
// authenticator: userManagement.authenticator, // you can define your own authenticator here
Expand Down Expand Up @@ -186,7 +186,7 @@ export function App() {

<FireCMS
navigationController={navigationController}
authController={userManagement}
authController={authController}
userConfigPersistence={userConfigPersistence}
dataSourceDelegate={firestoreDelegate}
storageSource={storageSource}
Expand Down Expand Up @@ -214,7 +214,7 @@ export function App() {
allowSkipLogin={false}
signInOptions={signInOptions}
firebaseApp={firebaseApp}
authController={userManagement}
authController={authController}
notAllowedError={notAllowedError}/>
</div>

Expand Down
28 changes: 14 additions & 14 deletions examples/example_pro/src/FirestoreApp/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,17 +274,17 @@ export function App() {
});

// Controller for managing authentication
const firebaseAuthController: FirebaseAuthController = useFirebaseAuthController({
const authController: FirebaseAuthController = useFirebaseAuthController({
firebaseApp,
signInOptions
});

const userManagementController = useBuildUserManagement({
const userManagement = useBuildUserManagement({
dataSourceDelegate: firestoreDelegate,
authController: firebaseAuthController
authController: authController
});

const userManagementPlugin = useUserManagementPlugin({ userManagement: userManagementController });
const userManagementPlugin = useUserManagementPlugin({ userManagement: userManagement });

const collectionEditorPlugin = useCollectionEditorPlugin({
collectionConfigController
Expand All @@ -307,20 +307,20 @@ export function App() {
canAccessMainView,
notAllowedError
} = useValidateAuthenticator({
disabled: userManagementController.loading,
authController: userManagementController,
disabled: userManagement.loading,
authController: authController,
// authenticator: myAuthenticator,
authenticator: userManagementController.authenticator,
authenticator: userManagement.authenticator,
dataSourceDelegate: firestoreDelegate,
storageSource
});

const navigationController = useBuildNavigationController({
collections,
collectionPermissions: userManagementController.collectionPermissions,
collectionPermissions: userManagement.collectionPermissions,
views,
adminViews: userManagementAdminViews,
authController: userManagementController,
authController,
dataSourceDelegate: firestoreDelegate
});

Expand All @@ -342,7 +342,7 @@ export function App() {
<FireCMS
apiKey={import.meta.env.VITE_FIRECMS_API_KEY as string}
navigationController={navigationController}
authController={userManagementController}
authController={authController}
entityLinkBuilder={({ entity }) => `https://console.firebase.google.com/project/${firebaseApp.options.projectId}/firestore/data/${entity.path}/${entity.id}`}
userConfigPersistence={userConfigPersistence}
dataSourceDelegate={firestoreDelegate}
Expand All @@ -362,16 +362,16 @@ export function App() {
if (loading || authLoading) {
return <CircularProgressCenter size={"large"}/>;
}
if (userManagementController.user === null || !canAccessMainView) {
return <CustomLoginView authController={userManagementController}
if (userManagement.user === null || !canAccessMainView) {
return <CustomLoginView authController={authController}
firebaseApp={firebaseApp}
signInOptions={signInOptions}
notAllowedError={notAllowedError}/>
}

if (userManagementController.usersError) {
if (userManagement.usersError) {
return <CenteredView><ErrorView
error={userManagementController.usersError}/></CenteredView>;
error={userManagement.usersError}/></CenteredView>;
}

return <Scaffold logo={logo}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function ProductDetailPreview({
</div>
</div>
<div
className="text-4xl font-semibold ml-auto">{getCurrencySymbol(product.currency)}{product.price}</div>
className="text-4xl font-medium ml-auto">{getCurrencySymbol(product.currency)}{product.price}</div>
</div>
<form className="grid gap-4 md:gap-10">
<div className="grid gap-2">
Expand Down
28 changes: 2 additions & 26 deletions website/docs/pro/migrating_from_v3_beta.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,32 +58,8 @@ Code after:
});
```

Then you want to replace all previous references to `authController` with `userManagement`.
For example, if you were using `authController.signInWithEmailAndPassword`, you should now use `userManagement.signInWithEmailAndPassword`.

```typescript
const navigationController = useBuildNavigationController({
collections: collectionsBuilder,
collectionPermissions: userManagement.collectionPermissions,
views,
adminViews: userManagementAdminViews,
authController: firebaseAuthController,
dataSourceDelegate: firestoreDelegate
});
```

becomes:

```typescript
const navigationController = useBuildNavigationController({
collections: collectionsBuilder,
collectionPermissions: userManagement.collectionPermissions,
views,
adminViews: userManagementAdminViews,
authController: userManagement,
dataSourceDelegate: firestoreDelegate
});
```
The `userManagement` controller now also qualifies as an `authController`, so you can use it as such, but it is not
necessary to do so.


### Styling
Expand Down

0 comments on commit a1229bc

Please sign in to comment.