Skip to content

Commit 8af2ebc

Browse files
authored
Merge pull request #23 from intellwe/feat/auth-provider
FEAT: Firebase Google Auth + Settings System (API Keys, Profile Management, Global Context) v3.2
2 parents 851fa96 + 17fb350 commit 8af2ebc

File tree

9 files changed

+811
-145
lines changed

9 files changed

+811
-145
lines changed

.github/workflows/deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy to cPanel
2+
on:
3+
push:
4+
branches: [master]
5+
6+
jobs:
7+
build-and-deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v2
14+
with:
15+
node-version: "18"
16+
17+
- name: Install Dependencies
18+
run: npm install
19+
20+
- name: Build
21+
run: npm run build
22+
23+
- name: Deploy to cPanel
24+
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
25+
with:
26+
server: ${{ secrets.FTP_SERVER }}
27+
username: ${{ secrets.FTP_USERNAME }}
28+
password: ${{ secrets.FTP_PASSWORD }}
29+
local-dir: ./dist/
30+
server-dir: /wedio.intellwe.com/

src/App.tsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ import StandaloneTextToSpeech from "./components/StandaloneTextToSpeech";
2727
import VoiceChanger from "./components/VoiceChanger";
2828
import DocumentToMedia from "./components/DocumentToMedia";
2929
import { AuthProvider, useAuth } from "./contexts/AuthContext";
30+
import { ApiKeyProvider } from "./contexts/ApiKeyContext";
3031
import AuthModal from "./components/AuthModal";
32+
import SettingsModal from "./components/SettingsModal";
3133

3234
function AppContent() {
3335
const [transcript, setTranscript] = useState<TranscriptResponse | null>(null);
@@ -42,6 +44,7 @@ function AppContent() {
4244
>("dashboard");
4345
const [sidebarOpen, setSidebarOpen] = useState(true);
4446
const [showAuthModal, setShowAuthModal] = useState(false);
47+
const [showSettingsModal, setShowSettingsModal] = useState(false);
4548

4649
const { currentUser, userProfile, logout } = useAuth();
4750

@@ -389,9 +392,14 @@ function AppContent() {
389392
Sign In
390393
</button>
391394
)}
392-
<button className="p-2 rounded-lg hover:bg-gray-700 transition-colors">
393-
<Settings className="h-5 w-5 text-gray-300" />
394-
</button>
395+
{currentUser && (
396+
<button
397+
onClick={() => setShowSettingsModal(true)}
398+
className="p-2 rounded-lg hover:bg-gray-700 transition-colors"
399+
>
400+
<Settings className="h-5 w-5 text-gray-300" />
401+
</button>
402+
)}
395403
</div>
396404
</div>
397405
</header>
@@ -484,7 +492,7 @@ function AppContent() {
484492
: "0 min"}
485493
</p>
486494
</div>
487-
<Headphones className="h-8 w-8 text-green-500" />
495+
<Headphones className="h-8 w-8 text-cyan-500" />
488496
</div>
489497
</div>
490498

@@ -547,7 +555,7 @@ function AppContent() {
547555

548556
{activeTab === "document-to-media" && (
549557
<div className="p-4 lg:p-6">
550-
<DocumentToMedia apiKey={apiKey} />
558+
<DocumentToMedia />
551559
</div>
552560
)}
553561
</div>
@@ -577,7 +585,7 @@ function AppContent() {
577585
<span className="ml-1">© {currentYear}</span>
578586
</p>
579587
<div className="text-xs text-gray-500">
580-
Professional AI Studio v3.1
588+
Professional AI Studio v3.2
581589
</div>
582590
</div>
583591
</footer>
@@ -588,14 +596,21 @@ function AppContent() {
588596
onClose={() => setShowAuthModal(false)}
589597
defaultMode="login"
590598
/>
599+
600+
<SettingsModal
601+
isOpen={showSettingsModal}
602+
onClose={() => setShowSettingsModal(false)}
603+
/>
591604
</div>
592605
);
593606
}
594607

595608
function App() {
596609
return (
597610
<AuthProvider>
598-
<AppContent />
611+
<ApiKeyProvider>
612+
<AppContent />
613+
</ApiKeyProvider>
599614
</AuthProvider>
600615
);
601616
}

0 commit comments

Comments
 (0)