Skip to content

Commit 18c6cac

Browse files
committed
Merge branch 'frontend-standalone-accountselector'
2 parents 52f02f0 + 56ce8ae commit 18c6cac

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

frontends/web/src/components/groupedaccountselector/groupedaccountselector.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ export type TOption = TDropdownOption<AccountCode> & TOptionAccountSelector;
3030
export type TGroupedOption = TDropdownGroupedOption<AccountCode, TGroupAccountSelector, TOptionAccountSelector>;
3131

3232
type TAccountSelector = {
33-
title: string;
33+
title?: string;
3434
disabled?: boolean;
3535
selected?: string;
3636
onChange: (value: string) => void;
37-
onProceed: () => void;
37+
onProceed?: () => void;
3838
accounts: TAccount[];
3939
};
4040

@@ -120,7 +120,9 @@ export const GroupedAccountSelector = ({ title, disabled, selected, onChange, on
120120

121121
return (
122122
<>
123-
<h1 className="title text-center">{title}</h1>
123+
{title && (
124+
<h1 className="title text-center">{title}</h1>
125+
)}
124126
<Dropdown<AccountCode, false, TGroupAccountSelector, TOptionAccountSelector>
125127
className={styles.select}
126128
classNamePrefix="react-select"
@@ -139,14 +141,16 @@ export const GroupedAccountSelector = ({ title, disabled, selected, onChange, on
139141
onOpenChange={setIsOpen}
140142
mobileTriggerComponent={mobileTriggerComponent}
141143
/>
142-
<div className="buttons text-center">
143-
<Button
144-
primary
145-
onClick={onProceed}
146-
disabled={!selected || disabled}>
147-
{t('buy.info.next')}
148-
</Button>
149-
</div>
144+
{onProceed && (
145+
<div className="buttons text-center">
146+
<Button
147+
primary
148+
onClick={onProceed}
149+
disabled={!selected || disabled}>
150+
{t('buy.info.next')}
151+
</Button>
152+
</div>
153+
)}
150154
</>
151155
);
152-
};
156+
};

0 commit comments

Comments
 (0)