Skip to content

Commit

Permalink
[DEV-12376] Add disabled property
Browse files Browse the repository at this point in the history
  • Loading branch information
e1himself committed Feb 14, 2024
1 parent 1ac6831 commit 4530c7d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Input } from '../Input';

export function SubscriptionCta({
className,
disabled = false,
error,
value,
onChange,
Expand Down Expand Up @@ -34,9 +35,10 @@ export function SubscriptionCta({
placeholder={intl['subscription.labelEmail'] ?? 'Enter your email'}
value={value}
onChange={(event) => onChange(event.target.value)}
readOnly={disabled}
/>
{children}
<Button className="shrink-0 w-full sm:w-max" type="submit">
<Button className="shrink-0 w-full sm:w-max" type="submit" disabled={disabled}>
{intl['actions.subscribe'] ?? 'Subscribe'}
</Button>
</form>
Expand All @@ -53,6 +55,7 @@ export namespace SubscriptionCta {

export interface Props {
className?: string;
disabled?: boolean;
value: string;
error?: string;
onChange: (value: string) => void;
Expand Down

0 comments on commit 4530c7d

Please sign in to comment.