Skip to content

Conversation

@DanutIlie
Copy link
Contributor

Issue/Feature

Added custom notification support

[] Yes

Updated CHANGELOG

[x] Yes

Testing

[x] User testing
[] Unit tests

@arhtudormorar
Copy link
Collaborator

add CHANGELOG

styleUrl: 'custom-create-toast.css',
shadow: true,
})
export class CustomToast {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename file to custom-toast (match file name with component name)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

private initializeToast(container: HTMLElement) {
if (container && !container.hasChildNodes()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do early return

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

styleUrl: 'simple-toast.css',
shadow: true,
})
export class TransactionToastContent {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either change file name or component name to match each other

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Event() handleDeleteToast: EventEmitter<void>;

render() {
const { icon, iconClassName, title, message, subtitle: notificationStatus } = this.toast;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notificationStatus no need, keep using subtitle

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


<button onClick={() => this.handleDeleteToast.emit()} type="button" class="icon-close" innerHTML={getIconHtmlFromIconDefinition(faTimes)}></button>

{notificationStatus && <div class="status-title">{notificationStatus}</div>}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class="status-title" --> class="subtitle"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Event() handleDeleteToast: EventEmitter<string>;

render() {
if (this.toast.instantiateToastElement) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typeof this.toast.instantiateToastElement === function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i change it to check for the element

@Component({
tag: 'custom-toast',
})
export class CustomToast {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename this to GenericToast

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


render() {
if (this.toast.instantiateToastElement) {
return <custom-create-toast toast={this.toast as IComponentToastType} onHandleDeleteToast={() => this.handleDeleteToast.emit(this.toast.toastId)} />;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and rename this to CustomToast

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,66 @@
import { IconName } from '@fortawesome/free-solid-svg-icons';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment on top of file
// match these interfaces with src/path-to-file.type.ts from sdk-dapp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

export class ToastList {
private eventBus: IEventBus = new EventBus();
@Prop() transactionToasts: ITransactionToast[];
@Prop() customToasts: ICustomToastType[];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ICustomToast

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@DanutIlie DanutIlie merged commit 6fdaf85 into development Jan 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants