mirror of
https://github.com/yusufipk/RepoHub.git
synced 2026-09-11 18:46:07 +00:00
feat: Add README, refactor Cryptomus feature flag to use environment variable, and include GitHub link in header.
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { RepoHubApp } from '@/components/RepoHubApp'
|
||||
|
||||
export default function HomePage() {
|
||||
return <RepoHubApp />
|
||||
const cryptomusEnabled = process.env.CRYPTOMUS_ENABLED !== 'false'
|
||||
return <RepoHubApp cryptomusEnabled={cryptomusEnabled} />
|
||||
}
|
||||
|
||||
+25
-18
@@ -5,29 +5,17 @@ import { Button } from '@/components/ui/button'
|
||||
import { useTheme } from '@/hooks/useTheme'
|
||||
import { useLocale } from '@/contexts/LocaleContext'
|
||||
import { SupportModal } from '@/components/SupportModal'
|
||||
import { Sun, Moon, Monitor, Globe, Heart } from 'lucide-react'
|
||||
import { Sun, Moon, Monitor, Globe, Heart, Github } from 'lucide-react'
|
||||
import Image from 'next/image'
|
||||
|
||||
export function Header() {
|
||||
export interface HeaderProps {
|
||||
cryptomusEnabled: boolean
|
||||
}
|
||||
|
||||
export function Header({ cryptomusEnabled }: HeaderProps) {
|
||||
const { theme, isDark, toggleTheme } = useTheme()
|
||||
const { locale, toggleLocale, t } = useLocale()
|
||||
const [isSupportModalOpen, setIsSupportModalOpen] = useState(false)
|
||||
const [cryptomusEnabled, setCryptomusEnabled] = useState(true)
|
||||
|
||||
useEffect(() => {
|
||||
const checkCryptomusStatus = async () => {
|
||||
try {
|
||||
const response = await fetch('/api/support/status', { cache: 'no-store' })
|
||||
const data = await response.json()
|
||||
setCryptomusEnabled(data.cryptomus_enabled)
|
||||
} catch (error) {
|
||||
// Default to enabled if check fails
|
||||
setCryptomusEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
checkCryptomusStatus()
|
||||
}, [])
|
||||
|
||||
const getThemeIcon = () => {
|
||||
switch (theme) {
|
||||
@@ -85,6 +73,25 @@ export function Header() {
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{/* GitHub Link */}
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
asChild
|
||||
className="w-full justify-start"
|
||||
>
|
||||
<a
|
||||
href="https://github.com/yusufipk/RepoHub"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<Github className="h-4 w-4" />
|
||||
<span className="ml-2 hidden sm:inline">
|
||||
GitHub
|
||||
</span>
|
||||
</a>
|
||||
</Button>
|
||||
|
||||
{/* Theme Toggle */}
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
@@ -11,7 +11,7 @@ import { generateScript } from '@/lib/scriptGenerator'
|
||||
import { useLocale } from '@/contexts/LocaleContext'
|
||||
import { Platform, Package, SelectedPackage, FilterOptions, GeneratedScript } from '@/types'
|
||||
|
||||
function RepoHubAppContent() {
|
||||
function RepoHubAppContent({ cryptomusEnabled }: { cryptomusEnabled: boolean }) {
|
||||
const { t, locale } = useLocale()
|
||||
const [selectedPlatform, setSelectedPlatform] = useState<Platform | null>(null)
|
||||
const [selectedPackages, setSelectedPackages] = useState<SelectedPackage[]>([])
|
||||
@@ -61,8 +61,8 @@ function RepoHubAppContent() {
|
||||
|
||||
return (
|
||||
<div key={locale} className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-gray-900 dark:to-gray-800">
|
||||
<Header />
|
||||
|
||||
<Header cryptomusEnabled={cryptomusEnabled} />
|
||||
|
||||
<div className="container mx-auto px-4 py-8">
|
||||
{/* Header */}
|
||||
<div className="text-center mb-8">
|
||||
@@ -116,10 +116,10 @@ function RepoHubAppContent() {
|
||||
)
|
||||
}
|
||||
|
||||
export function RepoHubApp() {
|
||||
export function RepoHubApp({ cryptomusEnabled }: { cryptomusEnabled: boolean }) {
|
||||
return (
|
||||
<LocaleProvider>
|
||||
<RepoHubAppContent />
|
||||
<RepoHubAppContent cryptomusEnabled={cryptomusEnabled} />
|
||||
</LocaleProvider>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user