Skip to content
Snippets Groups Projects
Commit b25f12a5 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5600-OZG-5715 revert button changes, use ods-button

parent 67551365
Branches
Tags
No related merge requests found
...@@ -15,7 +15,6 @@ type ButtonVariants = VariantProps<typeof buttonVariants>; ...@@ -15,7 +15,6 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
template: `<ods-button template: `<ods-button
[text]="text" [text]="text"
[type]="type" [type]="type"
[class]="class"
[size]="size" [size]="size"
[dataTestId]="dataTestId" [dataTestId]="dataTestId"
[isLoading]="isLoading" [isLoading]="isLoading"
...@@ -26,7 +25,6 @@ type ButtonVariants = VariantProps<typeof buttonVariants>; ...@@ -26,7 +25,6 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
export class ButtonWithSpinnerComponent implements OnInit { export class ButtonWithSpinnerComponent implements OnInit {
@Input() text: string = ''; @Input() text: string = '';
@Input() dataTestId: string = ''; @Input() dataTestId: string = '';
@Input() class: string = '';
@Input() stateResource: StateResource<Resource>; @Input() stateResource: StateResource<Resource>;
@Input() type: ButtonVariants['type'] = 'primary'; @Input() type: ButtonVariants['type'] = 'primary';
@Input() size: ButtonVariants['size'] = 'medium'; @Input() size: ButtonVariants['size'] = 'medium';
......
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Component, EventEmitter, Input, Output } from '@angular/core';
import { VariantProps, cva } from 'class-variance-authority'; import { VariantProps, cva } from 'class-variance-authority';
import { twMerge } from 'tailwind-merge';
import { SpinnerIconComponent } from '../icons/spinner-icon/spinner-icon.component'; import { SpinnerIconComponent } from '../icons/spinner-icon/spinner-icon.component';
...@@ -31,9 +30,8 @@ type ButtonVariants = VariantProps<typeof buttonVariants>; ...@@ -31,9 +30,8 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
standalone: true, standalone: true,
imports: [CommonModule, SpinnerIconComponent], imports: [CommonModule, SpinnerIconComponent],
template: `<button template: `<button
[class]="class"
type="button" type="button"
[ngClass]="twMerge(buttonVariants({ size, type }), class)" [ngClass]="buttonVariants({ size, type })"
[disabled]="isLoading" [disabled]="isLoading"
[attr.aria-disabled]="isLoading" [attr.aria-disabled]="isLoading"
[attr.aria-label]="text" [attr.aria-label]="text"
...@@ -48,7 +46,6 @@ type ButtonVariants = VariantProps<typeof buttonVariants>; ...@@ -48,7 +46,6 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
export class ButtonComponent { export class ButtonComponent {
@Input() text: string = ''; @Input() text: string = '';
@Input() dataTestId: string = ''; @Input() dataTestId: string = '';
@Input() class: string = '';
@Input() isLoading: boolean = false; @Input() isLoading: boolean = false;
@Input() type: ButtonVariants['type'] = 'primary'; @Input() type: ButtonVariants['type'] = 'primary';
@Input() size: ButtonVariants['size'] = 'medium'; @Input() size: ButtonVariants['size'] = 'medium';
...@@ -56,5 +53,4 @@ export class ButtonComponent { ...@@ -56,5 +53,4 @@ export class ButtonComponent {
@Output() public clickEmitter: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>(); @Output() public clickEmitter: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>();
buttonVariants = buttonVariants; buttonVariants = buttonVariants;
twMerge = twMerge;
} }
<ods-button <ods-button
*ngIf="showButton$ | async" *ngIf="showButton$ | async"
(click)="clickEmitter.emit($event)" (click)="clickEmitter.emit($event)"
type="primary"
size="medium"
class="mt-8 flex"
data-test-id="bescheid-weiter-button"
text="Weiter" text="Weiter"
class="mt-8 min-w-0 px-8" >
dataTestId="bescheid-weiter-button" </ods-button>
/>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment