Skip to content

Commit

Permalink
Merge pull request #94 from awest25/app-router
Browse files Browse the repository at this point in the history
App router
  • Loading branch information
Fredenck authored Feb 29, 2024
2 parents ebe69c7 + c762577 commit d13f40e
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"react": {
"version": "detect"
}
},
"env": {
"es6": true
}
}
6 changes: 3 additions & 3 deletions app/(interactive)/layout.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Inter } from "next/font/google";
// import { Inter } from "next/font/google";
import Toolbar from "../components/Toolbar"
import Footer from "../components/Footer"
// import Footer from "../components/Footer"

const inter = Inter({ subsets: ["latin"] });
// const inter = Inter({ subsets: ["latin"] });

export const metadata = {
title: "Tennis Video Viewer",
Expand Down
4 changes: 2 additions & 2 deletions app/(interactive)/matches/[slug]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React, { useState, useEffect } from 'react';
import Select from 'react-select';
import { useRouter, usePathname, useSearchParams } from 'next/navigation'
import { usePathname } from 'next/navigation'

import filterStyles from '../../../styles/FilterList.module.css'
import styles from '../../../styles/Match.module.css';
Expand Down Expand Up @@ -34,7 +34,7 @@ const MatchPage = () => {
const [showCount, setShowCount] = useState(false);
const [playingPoint, setPlayingPoint] = useState(null);

const router = useRouter();
// const router = useRouter();
const pathname = usePathname()
const videoId = pathname.substring(pathname.lastIndexOf('/') + 1);

Expand Down
2 changes: 1 addition & 1 deletion app/(interactive)/tag-match/page.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import React, { useState, useRef, useEffect } from 'react';
import React, { useState, useEffect } from 'react';
import VideoPlayer from '../../components/VideoPlayer';
import styles from '../../styles/Tagging.module.css';

Expand Down
4 changes: 2 additions & 2 deletions app/components/FilterList.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import nameMap from '../services/nameMap.js';

const FilterList = ({ pointsData, filterList, setFilterList, showPercent, showCount }) => {
// only keep relevant keys
const keys = Object.keys(nameMap).filter(key => pointsData && pointsData.some(point => point.hasOwnProperty(key)));
const keys = Object.keys(nameMap).filter(key => pointsData && pointsData.some(point => Object.prototype.hasOwnProperty.call(point, key)));
const uniqueValues = {};

// Iterate through filtered keys and populate uniqueValues
Expand Down Expand Up @@ -53,7 +53,7 @@ const FilterList = ({ pointsData, filterList, setFilterList, showPercent, showCo
};

// Sort the filterList array in alphabetical order
const sortedFilterList = filterList.sort((a, b) => a[0].localeCompare(b[0]));
// const sortedFilterList = filterList.sort((a, b) => a[0].localeCompare(b[0]));

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion app/components/VideoPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function VideoPlayer({ videoId, setVideoObject }) {
}
}, [videoId]);

const onPlayerReady = (event) => {
const onPlayerReady = () => {
console.log('player is ready')
};

Expand Down
6 changes: 3 additions & 3 deletions app/layout.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Inter } from "next/font/google";
import Toolbar from "./components/Toolbar"
// import { Inter } from "next/font/google";
// import Toolbar from "./components/Toolbar"
import Footer from "./components/Footer"

const inter = Inter({ subsets: ["latin"] });
// const inter = Inter({ subsets: ["latin"] });

export const metadata = {
title: "Tennis Video Viewer",
Expand Down

0 comments on commit d13f40e

Please sign in to comment.