• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 4c232b3228470d1c29bcc11ca8d55923bc803f45

18 Nov 2024 08:10AM CUT coverage: 54.486% (+3.1%) from 51.425%
4c232b3228470d1c29bcc11ca8d55923bc803f45

push

github

igorschoester
Add sidebar to dashboard

7593 of 13651 branches covered (55.62%)

Branch coverage included in aggregate %.

0 of 9 new or added lines in 2 files covered. (0.0%)

29754 of 54893 relevant lines covered (54.2%)

41809.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/js/src/general/components/sidebar-layout.js
1
import { useSelect } from "@wordpress/data";
2
import classNames from "classnames";
3
import PropTypes from "prop-types";
4
import { SidebarRecommendations } from "../../shared-admin/components";
5
import { STORE_NAME } from "../constants";
6
import { useSelectGeneralPage } from "../hooks";
7

8
/**
9
 * @param {string} [contentClassName] Extra class name for the children container.
10
 * @param {JSX.node} children The children.
11
 * @returns {JSX.Element} The element.
12
 */
NEW
13
export const SidebarLayout = ( { contentClassName, children } ) => {
×
NEW
14
        const isPremium = useSelectGeneralPage( "selectPreference", [], "isPremium" );
×
NEW
15
        const premiumLinkSidebar = useSelectGeneralPage( "selectLink", [], "https://yoa.st/jj" );
×
NEW
16
        const premiumUpsellConfig = useSelectGeneralPage( "selectUpsellSettingsAsProps" );
×
NEW
17
        const academyLink = useSelectGeneralPage( "selectLink", [], "https://yoa.st/3t6" );
×
NEW
18
        const { isPromotionActive } = useSelect( STORE_NAME );
×
19

NEW
20
        return (
×
21
                <div className="yst-flex yst-gap-6 xl:yst-flex-row yst-flex-col">
22
                        <div className={ classNames( "yst-@container yst-flex yst-flex-grow yst-flex-col", contentClassName ) }>
23
                                { children }
24
                        </div>
25
                        { ! isPremium &&
×
26
                                <div className="yst-min-w-[16rem] xl:yst-max-w-[16rem]">
27
                                        <div className="yst-sticky yst-top-16">
28
                                                <SidebarRecommendations
29
                                                        premiumLink={ premiumLinkSidebar }
30
                                                        premiumUpsellConfig={ premiumUpsellConfig }
31
                                                        academyLink={ academyLink }
32
                                                        isPromotionActive={ isPromotionActive }
33
                                                />
34
                                        </div>
35
                                </div>
36
                        }
37
                </div>
38
        );
39
};
40

NEW
41
SidebarLayout.propTypes = {
×
42
        contentClassName: PropTypes.string,
43
        children: PropTypes.node,
44
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc