Skip to content

Commit

Permalink
style: Basket button styling
Browse files Browse the repository at this point in the history
Formatting buttons so they're inline (Could do custom CSS if warranted, Pluggable seems to mess with renderTrigger button css)

ERM-3446
  • Loading branch information
EthanFreestone committed Jan 15, 2025
1 parent 23fa1c0 commit cbf5f8d
Showing 1 changed file with 31 additions and 24 deletions.
55 changes: 31 additions & 24 deletions src/components/views/Basket/Basket.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { useOkapiKy } from '@folio/stripes/core';

import {
Button,
Col,
IconButton,
Layout,
MessageBanner,
Pane,
PaneMenu,
Paneset,
Row,
} from '@folio/stripes/components';

import { AGREEMENT_ENDPOINT } from '../../../constants';
Expand Down Expand Up @@ -146,34 +148,31 @@ const Basket = ({
const disabled = Object.values(selectedItems).find((v) => v) === undefined; // None of the `selectedItems` value's are `true`

return (
<Layout className="marginTop1">
<Button
buttonStyle="primary"
data-test-basket-create-agreement
disabled={disabled}
onClick={() => {
setShowCreateAgreementModal(true);
}}
>
<FormattedMessage id="ui-agreements.basket.createAgreement" />
</Button>
</Layout>
<Button
buttonStyle="primary"
data-test-basket-create-agreement
disabled={disabled}
marginBottom0
onClick={() => {
setShowCreateAgreementModal(true);
}}
>
<FormattedMessage id="ui-agreements.basket.createAgreement" />
</Button>
);
};

const renderAddToAgreementButton = () => {
const disabled = Object.values(selectedItems).find((v) => v) === undefined; // None of the `selectedItems` value's ;
return (
<Layout className="marginTop1">
<AgreementSearchButton
buttonStyle="primary"
disabled={disabled}
name="agreement"
onAgreementSelected={(agreement) => {
setSelectedAgreement(agreement);
}}
/>
</Layout>
<AgreementSearchButton
buttonProps={{ buttonStyle: 'primary' }}
disabled={disabled}
name="agreement"
onAgreementSelected={(agreement) => {
setSelectedAgreement(agreement);
}}
/>
);
};

Expand Down Expand Up @@ -202,8 +201,16 @@ const Basket = ({
onToggleItem={handleToggleItem}
selectedItems={selectedItems}
/>
{renderCreateAgreementButton()}
{renderAddToAgreementButton()}
<Layout className="marginTop1">
<Row>
<Col xs={3}>
{renderAddToAgreementButton()}
</Col>
<Col xs={3}>
{renderCreateAgreementButton()}
</Col>
</Row>
</Layout>
</div>
</Pane>
<AgreementModal
Expand Down

0 comments on commit cbf5f8d

Please sign in to comment.