mirror of
https://github.com/xtr-dev/payload-feature-flags.git
synced 2025-12-10 02:43:25 +00:00
Wrap feature flags interface in admin layout structure
Layout Integration: - Created custom admin layout wrapper with proper structure - Added breadcrumb navigation (Dashboard › Feature Flags) - Implemented consistent spacing and container max-width - Added proper header hierarchy with title and description - Ensured full-height layout with theme-aware backgrounds Navigation Improvements: - Added clickable breadcrumb back to Dashboard - Maintained proper visual hierarchy with typography - Added theme-consistent spacing and margins - Improved responsive design with centered content container The interface now feels like a native part of the Payload admin panel while maintaining the spreadsheet functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useState, useEffect, useCallback, useMemo, memo } from 'react'
|
import { useState, useEffect, useCallback, useMemo, memo } from 'react'
|
||||||
import { useConfig, useTheme } from '@payloadcms/ui'
|
import {
|
||||||
|
useConfig,
|
||||||
|
useTheme
|
||||||
|
} from '@payloadcms/ui'
|
||||||
|
|
||||||
interface FeatureFlag {
|
interface FeatureFlag {
|
||||||
id: string
|
id: string
|
||||||
@@ -191,28 +194,66 @@ const FeatureFlagsViewComponent = () => {
|
|||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<div style={{ padding: '2rem', textAlign: 'center', backgroundColor: styles.background, color: styles.text }}>
|
<div style={{
|
||||||
<div style={{ fontSize: '1.125rem', color: styles.textMuted }}>Loading feature flags...</div>
|
minHeight: '100vh',
|
||||||
|
backgroundColor: styles.background,
|
||||||
|
color: styles.text
|
||||||
|
}}>
|
||||||
|
<div style={{
|
||||||
|
maxWidth: '1200px',
|
||||||
|
margin: '0 auto',
|
||||||
|
padding: '2rem',
|
||||||
|
textAlign: 'center'
|
||||||
|
}}>
|
||||||
|
<div style={{ fontSize: '1.125rem', color: styles.textMuted }}>Loading feature flags...</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ padding: '2rem', maxWidth: '100%', backgroundColor: styles.background, color: styles.text, minHeight: '100vh' }}>
|
<div style={{
|
||||||
{/* Header */}
|
minHeight: '100vh',
|
||||||
<div style={{ marginBottom: '2rem' }}>
|
backgroundColor: styles.background,
|
||||||
<h1 style={{
|
color: styles.text
|
||||||
fontSize: '2rem',
|
}}>
|
||||||
fontWeight: '700',
|
<div style={{
|
||||||
color: styles.text,
|
maxWidth: '1200px',
|
||||||
marginBottom: '0.5rem'
|
margin: '0 auto',
|
||||||
}}>
|
padding: '2rem'
|
||||||
Feature Flags Dashboard
|
}}>
|
||||||
</h1>
|
{/* Header */}
|
||||||
<p style={{ color: styles.textMuted, fontSize: '1rem' }}>
|
<div style={{ marginBottom: '2rem' }}>
|
||||||
Manage all feature flags in a spreadsheet view
|
{/* Breadcrumb */}
|
||||||
</p>
|
<div style={{
|
||||||
</div>
|
fontSize: '0.875rem',
|
||||||
|
color: styles.textMuted,
|
||||||
|
marginBottom: '1rem',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: '0.5rem'
|
||||||
|
}}>
|
||||||
|
<a href="/admin" style={{ color: styles.info, textDecoration: 'none' }}>Dashboard</a>
|
||||||
|
<span>›</span>
|
||||||
|
<span>Feature Flags</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h1 style={{
|
||||||
|
fontSize: '2rem',
|
||||||
|
fontWeight: '700',
|
||||||
|
color: styles.text,
|
||||||
|
margin: '0 0 0.5rem 0'
|
||||||
|
}}>
|
||||||
|
Feature Flags Dashboard
|
||||||
|
</h1>
|
||||||
|
<p style={{
|
||||||
|
color: styles.textMuted,
|
||||||
|
fontSize: '1rem',
|
||||||
|
margin: '0 0 2rem 0'
|
||||||
|
}}>
|
||||||
|
Manage all feature flags in a spreadsheet view with inline editing capabilities
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Success/Error Messages */}
|
{/* Success/Error Messages */}
|
||||||
{successMessage && (
|
{successMessage && (
|
||||||
@@ -294,7 +335,8 @@ const FeatureFlagsViewComponent = () => {
|
|||||||
backgroundColor: styles.surface,
|
backgroundColor: styles.surface,
|
||||||
border: `1px solid ${styles.border}`,
|
border: `1px solid ${styles.border}`,
|
||||||
borderRadius: '0.75rem',
|
borderRadius: '0.75rem',
|
||||||
overflow: 'hidden'
|
overflow: 'hidden',
|
||||||
|
marginBottom: '2rem'
|
||||||
}}>
|
}}>
|
||||||
<div style={{ overflowX: 'auto' }}>
|
<div style={{ overflowX: 'auto' }}>
|
||||||
<table style={{
|
<table style={{
|
||||||
@@ -590,6 +632,7 @@ const FeatureFlagsViewComponent = () => {
|
|||||||
<span style={{ fontWeight: '600' }}>A/B Tests:</span> {flags.filter(f => f && f.variants && f.variants.length > 0).length}
|
<span style={{ fontWeight: '600' }}>A/B Tests:</span> {flags.filter(f => f && f.variants && f.variants.length > 0).length}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user