diff --git a/.env b/.env index 8b97f7ea..2f7b592a 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -REACT_APP_LOCALHOST='http://localhost:5000/' \ No newline at end of file +REACT_APP_DATABASE='http://localhost:3000/' \ No newline at end of file diff --git a/data.json b/data.json index 620487d4..533d0e69 100644 --- a/data.json +++ b/data.json @@ -502,7 +502,7 @@ { "id": "1", "name": "Advert 1", - "photo": "./src/september.png" + "photo": "https://sun9-15.userapi.com/impg/5IS2PMmTs9YGUuo2CGNDm3KxKbe6T7205_PT6A/-VHlhuPWlGk.jpg?size=1640x856&quality=95&sign=77953363d2f78b014aff77f540f7bfa0&type=album" } ] diff --git a/src/API/api.ts b/src/API/api.ts index 9b392da9..6871a4d2 100644 --- a/src/API/api.ts +++ b/src/API/api.ts @@ -1,7 +1,7 @@ import axios from "axios"; import { IAdvertisement, IGenre, IPlaylist, ISong } from "../models/IModels"; -const localhost = process.env.REACT_APP_LOCALHOST || 'http://localhost:3000'; +const localhost = process.env.REACT_APP_DATABASE; export function getPlaylistsByGenre(genre: string, playlists: IPlaylist[]) { return playlists.filter((playlist: IPlaylist) => playlist.genres.includes(genre)); @@ -21,24 +21,24 @@ export async function getPlaylist(id: string) { export async function getSongs() { - return await axios.get('http://localhost:3000/songs'); + return await axios.get(`${localhost}songs`); } export async function getSong(id: string) { - return await axios.get('http://localhost:3000/songs/' + id); + return await axios.get(`${localhost}songs/` + id); } export async function getGenres() { - return await axios.get('http://localhost:3000/genres'); + return await axios.get(`${localhost}genres`); } export async function getAds() { - return await axios.get('http://localhost:3000/ads'); + return await axios.get(`${localhost}advertisements`); } \ No newline at end of file diff --git a/src/App.css b/src/App.css index 5f4956b3..f3c57029 100644 --- a/src/App.css +++ b/src/App.css @@ -118,17 +118,20 @@ .play-song-button:after { content: attr(data-content); - font-size: 40px; - text-align: center; - display: block; + font-size: 28px; + display: flex; + align-items: center; + flex-wrap: wrap; + align-content: center; + justify-content: center; color: #fff; position: absolute; width: 100%; height:100%; top:0; left:0; background:rgba(0,0,0,0.6); opacity: 0; - transition: all 0.25s; - -webkit-transition: all 1s; + transition: all 0.15s; + -webkit-transition: all 0.5s; } .play-song-button:hover:after { diff --git a/src/App.tsx b/src/App.tsx index 7e2cc2dc..3650c30c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -26,8 +26,6 @@ function App() { async function fetchData() { - - const responseSongs = getSongs(); // const responseAlbums = await axios.get('http://localhost:3000/albums'); const responseGenres = getGenres(); diff --git a/src/components/menuComponents/SongsBlock.tsx b/src/components/menuComponents/SongsBlock.tsx index fd972c06..ac6409c5 100644 --- a/src/components/menuComponents/SongsBlock.tsx +++ b/src/components/menuComponents/SongsBlock.tsx @@ -17,9 +17,7 @@ export function SongsBlock({songs}: {songs: ISong[]}) { width: 100, render: (text: string, song: ISong) => ( -