How to use the @commercetools-frontend/constants.NOTIFICATION_DOMAINS.PAGE function in @commercetools-frontend/constants

To help you get started, we’ve selected a few @commercetools-frontend/constants examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notification / notification.styles.ts View on Github external
background-color: ${props.fixed
      ? 'transparent'
      : getColorByType(props.type)};

    > * + * {
      margin-left: ${customProperties.spacingS};
    }
  `;

  switch (props.domain) {
    case NOTIFICATION_DOMAINS.GLOBAL:
      return css`
        ${pageStyles};
        background-color: ${getColorByType(props.type)};
      `;
    case NOTIFICATION_DOMAINS.PAGE:
      return pageStyles;
    case NOTIFICATION_DOMAINS.SIDE: {
      const sideStyles = css`
        ${baseStyles};
        animation: ${showNotificationAnimation} 0.3s forwards;
        padding: ${customProperties.spacingM} ${customProperties.spacingM}
          ${customProperties.spacingM} 50px !important;
        text-align: left;
        background: ${customProperties.colorSurface};
        border: 1px solid ${getColorByType(props.type)};
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
        border-radius: ${customProperties.borderRadius6};
        word-break: break-word;
        hyphens: auto; /* still not supported on Chrome */
      `;
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / notifications-list.spec.tsx View on Github external
beforeEach(() => {
        console.error = jest.fn();
        mocked(useSelector).mockClear();
        mocked(useSelector).mockReturnValue([
          {
            id: 1,
            domain: NOTIFICATION_DOMAINS.PAGE,
            kind: NOTIFICATION_KINDS_PAGE['unexpected-error'],
            values: {},
          },
        ]);
        rendered = renderComponent(
          
        );
      });
      it('should render the UnexpectedErrorNotification notification component', async () => {
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / notifications-list.spec.tsx View on Github external
beforeEach(() => {
        console.error = jest.fn();
        mocked(useSelector).mockClear();
        mocked(useSelector).mockReturnValue([
          {
            id: 1,
            domain: NOTIFICATION_DOMAINS.PAGE,
            kind: NOTIFICATION_KINDS_PAGE['unexpected-error'],
            values: {},
          },
        ]);
        rendered = renderComponent(
          
        );
      });
      it('should render the UnexpectedErrorNotification notification component', async () => {
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / notifications-list.spec.tsx View on Github external
{
            id: 1,
            domain: NOTIFICATION_DOMAINS.PAGE,
            kind: NOTIFICATION_KINDS_PAGE['api-error'],
            values: {
              errors: [
                {
                  code: 'ConcurrentModification',
                  message: 'Concurrent modification',
                },
              ],
            },
          },
        ]);
        rendered = renderComponent(
          
        );
      });
      it('should render the ApiErrorNotification notification component', async () => {
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / notifications-list.spec.tsx View on Github external
beforeEach(() => {
      mocked(useSelector).mockClear();
      mocked(useSelector).mockReturnValue([
        {
          id: 1,
          domain: NOTIFICATION_DOMAINS.PAGE,
          kind: NOTIFICATION_KINDS_PAGE.error,
          text: 'Something went wrong',
        },
      ]);
      rendered = renderComponent(
        
          
        
      );
    });
    it('should render the  notification component', async () => {
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / notifications-list.styles.ts View on Github external
const getStyles = (props: StyleProps) => {
  const baseStyles = css`
    color: ${customProperties.colorSurface};
    position: relative;
    width: 100%;
    z-index: 10000;
  `;

  switch (props.domain) {
    case NOTIFICATION_DOMAINS.GLOBAL:
      return css`
        ${baseStyles};
        text-align: center;
        width: 100% !important;
      `;
    case NOTIFICATION_DOMAINS.PAGE:
      return css`
        ${baseStyles};
      `;
    case NOTIFICATION_DOMAINS.SIDE:
      return css`
        ${baseStyles};
        position: absolute;
        text-align: left;
        height: 0;
        overflow: visible;
      `;
    default:
      return css``;
  }
};
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / notifications-list.tsx View on Github external
const NotificationsList = (props: Props) => {
  switch (props.domain) {
    case NOTIFICATION_DOMAINS.GLOBAL:
      return ;
    case NOTIFICATION_DOMAINS.PAGE:
      return ;
    case NOTIFICATION_DOMAINS.SIDE:
      return ;
    default:
      return null;
  }
};
NotificationsList.displayName = 'NotificationsList';

@commercetools-frontend/constants

Shared constants for MC applications

MIT
Latest version published 3 days ago

Package Health Score

87 / 100
Full package analysis