{isAd(obj) && Array.isArray(obj) ? obj.map((ad) =>
) : null}
+
{isSong(obj) ?
-
-
ТРЕК
+
+
![{obj.song_name}]({obj.cover})
-
{obj.song_name}
+
+
+ {obj.song_name}
+
+
+ {obj.band_name}
+
+
+ {isPlaying ?
+
{setIsPlaying(!isPlaying); setSongId(obj.id)}}>
+
+
+
+ :
+
{setIsPlaying(!isPlaying); setSongId(obj.id)}}>
+
+ }
+
+
+
+
: null}
- {isBand(obj) ?
{obj.name} : null}
+ {isBand(obj) ?
+
+
+
+
+ {obj.name}
+
+
+
+
+ Информация:
+
+
+
+
+ {obj.city},{obj.country}
+
+
+
+
+ годы: {obj.years}
+
+
+
+
+ жанры: {obj.genres.map((genre: string, index: number) => (
+ {genre}{index < obj.genres.length - 1 ? ', ' : ''}
+ ))}
+
+
+
+
+ Описание:
+
+
+
+
+ {obj.description}
+
+
+
+
+ : null}
{isAlbum(obj) ?
{obj.name} : null}
@@ -81,4 +153,3 @@ export function InformationTemplate ({obj}: {obj: ISong | IBand | IAlbum | IAdve
}
}
-
diff --git a/src/components/menuComponents/Templates/numeredSongsTemplate.tsx b/src/components/menuComponents/Templates/numeredSongsTemplate.tsx
deleted file mode 100644
index 28ffd272..00000000
--- a/src/components/menuComponents/Templates/numeredSongsTemplate.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import { Button } from "antd";
-import { ISong } from "../../../models/IModels";
-import { useState } from "react";
-import { useCurrentSongContext } from "../../../contexts/SongContexts/SongContextProvider";
-import { usePlayingContext } from "../../../contexts/SongContexts/PlayingProvider";
-
-const useColumnsWithNumber = (songs: ISong[]) => {
-
- const {isPlaying, setIsPlaying} = usePlayingContext();
- const { songId, setSongId } = useCurrentSongContext();
-
- const handlePlayClick = (songId: string) => {
- setIsPlaying(!isPlaying);
- setSongId(songId);
- };
-
- return [
- {
- title: '#',
- dataIndex: 'number',
- key: 'number',
- width: 50,
- render: (value: any, record: ISong, index: number) => {
- return record.number === 1 ?
👑 :
-
{record.number};
- },
- },
-
- {
- title: 'Play',
- dataIndex: 'play',
- key: 'play',
- width: 100,
-
- render: (text: string, song: ISong) => (
-
- ),
- },
- {
- title: '',
- dataIndex: 'song_name',
- key: 'song_name',
- width: 400
- },
- {
- title: '',
- dataIndex: 'band_name',
- key: 'band_name',
- width: 400
- },
- {
- title: '',
- dataIndex: 'album_name',
- key: 'album_name',
- width: 350
- }
-
- ]
-}
-
-export function GetColumnsWithNumber(songs: ISong[]) {
- return useColumnsWithNumber(songs);
-}
diff --git a/src/components/menuComponents/Templates/songsTemplate.tsx b/src/components/menuComponents/Templates/songsTemplate.tsx
index a85d67a6..5195d25e 100644
--- a/src/components/menuComponents/Templates/songsTemplate.tsx
+++ b/src/components/menuComponents/Templates/songsTemplate.tsx
@@ -5,7 +5,7 @@ import { height, style } from "@mui/system";
import { useCurrentSongContext } from "../../../contexts/SongContexts/SongContextProvider";
import { usePlayingContext } from "../../../contexts/SongContexts/PlayingProvider";
-const useColumns = (songs: ISong[])=> {
+const useColumns = (songs: ISong[], chart: boolean = false) => {
const {isPlaying, setIsPlaying} = usePlayingContext();
const { songId, setSongId } = useCurrentSongContext();
@@ -16,7 +16,20 @@ const useColumns = (songs: ISong[])=> {
};
- return [
+ const columns = [
+ ...(chart ?
+ [
+ {
+ title: '#',
+ dataIndex: 'number',
+ key: 'number',
+ width: 50,
+ render: (value: any, record: ISong, index: number) => {
+ return record.number === 1 ?
👑 :
+
{record.number};
+ },
+ },
+ ]: []),
{
title: 'Play',
dataIndex: 'play',
@@ -44,7 +57,7 @@ const useColumns = (songs: ISong[])=> {
dataIndex: 'song_name',
key: 'song_name',
width: 400,
- render: (text: string, song: ISong) =>
{text}
+ render: (text: string, song: ISong) => (
{text}
)
},
{
title: '',
@@ -60,8 +73,10 @@ const useColumns = (songs: ISong[])=> {
}
]
+
+ return columns
}
-export function GetColumns(songs: ISong[]) {
- return useColumns(songs);
+export function GetColumns(songs: ISong[], chart: boolean) {
+ return useColumns(songs, chart);
}
diff --git a/src/components/songComponents/CurrentTrack.tsx b/src/components/songComponents/CurrentTrack.tsx
index 58db8165..bd796f82 100644
--- a/src/components/songComponents/CurrentTrack.tsx
+++ b/src/components/songComponents/CurrentTrack.tsx
@@ -19,10 +19,7 @@ const Song = styled.div`
box-sizing: border-box;
background-color: #fff;
- @media (max-width: 768px) {
- padding: 0 10px;
- flex-direction: column;
- }
+
`;
type CurrentSongProps = {
diff --git a/src/pages/Registerpage.tsx b/src/pages/Registerpage.tsx
index 5e3fee46..50d09cbb 100644
--- a/src/pages/Registerpage.tsx
+++ b/src/pages/Registerpage.tsx
@@ -1,6 +1,7 @@
import { MailOutlined, LockOutlined } from "@ant-design/icons";
import { Form, Input, Button, Checkbox } from "antd";
import { Link } from "react-router-dom";
+// @ts-ignore
import ReCAPTCHA from "react-google-recaptcha";
import React, { useState } from "react";