Skip to content

Commit

Permalink
chore: fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldziher committed Jan 16, 2024
1 parent 9b7ce66 commit e92bc28
Show file tree
Hide file tree
Showing 7 changed files with 307 additions and 321 deletions.
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
96 changes: 45 additions & 51 deletions frontend/src/components/static-site/benefits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,52 @@ const HaloAnimation = () => {
return (
<>
{Array.from({ length: svgCount }).map((_, index) => (
<Fragment key={index}>
<>
<svg
className="absolute z-20 blur-2xl transform -translate-x-1/2 -translate-y-1/2 top-1/2 left-1/2"
width="480"
height="480"
viewBox="0 0 480 480"
xmlns="http://www.w3.org/2000/svg"
<svg
key={index}
className="absolute z-20 blur-2xl transform -translate-x-1/2 -translate-y-1/2 top-1/2 left-1/2"
width="480"
height="480"
viewBox="0 0 480 480"
xmlns="http://www.w3.org/2000/svg"
>
<defs>
<linearGradient
id="pulse-a"
x1="50%"
x2="50%"
y1="100%"
y2="0%"
>
<defs>
<linearGradient
id="pulse-a"
x1="50%"
x2="50%"
y1="100%"
y2="0%"
>
<stop offset="0%" stopColor="#A855F7" />
<stop
offset="76.382%"
stopColor="#FAF5FF"
/>
<stop offset="100%" stopColor="#6366F1" />
</linearGradient>
</defs>
<g
fillRule="evenodd"
style={{
animation: `grow-and-fade 24s cubic-bezier(0, 0, 0.2, 0.6) ${
index * 4
}s infinite`,
}}
>
<path
fill="url(#pulse-a)"
fillRule="evenodd"
d="M240,0 C372.5484,0 480,107.4516 480,240 C480,372.5484 372.5484,480 240,480 C107.4516,480 0,372.5484 0,240 C0,107.4516 107.4516,0 240,0 Z M240,88.8 C156.4944,88.8 88.8,156.4944 88.8,240 C88.8,323.5056 156.4944,391.2 240,391.2 C323.5056,391.2 391.2,323.5056 391.2,240 C391.2,156.4944 323.5056,88.8 240,88.8 Z"
/>
<path
fill="url(#pulse-a)"
fillRule="evenodd"
d="M240,0 C372.5484,0 480,107.4516 480,240 C480,372.5484 372.5484,480 240,480 C107.4516,480 0,372.5484 0,240 C0,107.4516 107.4516,0 240,0 Z M240,88.8 C156.4944,88.8 88.8,156.4944 88.8,240 C88.8,323.5056 156.4944,391.2 240,391.2 C323.5056,391.2 391.2,323.5056 391.2,240 C391.2,156.4944 323.5056,88.8 240,88.8 Z"
/>
<path
fill="url(#pulse-a)"
fillRule="evenodd"
d="M240,0 C372.5484,0 480,107.4516 480,240 C480,372.5484 372.5484,480 240,480 C107.4516,480 0,372.5484 0,240 C0,107.4516 107.4516,0 240,0 Z M240,88.8 C156.4944,88.8 88.8,156.4944 88.8,240 C88.8,323.5056 156.4944,391.2 240,391.2 C323.5056,391.2 391.2,323.5056 391.2,240 C391.2,156.4944 323.5056,88.8 240,88.8 Z"
/>
</g>
</svg>
</>
</Fragment>
<stop offset="0%" stopColor="#A855F7" />
<stop offset="76.382%" stopColor="#FAF5FF" />
<stop offset="100%" stopColor="#6366F1" />
</linearGradient>
</defs>
<g
fillRule="evenodd"
style={{
animation: `grow-and-fade 24s cubic-bezier(0, 0, 0.2, 0.6) ${
index * 4
}s infinite`,
}}
>
<path
fill="url(#pulse-a)"
fillRule="evenodd"
d="M240,0 C372.5484,0 480,107.4516 480,240 C480,372.5484 372.5484,480 240,480 C107.4516,480 0,372.5484 0,240 C0,107.4516 107.4516,0 240,0 Z M240,88.8 C156.4944,88.8 88.8,156.4944 88.8,240 C88.8,323.5056 156.4944,391.2 240,391.2 C323.5056,391.2 391.2,323.5056 391.2,240 C391.2,156.4944 323.5056,88.8 240,88.8 Z"
/>
<path
fill="url(#pulse-a)"
fillRule="evenodd"
d="M240,0 C372.5484,0 480,107.4516 480,240 C480,372.5484 372.5484,480 240,480 C107.4516,480 0,372.5484 0,240 C0,107.4516 107.4516,0 240,0 Z M240,88.8 C156.4944,88.8 88.8,156.4944 88.8,240 C88.8,323.5056 156.4944,391.2 240,391.2 C323.5056,391.2 391.2,323.5056 391.2,240 C391.2,156.4944 323.5056,88.8 240,88.8 Z"
/>
<path
fill="url(#pulse-a)"
fillRule="evenodd"
d="M240,0 C372.5484,0 480,107.4516 480,240 C480,372.5484 372.5484,480 240,480 C107.4516,480 0,372.5484 0,240 C0,107.4516 107.4516,0 240,0 Z M240,88.8 C156.4944,88.8 88.8,156.4944 88.8,240 C88.8,323.5056 156.4944,391.2 240,391.2 C323.5056,391.2 391.2,323.5056 391.2,240 C391.2,156.4944 323.5056,88.8 240,88.8 Z"
/>
</g>
</svg>
))}
</>
);
Expand Down
Loading

0 comments on commit e92bc28

Please sign in to comment.