web.lib.components.modals.next-steps-modal.tsx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of code-quarkus Show documentation
Show all versions of code-quarkus Show documentation
Customize a Web Interface to generate Quarkus starter projects.
import * as React from 'react';
import { useAnalytics, createLinkTracker } from '../../core/analytics';
import { CopyToClipboard, ExternalLink } from '../../core/components';
import {GenerateResult, Target, createOnGitHub} from '../api/quarkus-project-utils';
import {Extension, QuarkusProject} from '../api/model';
import { Button, Modal } from 'react-bootstrap';
import { FaGithub, FaFileArchive } from 'react-icons/fa';
import {Api} from "../api/code-quarkus-api";
interface NextStepsProps {
result: GenerateResult;
buildTool: string;
extensions: Extension[];
api: Api;
project: QuarkusProject;
githubClientId?: string;
onClose?(reset?: boolean): void;
}
export function NextStepsModal(props: NextStepsProps) {
const analytics = useAnalytics();
const context = { element: 'next-step-modal' };
const close = (reset?: boolean) => {
analytics.event('Click', { label: reset ? 'Start new' : 'Close', ...context } );
if (props.onClose) props.onClose(reset);
};
const linkTracker = createLinkTracker(analytics, 'aria-label', context);
const onClickGuide = (id: string) => (e: any) => {
linkTracker(e);
analytics.event('Click', { label: 'Extension guide', extension: id, ...context });
};
const extensionsWithGuides = props.extensions.filter(e => !!e.guide);
const devModeEventContext = { ...context, label: 'Dev mode command' }
const zip = props.result.target === Target.DOWNLOAD || props.result.target === Target.GENERATE;
const githubClick = (e: any) => {
linkTracker(e);
createOnGitHub(props.api, props.project, props.githubClientId!);
};
return (
close(false)}
show={true}
aria-label="Your new Quarkus app has been generated"
>
Your Supersonic Subatomic App is ready!
{zip && (
<>
{props.result.target === Target.DOWNLOAD ? (
Your download should start shortly. If it doesn't, please use the direct link:
) : (
Your download link is ready:
)}
{props.githubClientId && (
<>
If you want to start collaborating:
>
)}
>
)}
{props.result.target === Target.GITHUB && (
<>
Your application is now on GitHub ready to be cloned:
git clone {props.result.url}
>
)}
What's next?
{zip && (
Unzip the project and start playing with Quarkus :)
)}
{props.result.target === Target.GITHUB && (
Once your project is cloned locally, start playing with Quarkus :)
)}
Use the Quarkus CLI :
quarkus dev
Use your favorite build tool:
{props.buildTool === 'MAVEN' && (
./mvnw compile quarkus:dev
)}
{props.buildTool.startsWith('GRADLE') && (
./gradlew quarkusDev
)}
{extensionsWithGuides.length === 1 && (
Follow the {extensionsWithGuides[0].name} guide for your next steps!
)}
{extensionsWithGuides.length > 1 && (
Follow the guides we prepared for your application:
{extensionsWithGuides.map((e, i) => (
-
{e.name}
))}
)}
For more fun, have a look to our various Quarkus guides ...
);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy