mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-31 19:15:17 +02:00
Merge pull request #269 from rowboatlabs/dev
Hide community cards behind feature flag
This commit is contained in:
commit
109997ca2e
3 changed files with 219 additions and 204 deletions
|
|
@ -18,3 +18,6 @@ export const SHOW_COPILOT_MARQUEE = false;
|
||||||
export const SHOW_PROMPTS_SECTION = true;
|
export const SHOW_PROMPTS_SECTION = true;
|
||||||
export const SHOW_DARK_MODE_TOGGLE = false;
|
export const SHOW_DARK_MODE_TOGGLE = false;
|
||||||
export const SHOW_VISUALIZATION = false;
|
export const SHOW_VISUALIZATION = false;
|
||||||
|
|
||||||
|
// Client-safe flags
|
||||||
|
export const SHOW_COMMUNITY_PUBLISH = false;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { useParams, useRouter } from "next/navigation";
|
||||||
import { ProgressBar, ProgressStep } from "@/components/ui/progress-bar";
|
import { ProgressBar, ProgressStep } from "@/components/ui/progress-bar";
|
||||||
import { useUser } from '@auth0/nextjs-auth0';
|
import { useUser } from '@auth0/nextjs-auth0';
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
|
import { SHOW_COMMUNITY_PUBLISH } from "@/app/lib/feature_flags";
|
||||||
|
|
||||||
interface TopBarProps {
|
interface TopBarProps {
|
||||||
localProjectName: string;
|
localProjectName: string;
|
||||||
|
|
@ -708,6 +709,7 @@ export function TopBar({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Divider */}
|
{/* Divider */}
|
||||||
|
{SHOW_COMMUNITY_PUBLISH && (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<div className="absolute inset-0 flex items-center">
|
<div className="absolute inset-0 flex items-center">
|
||||||
<div className="w-full border-t border-gray-200 dark:border-gray-700"></div>
|
<div className="w-full border-t border-gray-200 dark:border-gray-700"></div>
|
||||||
|
|
@ -716,8 +718,10 @@ export function TopBar({
|
||||||
<span className="px-4 bg-white dark:bg-gray-900 text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider">or</span>
|
<span className="px-4 bg-white dark:bg-gray-900 text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider">or</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Community Publishing Section */}
|
{/* Community Publishing Section */}
|
||||||
|
{SHOW_COMMUNITY_PUBLISH && (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className="w-8 h-8 rounded-lg bg-purple-100 dark:bg-purple-900/30 flex items-center justify-center">
|
<div className="w-8 h-8 rounded-lg bg-purple-100 dark:bg-purple-900/30 flex items-center justify-center">
|
||||||
|
|
@ -828,6 +832,7 @@ export function TopBar({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
<ModalFooter className="gap-3">
|
<ModalFooter className="gap-3">
|
||||||
|
|
@ -836,8 +841,9 @@ export function TopBar({
|
||||||
onPress={onShareModalClose}
|
onPress={onShareModalClose}
|
||||||
className="px-6 py-2 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"
|
className="px-6 py-2 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"
|
||||||
>
|
>
|
||||||
Cancel
|
Close
|
||||||
</Button>
|
</Button>
|
||||||
|
{SHOW_COMMUNITY_PUBLISH && (
|
||||||
<Button
|
<Button
|
||||||
color={communityPublishSuccess ? "success" : "primary"}
|
color={communityPublishSuccess ? "success" : "primary"}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
|
@ -850,11 +856,13 @@ export function TopBar({
|
||||||
>
|
>
|
||||||
{communityPublishSuccess ? 'Published' : (communityPublishing ? 'Publishing...' : 'Publish to Community')}
|
{communityPublishSuccess ? 'Published' : (communityPublishing ? 'Publishing...' : 'Publish to Community')}
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
{/* Confirmation Modal for Community Publish */}
|
{/* Confirmation Modal for Community Publish */}
|
||||||
|
{SHOW_COMMUNITY_PUBLISH && (
|
||||||
<Modal
|
<Modal
|
||||||
isOpen={isConfirmOpen}
|
isOpen={isConfirmOpen}
|
||||||
onClose={() => { setAcknowledged(false); onConfirmClose(); }}
|
onClose={() => { setAcknowledged(false); onConfirmClose(); }}
|
||||||
|
|
@ -906,6 +914,7 @@ export function TopBar({
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { Search, Filter } from 'lucide-react';
|
||||||
import { AssistantCard } from './AssistantCard';
|
import { AssistantCard } from './AssistantCard';
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { getCurrentUser } from '@/app/actions/assistant-templates.actions';
|
import { getCurrentUser } from '@/app/actions/assistant-templates.actions';
|
||||||
|
import { SHOW_COMMUNITY_PUBLISH } from '@/app/lib/feature_flags';
|
||||||
|
|
||||||
interface TemplateItem {
|
interface TemplateItem {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
@ -60,7 +61,7 @@ export function UnifiedTemplatesSection({
|
||||||
onTypeChange,
|
onTypeChange,
|
||||||
}: UnifiedTemplatesSectionProps) {
|
}: UnifiedTemplatesSectionProps) {
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
const [selectedType, setSelectedType] = useState<'prebuilt' | 'community'>('prebuilt');
|
const [selectedType, setSelectedType] = useState<'prebuilt' | 'community'>(SHOW_COMMUNITY_PUBLISH ? 'prebuilt' : 'prebuilt');
|
||||||
const [selectedCategories, setSelectedCategories] = useState<Set<string>>(new Set());
|
const [selectedCategories, setSelectedCategories] = useState<Set<string>>(new Set());
|
||||||
const [sortBy, setSortBy] = useState<'popular' | 'newest' | 'alphabetical'>('alphabetical');
|
const [sortBy, setSortBy] = useState<'popular' | 'newest' | 'alphabetical'>('alphabetical');
|
||||||
const [currentUserId, setCurrentUserId] = useState<string | null>(null);
|
const [currentUserId, setCurrentUserId] = useState<string | null>(null);
|
||||||
|
|
@ -105,7 +106,7 @@ export function UnifiedTemplatesSection({
|
||||||
const allTemplates = useMemo(() => {
|
const allTemplates = useMemo(() => {
|
||||||
const combined = [
|
const combined = [
|
||||||
...prebuiltTemplates.map(t => ({ ...t, type: 'prebuilt' as const })),
|
...prebuiltTemplates.map(t => ({ ...t, type: 'prebuilt' as const })),
|
||||||
...communityTemplates.map(t => ({ ...t, type: 'community' as const }))
|
...(SHOW_COMMUNITY_PUBLISH ? communityTemplates.map(t => ({ ...t, type: 'community' as const })) : [])
|
||||||
];
|
];
|
||||||
return combined;
|
return combined;
|
||||||
}, [prebuiltTemplates, communityTemplates]);
|
}, [prebuiltTemplates, communityTemplates]);
|
||||||
|
|
@ -300,6 +301,7 @@ export function UnifiedTemplatesSection({
|
||||||
|
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
{/* Type Filter Segmented Control (Library | Community) */}
|
{/* Type Filter Segmented Control (Library | Community) */}
|
||||||
|
{SHOW_COMMUNITY_PUBLISH && (
|
||||||
<div className="flex gap-0.5 items-center h-8 rounded-full border border-gray-200 dark:border-gray-700 p-0 bg-white dark:bg-gray-800 shadow-sm overflow-hidden">
|
<div className="flex gap-0.5 items-center h-8 rounded-full border border-gray-200 dark:border-gray-700 p-0 bg-white dark:bg-gray-800 shadow-sm overflow-hidden">
|
||||||
{[
|
{[
|
||||||
{ key: 'prebuilt', label: 'Library' },
|
{ key: 'prebuilt', label: 'Library' },
|
||||||
|
|
@ -326,6 +328,7 @@ export function UnifiedTemplatesSection({
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Sort Dropdown (Popularity only for Community) */}
|
{/* Sort Dropdown (Popularity only for Community) */}
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue