Disable "Login with Netlify Identity" button until Netlify identity is initialized
This commit is contained in:
@ -136,16 +136,13 @@ const EditorInterface = ({
|
||||
}, []);
|
||||
|
||||
const [showPreviewToggle, previewInFrame] = useMemo(() => {
|
||||
console.log('[PREVIEW] collection', collection);
|
||||
let preview = collection.editor?.preview ?? true;
|
||||
console.log('[PREVIEW] preview', preview);
|
||||
let frame = collection.editor?.frame ?? true;
|
||||
|
||||
if ('files' in collection) {
|
||||
const file = getFileFromSlug(collection, entry.slug);
|
||||
if (file?.editor?.preview !== undefined) {
|
||||
preview = file.editor.preview;
|
||||
console.log('[PREVIEW] preview file', preview);
|
||||
}
|
||||
|
||||
if (file?.editor?.frame !== undefined) {
|
||||
@ -247,8 +244,6 @@ const EditorInterface = ({
|
||||
);
|
||||
const breadcrumbs = useBreadcrumbs(collection, nestedFieldPath, { isNewEntry, summary, t });
|
||||
|
||||
console.log('[PREVIEW] showPreviewToggle', showPreviewToggle);
|
||||
|
||||
return (
|
||||
<MainView
|
||||
breadcrumbs={breadcrumbs}
|
||||
|
@ -108,13 +108,6 @@ const EditorToolbar = ({
|
||||
return items;
|
||||
}, [canCreate, isPublished, onDuplicate, onPersist, onPersistAndDuplicate, onPersistAndNew, t]);
|
||||
|
||||
console.log(
|
||||
'[PREVIEW] showI18nToggle || showPreviewToggle || showDelete',
|
||||
showI18nToggle,
|
||||
showPreviewToggle,
|
||||
canDelete,
|
||||
);
|
||||
|
||||
return useMemo(
|
||||
() => (
|
||||
<div className="flex gap-2">
|
||||
|
@ -16,6 +16,7 @@ export interface LoginProps {
|
||||
icon?: FC<{ className?: string | undefined }>;
|
||||
label?: string;
|
||||
error?: ReactNode;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
const Login = ({
|
||||
@ -24,6 +25,7 @@ const Login = ({
|
||||
icon,
|
||||
label,
|
||||
error,
|
||||
disabled = false,
|
||||
t,
|
||||
}: TranslatedProps<LoginProps>) => {
|
||||
const config = useAppSelector(selectConfig);
|
||||
@ -53,7 +55,7 @@ const Login = ({
|
||||
<div>{error}</div>
|
||||
</div>
|
||||
) : null}
|
||||
<Button disabled={inProgress} onClick={login} className="mb-6" startIcon={icon}>
|
||||
<Button disabled={inProgress || disabled} onClick={login} className="mb-6" startIcon={icon}>
|
||||
{inProgress ? t('auth.loggingIn') : label ?? t('auth.login')}
|
||||
</Button>
|
||||
{config?.site_url && <GoBackButton href={config.site_url} t={t}></GoBackButton>}
|
||||
|
Reference in New Issue
Block a user