Migrating from UIContentWrap to HighRise ContentWrap
This guide will help you migrate from the UIContentWrap component to the HLContentWrap component.
Component Implementation Changes
Import Changes
diff
- import { UIContentWrap } from '@gohighlevel/ghl-ui'
+ import { HLContentWrap } from '@platform-ui/highrise'Basic Usage Changes
diff
- <UIContentWrap>
- <div>Your content here</div>
- </UIContentWrap>
+ <HLContentWrap>
+ <div>Your content here</div>
+ </HLContentWrap>With Locale Support
diff
- <UIContentWrap locale="en-US">
- <div>Localized content</div>
- </UIContentWrap>
+ <HLContentWrap locale="en-US">
+ <div>Localized content</div>
+ </HLContentWrap>With Notification Configuration
diff
- <UIContentWrap
- :notification-config="{
- placement: 'top-right',
- max: 5
- }"
- >
- <div>Content with notifications</div>
- </UIContentWrap>
+ <HLContentWrap
+ :notification-config="{
+ placement: 'top-right',
+ max: 5,
+ containerClass: 'custom-notification',
+ scrollable: true,
+ to: 'body' // Optional target container
+ }"
+ >
+ <div>Content with notifications</div>
+ </HLContentWrap>Props Changes
Required Changes
| ghl-ui Prop | HighRise Prop | Notes |
|---|---|---|
notificationConfig | notificationConfig | Enhanced with more configuration options (see below) |
Notification Config Options
typescript
interface NotificationConfig {
containerClass?: string // Custom class for notification container
containerStyle?: string | CSSProperties // Custom styles for container
placement?: 'top' | 'bottom' | 'top-right' | 'top-left' | 'bottom-left' | 'bottom-right'
max?: number // Maximum number of notifications
scrollable?: boolean // Whether notifications are scrollable
to?: string | HTMLElement // Target container for notifications
}Supported Locales
The following locales are supported in both versions:
en-US- English (United States)da- Danishnl- Dutchfi- Finnishfr-FR- French (France)fr-CA- French (Canada)de- Germanit- Italiannb- Norwegianpt-BR- Portuguese (Brazil)pt-PT- Portuguese (Portugal)es- Spanishsv- Swedishhr- Croatianhu- Hungarian
Theme and Provider Changes
HLContentWrap now wraps several providers to ensure consistent styling and functionality:
- Theme Provider - Handles global theme configuration
- Notification Provider - Manages notification system
- Modal Provider - Handles modal dialogs
- Internationalization Provider - Manages localization
Best Practices
- Always wrap your application's root component with
HLContentWrap - Set appropriate locale based on user preferences
- Configure notifications according to your application's needs
- Use full-screen mode when needed for specific layouts
- Consider mobile responsiveness when configuring notifications
- Use appropriate notification placements for different screen sizes
- Configure max notifications to prevent overwhelming users
- Use custom container classes for consistent styling
- Enable scrollable notifications for better user experience
- Maintain consistent notification styling across the application
Using with Notifications
vue
<script setup>
import { useNotification } from '@platform-ui/highrise'
const notification = useNotification()
function showNotification() {
notification.success({
title: 'Success',
content: 'Operation completed successfully',
duration: 3000,
})
}
</script>Additional Notes
- The component provides global configuration for your application
- Handles theme configuration automatically
- Manages notification system configuration
- Provides localization support through Vue's provide/inject mechanism
- Maintains consistent styling across components
- Supports custom notification styling and positioning
- Handles modal and notification stacking
- Manages global font configuration through CSS variables
- Provides consistent spacing (32px padding when not in full-screen mode)
- Supports both full-screen and contained layouts