Skip to content

Commit 014cfd9

Browse files
committed
fix yvideo issue and start styling?
1 parent 2f674a0 commit 014cfd9

File tree

5 files changed

+22
-37
lines changed

5 files changed

+22
-37
lines changed

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"bootstrap": "^4.6.0",
2929
"eslint-plugin-react": "^7.23.1",
3030
"formik": "^2.2.6",
31+
"get-video-id": "^3.2.0",
3132
"graphql": "^15.5.0",
3233
"react": "^17.0.2",
3334
"react-bootstrap": "^1.5.2",

src/Components/TaskBlocks/VideoBlock/VideoBlock.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1+
/* eslint-disable @typescript-eslint/no-unsafe-call */
2+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
13
import YouTube from 'react-youtube';
4+
import getVideoId from 'get-video-id';
25
import '../TaskBlock.css';
36

4-
// const opts = {
5-
// height: '390',
6-
// width: '640',
7-
// playerVars: {
8-
// // https://developers.google.com/youtube/player_parameters
9-
// autoplay: 1,
10-
// },
11-
// };
12-
137
function onReady(event: any) {
148
// access to player in all event handlers via event.target
159
event.target.pauseVideo();
1610
}
1711

1812
function VideoBlock({ title, contents }: { title: string; contents: string }) {
13+
const { id } = getVideoId(contents); // extract video id from yt url
1914
return (
2015
<div className="row">
2116
<div className="col-md-12 justifyCenter my-2 p-3">
2217
<h2 className="text-left">
2318
<b>{title}</b>
2419
</h2>
2520
<div className="container">
26-
<YouTube videoId={contents} onReady={onReady} />
21+
<YouTube videoId={id as never} onReady={onReady} />
2722
</div>
2823
</div>
2924
</div>

src/Navigation/Navigation.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#dev-dropdown {
2-
float: right;
3-
}
4-
51
#log-out {
62
float: right;
73
}

src/Navigation/Navigation.tsx

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,15 @@
11
import { Auth } from 'aws-amplify';
2-
import { Navbar, Nav, Form, Button, NavDropdown } from 'react-bootstrap';
2+
import { Navbar, Nav, Form, Button } from 'react-bootstrap';
33
import './Navigation.css';
44

55
export default function Navigation() {
66
return (
7-
<Navbar collapseOnSelect expand="sm" bg="dark" variant="dark">
8-
<Navbar.Brand href="/">Flipt(Ed)</Navbar.Brand>
7+
<Navbar collapseOnSelect expand="sm" bg="primary" variant="dark">
8+
<Navbar.Brand href="/">flipt.ED</Navbar.Brand>
99
<Navbar.Toggle aria-controls="responsive-navbar-nav" />
1010
<Navbar.Collapse id="responsive-navbar-nav">
1111
<Nav className="container-fluid">
1212
<Nav.Link href="/">Dashboard</Nav.Link>
13-
<Nav.Link href="/viewTask">View Test Task</Nav.Link>
14-
<Nav.Link href="/addNewCourse">Create Course</Nav.Link>
15-
<NavDropdown title="Dev Screens" className="ml-auto" id="dev-dropdown">
16-
<NavDropdown.Item href="/courseHome">Course Home</NavDropdown.Item>
17-
<NavDropdown.Item href="/addNewCourse">Create Course</NavDropdown.Item>
18-
<NavDropdown.Item href="/addTaskSubmission">Submit Task</NavDropdown.Item>
19-
<NavDropdown.Item href="/taskSubmissionOverview">
20-
Task Submission Overview
21-
</NavDropdown.Item>
22-
<NavDropdown.Item href="/viewTaskSubmission">
23-
View Task Submission
24-
</NavDropdown.Item>
25-
<NavDropdown.Item href="/studentOverview">Student Overview</NavDropdown.Item>
26-
<NavDropdown.Item href="/singleStudentOverview">
27-
Single Student Overview
28-
</NavDropdown.Item>
29-
<NavDropdown.Item href="/singleStudentMasteryOverview">
30-
Single Student Mastery Overview
31-
</NavDropdown.Item>
32-
</NavDropdown>
3313
<Form inline>
3414
<Button className="ml-auto" type="submit" onClick={() => Auth.signOut()}>
3515
Log Out

0 commit comments

Comments
 (0)