Refactor Site Management Components and Update URL Parameters
- Changed `siteId` to `id` in `useParams` across multiple site-related components for consistency. - Removed "Sites" from the sidebar settings menu. - Updated navigation links in `SiteDashboard` to reflect new paths for integrations and deployments. - Enhanced `SiteList` component with improved site management features, including modals for site creation and sector configuration. - Added functionality to handle industry and sector selection for sites, with validation for maximum selections. - Improved UI elements and alerts for better user experience in site management.
This commit is contained in:
@@ -46,7 +46,7 @@ interface SiteStats {
|
||||
}
|
||||
|
||||
export default function SiteDashboard() {
|
||||
const { siteId } = useParams<{ siteId: string }>();
|
||||
const { id: siteId } = useParams<{ id: string }>();
|
||||
const navigate = useNavigate();
|
||||
const toast = useToast();
|
||||
const [site, setSite] = useState<Site | null>(null);
|
||||
@@ -152,14 +152,14 @@ export default function SiteDashboard() {
|
||||
value: stats?.integrations_count || 0,
|
||||
icon: <PlugIcon className="w-5 h-5" />,
|
||||
color: 'purple',
|
||||
link: `/sites/${siteId}/integrations`,
|
||||
link: `/sites/${siteId}/settings?tab=integrations`,
|
||||
},
|
||||
{
|
||||
label: 'Deployments',
|
||||
value: stats?.deployments_count || 0,
|
||||
icon: <TrendingUpIcon className="w-5 h-5" />,
|
||||
color: 'teal',
|
||||
link: `/sites/${siteId}/deployments`,
|
||||
link: `/sites/${siteId}/preview`,
|
||||
},
|
||||
{
|
||||
label: 'Total Content',
|
||||
@@ -256,7 +256,7 @@ export default function SiteDashboard() {
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => navigate(`/sites/${siteId}/integrations`)}
|
||||
onClick={() => navigate(`/sites/${siteId}/settings?tab=integrations`)}
|
||||
className="justify-start"
|
||||
>
|
||||
<PlugIcon className="w-4 h-4 mr-2" />
|
||||
@@ -264,11 +264,11 @@ export default function SiteDashboard() {
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => navigate(`/sites/${siteId}/deploy`)}
|
||||
onClick={() => navigate(`/sites/${siteId}/editor`)}
|
||||
className="justify-start"
|
||||
>
|
||||
<TrendingUpIcon className="w-4 h-4 mr-2" />
|
||||
Deploy Site
|
||||
<FileTextIcon className="w-4 h-4 mr-2" />
|
||||
Edit Site
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user