Skip to content

Commit 578ab2d

Browse files
authored
Merge pull request #576 from iitzIrFan/bug/broadcast
Add pagination to video details page with custom styles
2 parents a7bed56 + 10801b6 commit 578ab2d

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed

src/pages/broadcasts/details.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* Add custom styles for the details page pagination */
2+
.video-container .pagination {
3+
margin-top: 30px;
4+
}
5+
6+
.video-container .pagination button {
7+
padding: 10px 20px;
8+
margin: 0 10px;
9+
background: linear-gradient(to right, #007bff, #0056b3);
10+
color: white !important;
11+
border: none;
12+
border-radius: 8px;
13+
font-weight: 600;
14+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
15+
transition: all 0.3s ease;
16+
}
17+
18+
.video-container .pagination button:hover {
19+
transform: translateY(-2px);
20+
box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
21+
background: linear-gradient(to right, #0056b3, #003d80);
22+
}
23+
24+
[data-theme='dark'] .video-container .pagination button {
25+
background: linear-gradient(to right, #3b82f6, #2563eb);
26+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
27+
}
28+
29+
[data-theme='dark'] .video-container .pagination button:hover {
30+
background: linear-gradient(to right, #2563eb, #1d4ed8);
31+
box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
32+
}

src/pages/broadcasts/details.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import React, { useState, useEffect } from 'react';
22
import Layout from '@theme/Layout';
33
import type { ReactElement } from 'react';
4-
import { useLocation } from '@docusaurus/router';
4+
import { useLocation, useHistory } from '@docusaurus/router';
5+
import './video.css';
56
import './index.css';
7+
import './details.css';
68

79
interface VideoData {
810
id: string;
@@ -30,6 +32,7 @@ const getYoutubeVideoId = (url: string): string => {
3032

3133
export default function VideoDetails(): ReactElement {
3234
const location = useLocation();
35+
const history = useHistory();
3336
const state = location.state as LocationState;
3437
const video = state?.video;
3538
const [title, setTitle] = useState<string>('Loading...');
@@ -107,6 +110,24 @@ export default function VideoDetails(): ReactElement {
107110
<div className="video-meta">
108111
<p>Watch in full screen for the best viewing experience</p>
109112
</div>
113+
<div className="pagination" style={{marginTop: '30px'}}>
114+
<button
115+
onClick={() => history.push('/broadcasts')}
116+
style={{
117+
display: 'inline-block',
118+
padding: '12px 24px',
119+
backgroundColor: '#007bff',
120+
color: 'white',
121+
borderRadius: '8px',
122+
fontWeight: 'bold',
123+
textDecoration: 'none',
124+
boxShadow: '0 4px 6px rgba(0,0,0,0.1)',
125+
border: 'none'
126+
}}
127+
>
128+
← Back to Videos
129+
</button>
130+
</div>
110131
</div>
111132
</div>
112133
</div>

src/pages/broadcasts/index.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,21 +533,27 @@ h1 {
533533
.pagination {
534534
margin-top: 20px;
535535
text-align: center;
536+
display: flex;
537+
justify-content: center;
538+
align-items: center;
539+
gap: 1rem;
536540
}
537541

538542
.pagination button {
539543
padding: 8px 16px;
540544
margin: 0 8px;
541545
background-color: #007bff;
542-
color: white;
543-
border: none;
546+
color: white !important; /* Ensure text is visible in all themes */
547+
border: 1px solid #0056b3;
544548
border-radius: 8px;
545549
cursor: pointer;
550+
font-weight: 600;
546551
}
547552

548553
.pagination button:disabled {
549554
background-color: #ccc;
550555
cursor: not-allowed;
556+
color: #666 !important;
551557
}
552558

553559
.pagination span {

0 commit comments

Comments
 (0)