Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Issue# 2: Added navigation from Matches page to Team Page #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/frontend/src/pages/MatchPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { React, useEffect, useState } from 'react';
import { useParams } from 'react-router-dom';
import { useParams, Link } from 'react-router-dom';
import { MatchDetailCard } from '../components/MatchDetailCard';

import { YearSelector } from '../components/YearSelector';
Expand Down Expand Up @@ -29,12 +29,18 @@ export const MatchPage = () => {

return (
<div className="MatchPage">

<div className="year-selector">
<h3> Select Year </h3>
<YearSelector teamName={teamName} />
</div>
<div>
<h1 className="page-heading">{teamName} matches in {year}</h1>

<div className="match-details">
<div className="team-heading-bar">
<h1 className="page-heading">{teamName} matches in {year}</h1>
<Link className="summary-link" to={`/teams/${teamName}`}>View Latest Summary</Link>
</div>

{
matches.map(match => <MatchDetailCard key={match.id} teamName={teamName} match={match} />)
}
Expand Down
19 changes: 19 additions & 0 deletions src/frontend/src/pages/MatchPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,23 @@
.page-heading {
margin: 20px auto;
}

.match-details{
.team-heading-bar{
display: grid;
grid-template-columns: 3fr 1fr;

.page-heading{
align-self: center;
justify-self: center;
padding-top: none;
}

.summary-link{
align-self: center;
justify-self: center;
padding-top: none;
}
}
}
}