cli-dock-cta.php
48 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * CLI Dock CTA Button - Compact button shown after banner is dismissed |
| 5 | * |
| 6 | * Rendered by JavaScript after the shrink-to-dock animation completes, |
| 7 | * or server-side when the banner was previously dismissed. |
| 8 | * |
| 9 | * Structure: Vertical container wraps button + sublabel so the sublabel |
| 10 | * aligns under the Local button only (not centered under entire row). |
| 11 | * |
| 12 | * License gating: Only Developer or Agency license holders can use this feature. |
| 13 | * Free/Basic/Pro users see a "Pro" badge and the button opens upgrade modal |
| 14 | * instead of performing the action. |
| 15 | */ |
| 16 | |
| 17 | use WPStaging\Core\WPStaging; |
| 18 | use WPStaging\Framework\Notices\CliIntegrationNotice; |
| 19 | |
| 20 | /** @var CliIntegrationNotice $cliNotice */ |
| 21 | $cliNotice = WPStaging::make(CliIntegrationNotice::class); |
| 22 | $hasDeveloperLicense = $cliNotice->isDeveloperOrHigherLicense(); |
| 23 | |
| 24 | ?> |
| 25 | <!-- |
| 26 | Server-rendered dock CTA: includes --visible class to appear immediately. |
| 27 | This is intentional - animation only occurs during the JS dismiss flow. |
| 28 | When users return to a page after previously dismissing, no animation is needed. |
| 29 | --> |
| 30 | <div class="wpstg-cli-dock-cta-wrapper !wpstg-flex wpstg-flex-col wpstg-items-center"> |
| 31 | <button type="button" |
| 32 | id="wpstg-cli-dock-cta-button" |
| 33 | class="wpstg-btn wpstg-btn-md wpstg-btn-outline wpstg-cli-dock-cta wpstg-cli-dock-cta--visible wpstg-w-fit" |
| 34 | aria-label="<?php esc_attr_e('Create Local Site', 'wp-staging'); ?>" |
| 35 | > |
| 36 | <svg class="wpstg-btn-icon-sm" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
| 37 | <path d="M12 10v6"></path> |
| 38 | <path d="M9 13h6"></path> |
| 39 | <path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"></path> |
| 40 | </svg> |
| 41 | <?php esc_html_e('Create Local Site', 'wp-staging'); ?> |
| 42 | <?php if (!$hasDeveloperLicense) : ?> |
| 43 | <span class="wpstg-badge wpstg-badge-pro"><?php esc_html_e('Pro', 'wp-staging'); ?></span> |
| 44 | <?php endif; ?> |
| 45 | </button> |
| 46 | <span class="wpstg-text-xs wpstg-leading-[0.8] wpstg-text-gray-500 dark:wpstg-text-gray-400 wpstg-mt-1.5"><?php esc_html_e('Local via Docker', 'wp-staging'); ?></span> |
| 47 | </div> |
| 48 |