How to use the @commercetools-frontend/constants.DOMAINS.GLOBAL 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 / application-shell / src / components / application-shell / application-shell.js View on Github external
role="application-layout"
                      css={css`
                        height: 100vh;
                        display: grid;
                        grid-template-rows: auto 43px 1fr;
                        grid-template-columns: auto 1fr;
                      `}
                    >
                      <div role="global-notifications">
                        
                      </div>

                      
                        {() =&gt; {
                          if (!projectKeyFromUrl) return ;
                          return (
                            
                              {({ isLoading: isProjectLoading, project }) =&gt; {
                                if (isProjectLoading) return null;

                                // when used outside of a project context,
                                // or when the project is expired or supsended
                                const useProjectContext =
                                  project &amp;&amp;
                                  !(
                                    (project.suspension &amp;&amp;
github commercetools / merchant-center-application-kit / packages / application-shell / src / test-utils / test-utils.js View on Github external
const ReduxProviders = ({ children }) =&gt; (
    
      
        <div>
          
          
          
          {children}
        </div>
      
    
  );
  ReduxProviders.propTypes = {
github commercetools / merchant-center-application-kit / visual-testing-app / src / components / notifications / notifications.visualroute.tsx View on Github external
{'Do or do not, there is no try.'}
      
    
    
      
        {'These are not the droids you are looking for!'}
      
    
    
      
        {`It's a trap!`}
      
    
    
      
        {'Do or do not, there is no try.'}
      
    
    
      
        {'These are not the droids you are looking for!'}
      
    
    
      
        {`It's a trap!`}
      
    
  
);
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / selectors.spec.js View on Github external
it('should select latest global notifications', () => {
    expect(
      selectLatestGlobalNotificationAsList.resultFunc([
        { domain: DOMAINS.GLOBAL },
        { domain: DOMAINS.SIDE },
        { domain: DOMAINS.PAGE },
      ])
    ).toEqual([{ domain: DOMAINS.GLOBAL }]);
  });
});
github commercetools / merchant-center-application-kit / packages / application-shell / src / components / application-shell / application-shell.spec.js View on Github external
it('should render GLOBAL ', () =&gt; {
      expect(wrapper.find('NotificationsList').at(0)).toHaveProp(
        'domain',
        DOMAINS.GLOBAL
      );
    });
    it('should render PAGE ', () =&gt; {
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / selectors.spec.js View on Github external
it('should select global notifications', () => {
    expect(
      selectGlobalNotifications.resultFunc([
        { domain: DOMAINS.GLOBAL },
        { domain: DOMAINS.PAGE },
      ])
    ).toEqual([{ domain: DOMAINS.GLOBAL }]);
  });
});
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notifications-list / notifications-list.js View on Github external
switch (notification.domain) {
    case DOMAINS.PAGE:
      switch (notification.kind) {
        case 'error':
        case 'warning':
        case 'info':
        case 'success':
          return GenericNotification;
        case 'api-error':
          return ApiErrorNotification;
        case 'unexpected-error':
          return UnexpectedErrorNotification;
        default:
          return null;
      }
    case DOMAINS.GLOBAL:
      switch (notification.kind) {
        case 'error':
        case 'warning':
        case 'info':
        case 'success':
          return GenericNotification;
        case 'unexpected-error':
          return UnexpectedErrorNotification;
        default:
          return null;
      }
    case DOMAINS.SIDE:
      switch (notification.kind) {
        case 'info':
        case 'success':
        case 'warning':

@commercetools-frontend/constants

Shared constants for MC applications

MIT
Latest version published 12 days ago

Package Health Score

90 / 100
Full package analysis