Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ygp188 committed Nov 8, 2019
1 parent f372ad4 commit e0b0ddd
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion api/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var router = express.Router();

let SongKickKey = process.env.SONGKICK_KEY;
let LastFmKey = process.env.LASTFM_KEY;
let YouTubeKey = process.env.YOUTUBE_API_KEY;
let YouTubeKey = process.env.YOUTUBE_API_KEY_THIRD;

const Artist = require("../models/artist");
const Concert = require("../models/concert");
Expand Down
Binary file added client/public/img/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions client/src/Components/CommentsConcert/CommentList.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import React, { Component } from "react";

import Comment from "./Comment";
import { Button } from "react-materialize";

import { connect } from "react-redux";
import { fetchDeleteCommentConcertAC } from "../../Redux/concertPageReducer/concertPageActions";


class CommentList extends Component {
onClick = async (id, idConcert) => {
await this.props.fetchDeleteCommentConcertAC(id, idConcert);
};

render() {
const { comments, idConcert, idUser } = this.props;
return (
Expand All @@ -18,9 +22,9 @@ class CommentList extends Component {
<div>
<Comment text={el.text} nameUser={el.nameUser} date={el.date} />
{idUser === el.idUser ? (
<button onClick={() => this.onClick(el._id, idConcert)}>
delete
</button>
<Button className="red darken-4" onClick={() => this.onClick(el._id, idConcert)}>
Delete
</Button>
) : null}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion client/src/Components/ConcertExplore/ConcertExplore.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ConcertExplore extends Component {
<Link to={`/concert/${this.props.events.allEvents[i].id}`}>
<Col m={3} style={{ fontWeight: "bold", textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap", color: "white" }}><i style={{ marginRight: "20px" }} class="small material-icons">date_range</i>{moment(new Date(el.start.date)).format("ll")}</Col>
<Col m={3} style={{ textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap", color: "white" }}><i style={{ marginRight: "20px" }} class="small material-icons">face</i>{el.performance[0] ? el.performance[0].displayName : el.displayName}</Col>
<Col m={4} style={{ textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap", color: "white" }}><i style={{ marginRight: "20px" }} class="small material-icons">location_city</i>{el.venue && el.venue.displayName}</Col>
<Col m={4} style={{ textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap", color: "white" }}><i style={{ marginRight: "20px" }} class="small material-icons">location_city</i>{el.venue && el.venue.displayName}, Moscow</Col>
</Link>
<Col style={{ textAlign: "right" }} m={2}><PlayArtistTopTracks artist={el.performance[0] ? el.performance[0].displayName : el.displayName} concertPage={true} /></Col>
</li>
Expand Down
4 changes: 2 additions & 2 deletions client/src/Components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "react-materialize";

import "./navbar.css";
import {Icon } from "react-materialize";
import { Icon } from "react-materialize";

import Youtube from "../Youtube/Youtube";

Expand Down Expand Up @@ -59,7 +59,7 @@ class Navbar1 extends Component {
<div className="Home-header">
<div className="NavLinks">
<NavLink activeClassName={"Active"} exact={true} to={"/"}>
Index
<img src="img/image.png" style={{ maxHeight: "100px", marginLeft: "-50px" }} />
</NavLink>
{!this.props.user.user
? <NavLink activeClassName={"Active"} to={"/login"}>
Expand Down
2 changes: 1 addition & 1 deletion client/src/Containers/ArtistPage/ArtistPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class ArtistInfo extends Component {
isLoading: true
};
}

componentDidMount = async () => {
if (this.props.isSearchBar) {
console.log("ok");
} else {
console.log("ololololo");
const id = this.props.match.params.id;
await this.props.getArtistNameAC(id);
await this.props.fetchArtistIdAC(this.props.artist.fetchedName);
Expand Down
9 changes: 5 additions & 4 deletions client/src/Containers/ConcertPage/ConcertPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ class ConcertPage extends Component {
await this.props.fetchConcertInfoAC(id);
}

onClick = async (e) => {
onClick = async (e, id) => {
const name = e;
const artistId = id;
await this.props.fetchArtistIdAC(name);
await this.props.fetchArtistInfoAC(name);
await this.props.keepArtistNameAC(name, this.props.artist.id)
this.props.history.push(`/artists/${this.props.artist.id}`);
await this.props.keepArtistNameAC(name, artistId)
this.props.history.push(`/artists/${artistId}`);
}


Expand Down Expand Up @@ -97,7 +98,7 @@ class ConcertPage extends Component {
<span style={{ fontWeight: "bold", fontSize: "35px", color: "#b71c1c", marginRight: "15px" }}>Performers:</span>
{performers && performers.map((el, i) => (
<Chip className="performersList" key={`${name}_${i}`}>
<Link style={{ color: "black" }} to={`/artists/${performers[i].id}`} value={el.displayName} onClick={() => this.onClick(el.displayName)}>
<Link style={{ color: "black" }} to={`/artists/${el.id}`} value={el.displayName} onClick={() => this.onClick(el.displayName, el.id)}>
{el.displayName}
</Link>
</Chip>
Expand Down
5 changes: 3 additions & 2 deletions client/src/Containers/User/UserContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Component } from "react";
import dataUser from "../../Data/dataUser";
import { withRouter, Link } from "react-router-dom";
import { connect } from "react-redux";
import moment from "moment";

import { fetchArtistIdAC, fetchArtistInfoAC, keepArtistNameAC } from "../../Redux/artistReducer/artistActions";

Expand Down Expand Up @@ -39,7 +40,7 @@ class UserContent extends Component {
const sortUpcomingConc = this.props.user.user.upcomingConcerts.sort(
(a, b) => (a.date > b.date ? 1 : -1)
);
const sortPrevConc = this.props.user.user.upcomingConcerts.sort((a, b) =>
const sortPrevConc = this.props.user.user.previousConcerts.sort((a, b) =>
a.date > b.date ? 1 : -1
);
this.setState({
Expand Down Expand Up @@ -99,7 +100,7 @@ class UserContent extends Component {
<li style={{ marginBottom: "25px", fontSize: "25px", textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap" }}>
{" "}
<span style={{ color: "red", marginRight: "5%" }}>
{concert.formatDate}
{moment(concert.formatDate).format("DD.MM.YY")}
</span>
{concert.group}
</li>
Expand Down

0 comments on commit e0b0ddd

Please sign in to comment.