Enhancement: Better content type creation for Astro #704

This commit is contained in:
Elio Struyf
2023-11-11 13:10:41 -08:00
parent e285e8d775
commit 41d2f3f22b
5 changed files with 33 additions and 6 deletions
@@ -31,6 +31,7 @@ export const StepsToGetStarted: React.FunctionComponent<IStepsToGetStartedProps>
const [framework, setFramework] = useState<string | null>(null);
const [taxImported, setTaxImported] = useState<boolean>(false);
const [templates, setTemplates] = useState<Template[]>([]);
const [astroCollectionsStatus, setAstroCollectionsStatus] = useState<Status>(Status.Optional)
const { getColors } = useThemeColors();
const frameworks: Framework[] = FrameworkDetectors.map((detector: any) => detector.framework);
@@ -175,6 +176,9 @@ export const StepsToGetStarted: React.FunctionComponent<IStepsToGetStartedProps>
))
}
</div>
<p className='mt-4 text-[var(--vscode-editorWarning-foreground)]'>
<b>{l10n.t(LocalizationKey.commonImportant)}</b>: {l10n.t(LocalizationKey.dashboardStepsStepsToGetStartedTemplateWarning)}</p>
</div>
),
show: (crntTemplates || []).length > 0,
@@ -186,10 +190,11 @@ export const StepsToGetStarted: React.FunctionComponent<IStepsToGetStartedProps>
description: (
<AstroContentTypes
settings={settings}
triggerLoading={(isLoading) => setLoading(isLoading)} />
triggerLoading={(isLoading) => setLoading(isLoading)}
setStatus={(status) => setAstroCollectionsStatus(status)} />
),
show: settings.crntFramework === 'astro',
status: Status.Optional
status: astroCollectionsStatus
},
{
id: `welcome-content-folders`,
@@ -259,7 +264,7 @@ export const StepsToGetStarted: React.FunctionComponent<IStepsToGetStartedProps>
: undefined
}
]
), [settings, framework, taxImported, templates]);
), [settings, framework, taxImported, templates, astroCollectionsStatus]);
React.useEffect(() => {
if (settings.crntFramework || settings.framework?.name) {