Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(web): stick product selector form actions to bottom #1769

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Nov 15 08:26:29 UTC 2024 - David Diaz <dgonzalez@suse.com>

- Stick product selection form actions to bottom
(gh#agama-project/agama#1769).

-------------------------------------------------------------------
Thu Nov 14 14:42:46 UTC 2024 - Knut Anderssen <kanderssen@suse.com>

Expand Down
69 changes: 34 additions & 35 deletions web/src/components/product/ProductSelectionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import React, { useState } from "react";
import {
Card,
CardBody,
Flex,
Form,
Grid,
GridItem,
Expand Down Expand Up @@ -116,40 +115,40 @@ function ProductSelectionPage() {
const isSelectionDisabled = !nextProduct || nextProduct === selectedProduct;

return (
<Page.Content>
<Center>
<Form id="productSelectionForm" onSubmit={onSubmit}>
<Grid hasGutter>
<ResponsiveGridItem>
<FormGroup role="radiogroup" label={_("Select a product")}>
<List isPlain aria-label={_("Available products")}>
{products.map((product, index) => (
<Option
key={index}
product={product}
isChecked={nextProduct === product}
onChange={() => setNextProduct(product)}
/>
))}
</List>
</FormGroup>
</ResponsiveGridItem>
<ResponsiveGridItem>
<Flex justifyContent={{ default: "justifyContentFlexEnd" }}>
{selectedProduct && !isLoading && <BackLink />}
<Page.Submit
form="productSelectionForm"
isDisabled={isSelectionDisabled}
isLoading={isLoading}
>
{_("Select")}
</Page.Submit>
</Flex>
</ResponsiveGridItem>
</Grid>
</Form>
</Center>
</Page.Content>
<Page>
<Page.Content>
<Center>
<Form id="productSelectionForm" onSubmit={onSubmit}>
<Grid hasGutter>
<ResponsiveGridItem>
<FormGroup role="radiogroup" label={_("Select a product")}>
<List isPlain aria-label={_("Available products")}>
{products.map((product, index) => (
<Option
key={index}
product={product}
isChecked={nextProduct === product}
onChange={() => setNextProduct(product)}
/>
))}
</List>
</FormGroup>
</ResponsiveGridItem>
</Grid>
</Form>
</Center>
</Page.Content>
<Page.Actions>
<BackLink />
<Page.Submit
form="productSelectionForm"
isDisabled={isSelectionDisabled}
isLoading={isLoading}
>
{_("Select")}
</Page.Submit>
</Page.Actions>
</Page>
);
}

Expand Down
Loading