From 50f9d7ae4f591c771aa48b8f975e374e156e447f Mon Sep 17 00:00:00 2001 From: Noah Date: Sat, 2 Aug 2025 06:22:55 +0200 Subject: [PATCH] Added login to RadioTower --- frontend/src/App.jsx | 2 +- frontend/src/constants/ApiConstants.js | 3 ++ frontend/src/screens/CreateStation.jsx | 5 +++- frontend/src/screens/Home.jsx | 24 ++++++++-------- frontend/src/screens/JoinStation.jsx | 7 ++--- frontend/src/screens/StationPage.jsx | 35 ++++++++++++++---------- frontend/src/utils/StationsCreate.js | 38 ++++++++++++++++---------- 7 files changed, 67 insertions(+), 47 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index df00a96..465c9cb 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -14,7 +14,7 @@ function App() { } /> } /> } /> - } /> + } /> diff --git a/frontend/src/constants/ApiConstants.js b/frontend/src/constants/ApiConstants.js index 7cdec44..caaf274 100644 --- a/frontend/src/constants/ApiConstants.js +++ b/frontend/src/constants/ApiConstants.js @@ -3,3 +3,6 @@ export const RADIOSTATION_URL = "http://localhost:8080/api"; export const CREATE_RADIOSTATION_ENDPOINT = "/radio-stations"; export const LIST_RADIOSTATIONS_ENDPOINT = "/radio-stations"; export const ADD_CLIENT_ENDPOINT = "/clients/connect"; + +export const SPOTIFY_PREMIUM_TOKEN = + "BQCEnWrYVdmta4Eekdkewazun99IuocRAyPEbwPSrHuGYgZYg7JGlXG2BLmRL6fwjzPJkrmHiqlTLSn1yqR36awA9Rv4n9dwvTBv1DjAitsuzaEVg7PtYdbUHXqP2HJJ4dDDvTtvUfWIBDY_Afa7WgY1cyRbl-p4VobNHXUR9N3Ye1qBTgH3RZ5ziIbIoNWe_JrxYvcedkvr23zXUVabOyahTgt_YdmnCWt2Iu8XT8sjhSyc8tOCqbs_KqE-Qe1WSPUCrGS8"; diff --git a/frontend/src/screens/CreateStation.jsx b/frontend/src/screens/CreateStation.jsx index bd53ac0..4578b30 100644 --- a/frontend/src/screens/CreateStation.jsx +++ b/frontend/src/screens/CreateStation.jsx @@ -6,9 +6,10 @@ import { createStation } from "../utils/StationsCreate"; function CreateStation() { const [name, setName] = useState(""); const [description, setDescription] = useState(""); + const [joinCode, setJoinCode] = useState(""); const handleCreateStation = () => { - createStation(name, description); + setJoinCode(createStation(name, description)); }; return ( @@ -28,6 +29,8 @@ function CreateStation() { > Create Radio Station + +

your joinCode: {joinCode}

); diff --git a/frontend/src/screens/Home.jsx b/frontend/src/screens/Home.jsx index 414e9d9..c6637d5 100644 --- a/frontend/src/screens/Home.jsx +++ b/frontend/src/screens/Home.jsx @@ -1,33 +1,35 @@ -import React from 'react'; -import { useNavigate } from 'react-router-dom'; +import React from "react"; +import { useNavigate } from "react-router-dom"; function Home() { const navigate = useNavigate(); const handleCreateStation = () => { - navigate('/create-station'); + navigate("/create-station"); }; const handleJoinStation = () => { - navigate('/join-station'); + navigate("/join-station"); }; return (

Radio Station Hub

-

Create or join a radio station to share music with friends

- +

+ Create or join a radio station to share music with friends +

+
- - -