Skip to content

Commit

Permalink
fix: landing page missing commits and small fixes (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldziher authored Jan 16, 2024
2 parents 291f241 + e92bc28 commit 0efcca2
Show file tree
Hide file tree
Showing 19 changed files with 380 additions and 382 deletions.
16 changes: 8 additions & 8 deletions frontend/public/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,23 +192,23 @@
"invalidNameErrorMessage": "Name must be unique"
},
"landingPage": {
"benefitsPrivacyDescription": "We don't save any of your users' data. We act as a pure pipeline between your users' device and the AI models.",
"benefitsPrivacyTitle": "0% of Your Users Data Saved. ",
"benefitsScalabilityDescription": "Integrate in minutes, scale to millions. BaseMind allows you to focus on your product, not your infrastructure.",
"benefitsPrivacyDescription": "We don't save any of your users' data. We act as a pure pipeline between your users' devices and the AI models.",
"benefitsPrivacyTitle": "None of Your Users Data Saved. ",
"benefitsScalabilityDescription": "BaseMind allows you to focus on your product, not your infrastructure. Ready for scale from day 1.",
"benefitsScalabilityTitle": "Scalable Infrastructure. ",
"benefitsSpeedDescription": "Built with Golang and GRPC, BaseMind delivers exceptional speed, outperforming traditional backends with swift response times and scalable performance.",
"benefitsSpeedDescription": "Built with Golang and GRPC, BaseMind outperforms traditional backends with swift response times and scalable performance.",
"benefitsSpeedTitle": "Lightning Speed. ",
"better": "better",
"ctaSectionSubtitle": "Sign-up to our free beta, No credit card required.",
"ctaSectionTitle": "Your AI journey starts here.",
"faqACostToStart": "Starting with BaseMind is free, and no credit card is required. We provide initial credits worth a dollar for AI model usage, which typically lasts for hundreds to thousands of calls. For production use, we offer customized packages that scale with your needs and fit every stage of your AI journey.",
"faqADoYouSaveMyUserData": "No, we don't store any of your user data or requests. Privacy is a priority, so rest assured, 0% of your data is saved on our servers.",
"faqACostToStart": "Starting with BaseMind is free and no credit card is required. We provide initial credits for AI model usage, which typically lasts for hundreds of calls. For production use, we offer customized packages that scale with your needs and fit every stage of your AI journey.",
"faqADoYouSaveMyUserData": "No, privacy and security is paramount for us. We therefore dont save any of your users' data on our system.",
"faqAFasterThanBackend": "Yes, our system, built with Golang and GRPC, is much faster than a typical custom backend. Plus, our systems can scale with your needs, ensuring efficiency as your app grows.",
"faqAHelpWithSDK": "Definitely! Just contact us and we'll guide you through the implementation process.",
"faqAIsItSecure": "Yes, it's secure. With our SDK, storing the key in your app is safe thanks to GRPC encryption. Plus, even if someone accesses the key, they can only use the prompts you configured.",
"faqAIsItSecure": "Yes, it's secure. With our SDK, storing the key in your app is safe. Plus, even if someone accesses the key, they can only use the prompts you configured.",
"faqANeedOpenAIKey": "No, an OpenAI key isn't necessary. Just sign up, create a key for your app, and manage all AI model billing through BaseMind without exposing your OpenAI key.",
"faqQCostToStart": "How much does it cost, and do I need a credit card to start using BaseMind?",
"faqQDoYouSaveMyUserData": "Do you save my user data or requests?",
"faqQDoYouSaveMyUserData": "Do you save my users' data?",
"faqQFasterThanBackend": "Are you faster than a custom backend?",
"faqQHelpWithSDK": "Can you help me implement the BaseMind SDK?",
"faqQIsItSecure": "Is it secure to store the BaseMind key in my mobile app?",
Expand Down
25 changes: 11 additions & 14 deletions frontend/src/app/[locale]/page.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,17 @@ describe('Landing Page', () => {
);
});
});
it('should render all sections', () => {
const sections = [
'static-site-header',
'landing-page-hero',
'landing-page-features',
'landing-page-benefits',
'landing-page-pricing',
'landing-page-faq',
'landing-page-cta',
'static-site-footer',
];
it.each([
'static-site-header',
'landing-page-hero',
'landing-page-features',
'landing-page-benefits',
'landing-page-pricing',
'landing-page-faq',
'landing-page-cta',
'static-site-footer',
])('should render section %s', (sectionId) => {
render(<LandingPage params={{ locale: 'en' }} />);
sections.forEach((section) => {
expect(screen.getByTestId(section)).toBeInTheDocument();
});
expect(screen.getByTestId(sectionId)).toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -255,113 +255,108 @@ export default function PromptConfigCreateWizard({
{isLoading ? (
<Oval height="33vh" width="33vw" className="m-auto" />
) : (
<>
<div className="page-content-container">
<Navbar
project={project}
application={application}
userPhotoURL={user?.photoURL}
<div className="page-content-container">
<Navbar
project={project}
application={application}
userPhotoURL={user?.photoURL}
/>
<div className="card-divider flex justify-between content-center items-center">
<h2 className="card-header">{t('createConfig')}</h2>
<ul className="steps z-0">
{stepper.map((stage) => (
<li
key={stage}
className={`step ${
store.wizardStage === stage && stepColor
}
}`}
/>
))}
</ul>
</div>
<div className="transform transition-transform duration-300 ease-in-out rounded-data-card shadow-xl">
<WizardStageComponent
applicationId={applicationId}
credits={project?.credits ?? '1'}
handleConfigNameChange={handleConfigNameChange}
handleError={handleError}
handleMessagesChange={handleMessagesChange}
handleModelTypeChange={handleModelTypeChange}
handleModelVendorChange={handleModelVendorChange}
handleParametersChange={handleParametersChange}
handleRefreshProject={handleRefreshProject}
handleTemplateVariablesChange={
handleTemplateVariablesChange
}
projectId={projectId}
setNameIsValid={setNameIsValid}
store={store}
validateConfigName={validateConfigName}
/>
<div className="card-divider flex justify-between content-center items-center">
<h2 className="card-header">{t('createConfig')}</h2>
<ul className="steps z-0">
{stepper.map((stage) => (
<li
key={stage}
className={`step ${
store.wizardStage === stage &&
stepColor
<div className="divider divide-accent" />
<div className="items-center justify-end px-5 modal-action">
<div className="flex justify-between gap-4">
{store.wizardStage === 0 && (
<button
data-testid="config-create-wizard-cancel-button"
onClick={() => {
setIsLoading(true);
store.resetState();
router.push(
setRouteParams(
Navigation.ApplicationDetail,
{
applicationId,
projectId,
},
),
);
}}
className="btn btn-neutral"
>
{t('cancelButtonText')}
</button>
)}
{store.wizardStage > 0 && (
<button
data-testid="config-create-wizard-back-button"
onClick={store.setPrevWizardStage}
className="btn btn-neutral"
disabled={isLoading}
>
{t('backButtonText')}
</button>
)}
{store.wizardStage === 2 && (
<button
data-testid="config-create-wizard-save-button"
onClick={() => {
void handleConfigSave();
}}
className="btn btn-primary"
disabled={!store.messages.length}
>
{t('saveButtonText')}
</button>
)}
{store.wizardStage < 2 && (
<button
data-testid="config-create-wizard-continue-button"
onClick={store.setNextWizardStage}
className="btn btn-primary"
disabled={
!nameIsValid ||
!shouldAllowContinue(store)
}
}`}
/>
))}
</ul>
</div>
<div className="transform transition-transform duration-300 ease-in-out rounded-data-card shadow-xl">
<WizardStageComponent
applicationId={applicationId}
credits={project?.credits ?? '1'}
handleConfigNameChange={handleConfigNameChange}
handleError={handleError}
handleMessagesChange={handleMessagesChange}
handleModelTypeChange={handleModelTypeChange}
handleModelVendorChange={
handleModelVendorChange
}
handleParametersChange={handleParametersChange}
handleRefreshProject={handleRefreshProject}
handleTemplateVariablesChange={
handleTemplateVariablesChange
}
projectId={projectId}
setNameIsValid={setNameIsValid}
store={store}
validateConfigName={validateConfigName}
/>
<div className="divider divide-accent" />
<div className="items-center justify-end px-5 modal-action">
<div className="flex justify-between gap-4">
{store.wizardStage === 0 && (
<button
data-testid="config-create-wizard-cancel-button"
onClick={() => {
setIsLoading(true);
store.resetState();
router.push(
setRouteParams(
Navigation.ApplicationDetail,
{
applicationId,
projectId,
},
),
);
}}
className="btn btn-neutral"
>
{t('cancelButtonText')}
</button>
)}
{store.wizardStage > 0 && (
<button
data-testid="config-create-wizard-back-button"
onClick={store.setPrevWizardStage}
className="btn btn-neutral"
disabled={isLoading}
>
{t('backButtonText')}
</button>
)}
{store.wizardStage === 2 && (
<button
data-testid="config-create-wizard-save-button"
onClick={() => {
void handleConfigSave();
}}
className="btn btn-primary"
disabled={!store.messages.length}
>
{t('saveButtonText')}
</button>
)}
{store.wizardStage < 2 && (
<button
data-testid="config-create-wizard-continue-button"
onClick={store.setNextWizardStage}
className="btn btn-primary"
disabled={
!nameIsValid ||
!shouldAllowContinue(store)
}
>
{t('continueButtonText')}
</button>
)}
</div>
>
{t('continueButtonText')}
</button>
)}
</div>
</div>
</div>
</>
</div>
)}
</main>
);
Expand Down
11 changes: 5 additions & 6 deletions frontend/src/components/legal-document-view.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Fragment } from 'react';

export interface LegalDocument {
Paragraphs: { content: string[]; title: string }[];
lastUpdated: string;
Expand Down Expand Up @@ -32,11 +34,8 @@ export function LegalDocumentView({ document }: { document: LegalDocument }) {
),
)}
{document.Paragraphs.map((section, sectionIndex) => (
<>
<h2
className="text-base-content"
key={section.title + sectionIndex}
>
<Fragment key={section.title + sectionIndex}>
<h2 className="text-base-content">
{section.title}
</h2>
{section.content.map((paragraph, indexSection) => (
Expand All @@ -50,7 +49,7 @@ export function LegalDocumentView({ document }: { document: LegalDocument }) {
{paragraph}
</p>
))}
</>
</Fragment>
))}
</div>
</div>
Expand Down
Loading

0 comments on commit 0efcca2

Please sign in to comment.