21 |
22 |
23 | ### Design Files
24 |
25 |
26 | Login Route
27 |
28 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Login - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-login-light-theme-sm-output.png)
29 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Login - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-login-dark-theme-sm-output.png)
30 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Login Failure - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-login-failure-light-theme-sm-output.png)
31 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Login Failure - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-login-failure-dark-theme-sm-output.png)
32 |
33 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Login - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-login-light-theme-lg-output.png)
34 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Login - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-login-dark-theme-lg-output.png)
35 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Login Failure - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-login-failure-light-theme-lg-output.png)
36 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Login Failure - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-login-failure-dark-theme-lg-output-v0.png)
37 |
38 |
39 |
40 |
41 | Home Route
42 |
43 | - [Extra Small (Size < 576px) - Home - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-success-light-theme-xs-output.png)
44 | - [Extra Small (Size < 576px) - Home - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-success-dark-theme-xs-output.png)
45 |
46 | - [Small (Size >= 576px) - Home - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-success-light-theme-sm-output.png)
47 | - [Small (Size >= 576px) - Home - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-success-dark-theme-sm-output.png)
48 |
49 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Home - No search results - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-no-videos-light-theme-sm-output.png)
50 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Home - No search results - Dark theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-no-videos-dark-theme-sm-output.png)
51 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Home Failure - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-failure-light-theme-sm-output.png)
52 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Home Failure - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-failure-dark-theme-sm-output.png)
53 |
54 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Home - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-success-light-theme-lg-output.png)
55 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Home - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-success-dark-theme-lg-output.png)
56 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Home - No search results - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-no-videos-light-theme-lg-output.png)
57 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Home - No search results - Dark theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-no-videos-dark-theme-lg-output.png)
58 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Home Failure - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-failure-light-theme-lg-output.png)
59 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Home Failure - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-failure-dark-theme-lg-output.png)
60 |
61 |
62 |
63 |
64 | Trending Route
65 |
66 | - [Extra Small (Size < 576px) - Trending - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-success-light-theme-xs-output.png)
67 | - [Extra Small (Size < 576px) - Trending - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-success-dark-theme-xs-output.png)
68 |
69 | - [Small (Size >= 576px) - Trending - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-success-light-theme-sm-output.png)
70 | - [Small (Size >= 576px) - Trending - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-success-dark-theme-sm-output.png)
71 |
72 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Trending Failure - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-failure-light-theme-sm-output.png)
73 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Trending Failure - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-failure-dark-theme-sm-output.png)
74 |
75 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Trending - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-success-light-theme-lg-output.png)
76 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Trending - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-success-dark-theme-lg-output.png)
77 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Trending Failure - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-failure-light-theme-lg-output.png)
78 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Trending Failure - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-failure-dark-theme-lg-output.png)
79 |
80 |
81 |
82 |
83 | Gaming Route
84 |
85 | - [Extra Small (Size < 576px) - Gaming - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-success-light-theme-xs-output.png)
86 | - [Extra Small (Size < 576px) - Gaming - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-success-dark-theme-xs-output.png)
87 |
88 | - [Small (Size >= 576px) - Gaming - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-success-light-theme-sm-output.png)
89 | - [Small (Size >= 576px) - Gaming - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-success-dark-theme-sm-output.png)
90 |
91 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Gaming Failure - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-failure-light-theme-sm-output.png)
92 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Gaming Failure - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-failure-dark-theme-sm-output.png)
93 |
94 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Gaming - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-success-light-theme-lg-output.png)
95 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Gaming - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-success-dark-theme-lg-output.png)
96 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Gaming Failure - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-failure-light-theme-lg-output.png)
97 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Gaming Failure - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-failure-dark-theme-lg-output.png)
98 |
99 |
100 |
101 |
102 | Video Item Details Route
103 |
104 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - VideoItemDetails - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-video-item-details-success-light-theme-sm-output.png)
105 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - VideoItemDetails - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-video-item-details-success-dark-theme-sm-output.png)
106 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - VideoItemDetails Failure - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-video-item-details-failure-light-theme-sm-output.png)
107 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - VideoItemDetails Failure - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-video-item-details-failure-dark-theme-sm-output.png)
108 |
109 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - VideoItemDetails - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-video-item-details-success-light-theme-lg-output.png)
110 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - VideoItemDetails - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-video-item-details-success-dark-theme-lg-output.png)
111 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - VideoItemDetails Failure - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-video-item-details-failure-light-theme-lg-output.png)
112 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - VideoItemDetails Failure - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-video-item-details-failure-dark-theme-lg-output.png)
113 |
114 |
115 |
116 |
117 | SavedVideos Route
118 |
119 | - [Extra Small (Size < 576px) - No SavedVideos - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-no-saved-videos-light-theme-sm-output.png)
120 | - [Extra Small (Size < 576px) - No SavedVideos - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-no-saved-videos-dark-theme-sm-output.png)
121 |
122 | - [Small (Size >= 576px) - SavedVideos - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-saved-videos-light-theme-sm-output.png)
123 | - [Small (Size >= 576px) - SavedVideos - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-saved-videos-dark-theme-sm-output.png)
124 |
125 | - [Extra Small (Size < 576px) - SavedVideos - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-saved-videos-light-theme-xs-output.png)
126 | - [Extra Small (Size < 576px) - SavedVideos - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-saved-videos-dark-theme-xs-output.png)
127 |
128 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - No SavedVideos - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-no-saved-videos-light-theme-lg-output.png)
129 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - No SavedVideos - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-no-saved-videos-dark-theme-lg-output.png)
130 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - SavedVideos - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-saved-videos-light-theme-lg-output.png)
131 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - SavedVideos - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-saved-videos-dark-theme-lg-output.png)
132 |
133 |
134 |
135 |
136 | Popup Design Files
137 |
138 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Logout Popup - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-logout-popup-light-theme-sm-output.png)
139 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Logout Popup - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-logout-popup-dark-theme-sm-output.png)
140 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Menu - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-menu-popup-light-theme-sm-output.png)
141 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Menu - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-menu-popup-dark-theme-sm-output.png)
142 |
143 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Logout Popup - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-logout-popup-light-theme-lg-output.png)
144 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Logout Popup - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-logout-popup-dark-theme-lg-output.png)
145 |
146 |
147 |
148 |
149 | Not Found Route
150 |
151 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Not Found - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-page-not-found-light-theme-sm-output.png)
152 | - [Extra Small (Size < 576px) and Small (Size >= 576px) - Not Found - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-page-not-found-dark-theme-sm-output.png)
153 |
154 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Not Found - Light Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-page-not-found-light-theme-lg-output.png)
155 | - [Medium (Size >= 768px), Large (Size >= 992px) and Extra Large (Size >= 1200px) - Not Found - Dark Theme](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-page-not-found-dark-theme-lg-output.png)
156 |
157 |
158 |
159 | ### Set Up Instructions
160 |
161 |
162 | Click to view
163 |
164 | - Download dependencies by running `npm install`
165 | - Start up the app using `npm start`
166 |
167 |
168 | ### Completion Instructions
169 |
170 |
171 | Functionality to be added
172 |
173 |
174 | The app must have the following functionalities
175 |
176 | - Initially, the app should be in **light** theme
177 |
178 | - **Login Route**
179 |
180 | - When a invalid username and password are provided and the Login button is clicked, then the respective error message received from the response should be displayed
181 | - When a valid username and password are provided and the Login button is clicked, then the page should be navigated to the **Home** route
182 | - When an _unauthenticated_ user, tries to access the `HomeRoute`, `TrendingRoute`, `GamingRoute`, `SavedVideosRoute`, `VideoDetailsRoute`, then the page should be navigated to **Login** route
183 | - When an _authenticated_ user, tries to access the `HomeRoute`, `TrendingRoute`, `GamingRoute`, `SavedVideosRoute`, `VideoDetailsRoute`, then the page should be navigated to the respective route
184 | - When an authenticated user tries to access the `LoginRoute`, then the page should be navigated to the **Home** route
185 | - When show password checkbox is checked, then the password should be shown
186 | - When show password checkbox is unchecked, then the password should be masked
187 |
188 | - **Home Route**
189 |
190 | - When an authenticated user opens the **Home** Route,
191 | - An HTTP GET request should be made to **homeVideosApiUrl** with query parameter as `search` and its initial value as empty string
192 | - **_Loader_** should be displayed while the HTTP request is fetching the data
193 | - After the data is fetched successfully, display the list of videos received in the response
194 | - If the HTTP GET request made is unsuccessful, then the [Failure view](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-failure-light-theme-lg-output.png) should be displayed
195 | - When the **Retry** button is clicked, an HTTP GET request should be made to **homeVideosApiUrl**
196 | - When a non-empty value is provided in the Search Input and button with search icon is clicked
197 | - Make an HTTP GET request to the **homeVideosApiUrl** with `jwt_token` in the Cookies and query parameter `search` with value as the text provided in the Search Input
198 | - **_Loader_** should be displayed while the HTTP request is fetching the data
199 | - After the data is fetched successfully, display the list of videos received in the response
200 | - When the HTTP GET request made to the **homeVideosApiUrl** returns an empty list for videos then [No Videos View](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-home-no-videos-light-theme-lg-output.png) should be displayed
201 | - When the **website logo** image is clicked, the page should be navigated to the **Home** route
202 | - When a **Video** is clicked, the page should be navigated to the **Video Item Details** route
203 | - Clicks on the **Trending** link in the Sidebar is clicked, then the page should be navigated to the **Trending** route
204 | - Clicks on the **Gaming** link in the Sidebar is clicked, then the page should be navigated to the **Gaming** route
205 | - Clicks on the **Saved Videos** link in the Sidebar is clicked, then the page should be navigated to the **SavedVideos** route
206 |
207 | - **Trending Route**
208 |
209 | - When an authenticated user opens the **Trending** Route,
210 | - An HTTP GET request should be made to **trendingVideosApiUrl**
211 | - **_Loader_** should be displayed while the HTTP request is fetching the data
212 | - After the data is fetched successfully, display the list of videos received in the response
213 | - If the HTTP GET request made is unsuccessful, then the [Failure view](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-trending-failure-light-theme-lg-output.png) should be displayed
214 | - When the **Retry** button is clicked, an HTTP GET request should be made to **trendingVideosApiUrl**
215 | - When the **website logo** image is clicked, the page should be navigated to the **Home** route
216 | - When a **Video** is clicked, the page should be navigated to the **Video Item Details** route
217 | - Clicks on the **Home** link in the Sidebar is clicked, then the page should be navigated to the **Home** route
218 | - Clicks on the **Gaming** link in the Sidebar is clicked, then the page should be navigated to the **Gaming** route
219 | - Clicks on the **Saved Videos** link in the Sidebar is clicked, then the page should be navigated to the **SavedVideos** route
220 |
221 | - **Gaming Route**
222 |
223 | - When an authenticated user opens the **Gaming** Route,
224 | - An HTTP GET request should be made to **gamingVideosApiUrl**
225 | - **_Loader_** should be displayed while the HTTP request is fetching the data
226 | - After the data is fetched successfully, display the list of videos received in the response
227 | - If the HTTP GET request made is unsuccessful, then the [Failure view](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-gaming-failure-light-theme-lg-output.png) should be displayed
228 | - When the **Retry** button is clicked, an HTTP GET request should be made to **gamingVideosApiUrl**
229 | - When the **website logo** image is clicked, the page should be navigated to the **Home** route
230 | - When a **Video** is clicked, the page should be navigated to the **Video Item Details** route
231 | - Clicks on the **Home** link in the Sidebar is clicked, then the page should be navigated to the **Home** route
232 | - Clicks on the **Trending** link in the Sidebar is clicked, then the page should be navigated to the **Trending** route
233 | - Clicks on the **Saved Videos** link in the Sidebar is clicked, then the page should be navigated to the **SavedVideos** route
234 |
235 | - **Video Item Details Route**
236 |
237 | - When an authenticated user opens the **Video Item Details** route
238 | - An HTTP GET request should be made to **videoItemDetailsApiUrl** with `jwt_token` in the Cookies and `video_id` as path parameter
239 | - **_loader_** should be displayed while the HTTP request is fetching the data
240 | - After the HTTP request is successful, the response received should be displayed
241 | - If the HTTP GET request made is unsuccessful, then the [Failure view](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-video-item-details-failure-light-theme-lg-output.png) should be displayed
242 | - When the **Retry** button is clicked, an HTTP GET request should be made to **videoItemDetailsApiUrl**
243 | - Corresponding video should be displayed using `react-player` package
244 | - Initially, all the three buttons (Like, Dislike, Save) will be inactive
245 | - When the **Like** button is clicked,
246 | - It will change to an active state
247 | - If the **Dislike** button is already in the active state, then the **Dislike** button needs to be changed to the inactive state
248 | - When the **Dislike** button is clicked,
249 |
250 | - It will change to an active state
251 | - If the **Like** button is already in the active state, then the **Like** button needs to be changed to the inactive state
252 |
253 | - When the **Save** button is clicked
254 | - The button will change to an active state and the respective video details should be added to the list of saved videos
255 | - **Save** button text will be changed to **Saved**
256 | - When the **Saved** button is clicked
257 | - The button will change to an inactive state and the respective video details will be removed from the list of saved videos
258 | - **Saved** button text will be changed to **Save**
259 |
260 | - **SavedVideos Route**
261 |
262 | - When an authenticated user opens the **SavedVideos** Route,
263 | - If the list of saved videos is empty, then [No Saved Videos Found View](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-no-saved-videos-light-theme-lg-output.png) should be displayed
264 | - The **Videos** in the list of saved videos should be displayed as a list of videos
265 | - When the **website logo** image is clicked, the page should be navigated to the **Home** route
266 | - When a **Video** is clicked, the page should be navigated to the **Video Item Details** route
267 | - Clicks on the **Home** link in the Sidebar is clicked, then the page should be navigated to the **Home** route
268 | - Clicks on the **Trending** link in the Sidebar is clicked, then the page should be navigated to the **Trending** route
269 | - Clicks on the **Gaming** link in the Sidebar is clicked, then the page should be navigated to the **Gaming** route
270 |
271 | - **Not Found Route**
272 |
273 | - When a random path is provided in the URL then the page should navigate to the **Not Found** route
274 |
275 | - When the **theme** button in the header is clicked, then the theme should be changed accordingly
276 |
277 | - **Logout**
278 | - When the **Logout** button in the header is clicked, then the [Logout Popup](https://assets.ccbp.in/frontend/content/react-js/nxt-watch-logout-popup-light-theme-lg-output.png) should be displayed
279 | - When **Cancel** button is clicked, then the popup should be closed and the page should not be navigated
280 | - When **Confirm** button is clicked, then the page should be navigated to the **Login** route
281 |
282 |
283 |
284 |
285 |
286 | API Requests & Responses
287 |
288 |
289 | **loginApiUrl**
290 |
291 | #### API: `https://apis.ccbp.in/login`
292 |
293 | #### Method: `POST`
294 |
295 | #### Description:
296 |
297 | Returns a response containing the jwt_token
298 |
299 | #### Success Response
300 |
301 | ```json
302 | {
303 | "jwt_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InJhaHVsIiwicm9sZSI6IlBSSU1FX1VTRVIiLCJpYXQiOjE2MTk2Mjg2MTN9. nZDlFsnSWArLKKeF0QbmdVfLgzUbx1BGJsqa2kc_21Y"
304 | }
305 | ```
306 |
307 | #### Failure Response
308 |
309 | ```json
310 | {
311 | "status_code": 404,
312 | "error_msg": "Username is not found"
313 | }
314 | ```
315 |
316 | **homeVideosApiUrl**
317 |
318 | #### API: `https://apis.ccbp.in/videos/all?search=`
319 |
320 | #### Method: `GET`
321 |
322 | #### Description:
323 |
324 | Returns a response containing the list of all videos
325 |
326 | #### Response
327 |
328 | ```json
329 | {
330 | "total": 60,
331 | "videos": [
332 | {
333 | "id": "30b642bd-7591-49f4-ac30-5c538f975b15",
334 | "title": "Sehwag shares his batting experience in iB Cricket | iB Cricket Super Over League",
335 | "thumbnail_url": "https://assets.ccbp.in/frontend/react-js/nxt-watch/ibc-sol-1-img.png",
336 | "channel": {
337 | "name": "iB Cricket",
338 | "profile_image_url": "https://assets.ccbp.in/frontend/react-js/nxt-watch/ib-cricket-img.png"
339 | },
340 | "view_count": "1.4K",
341 | "published_at": "Apr 19, 2019"
342 | },
343 | ...
344 | ],
345 | }
346 | ```
347 |
348 | **trendingVideosApiUrl**
349 |
350 | #### API: `https://apis.ccbp.in/videos/trending`
351 |
352 | #### Method: `GET`
353 |
354 | #### Description:
355 |
356 | Returns a response containing the list of trending videos
357 |
358 | #### Response
359 |
360 | ```json
361 | {
362 | "total": 30,
363 | "videos": [
364 | {
365 | "id": "ad9822d2-5763-41d9-adaf-baf9da3fd490",
366 | "title": "iB Hubs Announcement Event",
367 | "thumbnail_url": "https://assets.ccbp.in/frontend/react-js/nxt-watch/ibhubs-img.png",
368 | "channel": {
369 | "name": "iB Hubs",
370 | "profile_image_url": "https://assets.ccbp.in/frontend/react-js/nxt-watch/ib-hubs-img.png"
371 | },
372 | "view_count": "26K",
373 | "published_at": "Nov 29, 2016"
374 | },
375 | ...
376 | ]
377 | }
378 | ```
379 |
380 | **gamingVideosApiUrl**
381 |
382 | #### API: `https://apis.ccbp.in/videos/gaming`
383 |
384 | #### Method: `GET`
385 |
386 | #### Description:
387 |
388 | Returns a response containing the list of gaming videos
389 |
390 | #### Response
391 |
392 | ```json
393 | {
394 | "total": 30,
395 | "videos": [
396 | {
397 | "id": "b214dc8a-b126-4d15-8523-d37404318347",
398 | "title": "Drop Stack Ball",
399 | "thumbnail_url": "https://assets.ccbp.in/frontend/react-js/nxt-watch/drop-stack-ball-img.png",
400 | "view_count": "44K"
401 | },
402 | ...
403 | ]
404 | }
405 | ```
406 |
407 | **videoItemDetailsApiUrl**
408 |
409 | #### API: `https://apis.ccbp.in/videos/:id`
410 |
411 | #### Example: `https://apis.ccbp.in/videos/802fcd20-1490-43c5-9e66-ce6dfefb40d1`
412 |
413 | #### Method: `GET`
414 |
415 | #### Description:
416 |
417 | Returns a response containing the list of gaming videos
418 |
419 | #### Response
420 |
421 | ```json
422 | {
423 | "video_details": {
424 | "id": "ad9822d2-5763-41d9-adaf-baf9da3fd490",
425 | "title": "iB Hubs Announcement Event",
426 | "video_url": "https://www.youtube.com/watch?v=pT2ojWWjum8",
427 | "thumbnail_url": "https://assets.ccbp.in/frontend/react-js/nxt-watch/ibhubs-img.png",
428 | "channel": {
429 | "name": "iB Hubs",
430 | "profile_image_url": "https://assets.ccbp.in/frontend/react-js/nxt-watch/ib-hubs-img.png",
431 | "subscriber_count": "1M"
432 | },
433 | "view_count": "26K",
434 | "published_at": "Nov 29, 2016",
435 | "description": "iB Hubs grandly celebrated its Announcement Event in November 13, 2016, in the presence of many eminent personalities from the Government, Industry, and Academia with Shri Amitabh Kant, CEO, NITI Aayog as the Chief Guest."
436 | }
437 | }
438 | ```
439 |
440 |
441 |
442 | ### Quick Tips
443 |
444 |
445 | Click to view
446 |
447 |
448 | - To build this project, take a look at the React Popup and React Video Player reading materials
449 |
450 | - To style popup content use `.popup-content` class
451 |
452 | ```jsx
453 |
460 | //write code here
461 |
462 | ```
463 |
464 | - Use `formatDistanceToNow` function to find the difference between the given date and now in words.
465 |
466 | ```jsx
467 | import {formatDistanceToNow} from 'date-fns'
468 | console.log(formatDistanceToNow(new Date(2021, 8, 20)))
469 | // Return the distance between the given date and now in words.
470 | ```
471 |
472 |
473 |
474 | ### Important Note
475 |
476 |
477 | Click to view
478 |
479 |
480 |
481 | **The following instructions are required for the tests to pass**
482 |
483 | - `Home` route should consist of `/` in the URL path
484 | - `Login` route should consist of `/login` in the URL path
485 | - `Trending` route should consist of `/trending` in the URL path
486 | - `Gaming` route should consist of `/gaming` in the URL path
487 | - `SavedVideos` route should consist of `/saved-videos` in the URL path
488 | - `VideoItemDetails` route should consist of `/videos/:id` in the URL path
489 | - No need to use the `BrowserRouter` in `App.js` as we have already included in `index.js`
490 |
491 | - User credentials
492 |
493 | ```text
494 | username: rahul
495 | password: rahul@2021
496 |
497 | ```
498 |
499 | - Wrap the `Loader` component with an HTML container element and add the `data-testid` attribute value as `loader` to it
500 |
501 | ```jsx
502 |
503 |
504 |
505 | ```
506 |
507 | - The HTML button element in Home Route has the `data-testid` attribute value as `searchButton` to it
508 |
509 | - **Styled Components** should be used for styling purposes.
510 | - The theme button should have the `data-testid` as `theme`.
511 | - The Sidebar should consists of
512 | - Facebook logo
513 | - Twitter Logo
514 | - Each Route consists of respective banner as shown in the design files and it should have the `data-testid` as `banner`.
515 | - The thumbnail images in the Route should have the alt attribute value as **video thumbnail**.
516 | - The channel logo images in Home Route should have the alt attribute value as **channel logo**.
517 |
518 | - **Home Route**
519 |
520 | - The Route should consist of an HTML container element with `data-testid` as `home`.
521 | - The Route should consist of an HTML image element with attribute value as `nxt watch logo` and src as the value of the given nxt watch logo URL should be displayed in the banner.
522 | - The Route should consist of a banner and it contains a close button element with `data-testid` as `close`.
523 | - The HTML container element with `data-testid` as `home` should have the background color.
524 | - If the Dark theme is applied, then the **#181818** color should be applied as a background-color.
525 | - If the Light theme is applied, then the **#f9f9f9** color should be applied as a background-color.
526 |
527 | - **Trending Route**
528 |
529 | - The Route should consist of an HTML container element with `data-testid` as `trending`.
530 | - The HTML container element with `data-testid` as `trending` should maintain the background color theme.
531 | - If the Dark theme is applied, then the **#0f0f0f** color should be applied as a background-color.
532 | - If the Light theme is applied, then the **#f9f9f9** color should be applied as a background-color.
533 |
534 | - **Gaming Route**
535 |
536 | - The Route should consist of an HTML container element with `data-testid` as `gaming`.
537 | - The HTML container element with `data-testid` as `gaming` should maintain the background color theme.
538 | - If the Dark theme is applied, then the **#0f0f0f** color should be applied as a background-color.
539 | - If the Light theme is applied, then the **#f9f9f9** color should be applied as a background-color.
540 |
541 | - **SavedVideos Route**
542 |
543 | - The **SavedVideos** Route should consist of an HTML container element with `data-testid` as `savedVideos`.
544 | - The HTML container element with `data-testid` as `savedVideos` should maintain the background color theme.
545 | - If the Dark theme is applied, then the **#0f0f0f** color should be applied as a background-color.
546 | - If the Light theme is applied, then the **#f9f9f9** color should be applied as a background-color.
547 |
548 | - **VideoItemDetails Route**
549 |
550 | - The **VideoItemDetails** Route should consist of an HTML container element with `data-testid` as `videoItemDetails`.
551 | - The HTML container element with `data-testid` as `videoItemDetails` should maintain the background color theme.
552 | - If the Dark theme is applied, then the **#0f0f0f** color should be applied as a background-color.
553 | - If the Light theme is applied, then the **#f9f9f9** color should be applied as a background-color.
554 |
555 | - The **Website Logo** image for Light theme and Dark theme should have the alt attribute value as `website logo`
556 | - The **Failure** image for Light theme and Dark theme should have the alt attribute value as `failure view`
557 | - The **Not found** image for Light theme and Dark theme should have the alt attribute value as `not found`
558 | - In the **VideoItemDetails** Route, the **#2563eb** color should be applied as `color` for any button i.e (Like, Dislike, Save) if the button is active.
559 | - In the **VideoItemDetails** Route, the **#64748b** color should be applied as `color` for any button i.e (Like, Dislike, Save) if the button is inactive.
560 |
561 |
562 |
563 | ### Resources
564 |
565 |
566 | Image URLs
567 |
568 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-logo-light-theme-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-logo-light-theme-img.png)
569 |
570 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-logo-dark-theme-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-logo-dark-theme-img.png)
571 |
572 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-profile-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-profile-img.png) alt should be **profile**
573 |
574 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-failure-view-light-theme-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-failure-view-light-theme-img.png)
575 |
576 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-failure-view-dark-theme-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-failure-view-dark-theme-img.png)
577 |
578 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-no-search-results-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-no-search-results-img.png) alt should be **no videos**
579 |
580 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-no-saved-videos-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-no-saved-videos-img.png) alt should be **no saved videos**
581 |
582 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-not-found-light-theme-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-not-found-light-theme-img.png)
583 |
584 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-not-found-dark-theme-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-not-found-dark-theme-img.png)
585 |
586 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-banner-bg.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-banner-bg.png) **Banner Background image**
587 |
588 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-facebook-logo-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-facebook-logo-img.png) alt should be **facebook logo**
589 |
590 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-twitter-logo-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-twitter-logo-img.png) alt should be **twitter logo**
591 |
592 | - [https://assets.ccbp.in/frontend/react-js/nxt-watch-linked-in-logo-img.png](https://assets.ccbp.in/frontend/react-js/nxt-watch-linked-in-logo-img.png) alt should be **linked in logo**
593 |
594 |
595 |
596 |
597 | Colors
598 |
599 |
600 |
601 |
Hex: #0f0f0f
602 |
Hex: #f9f9f9
603 |
Hex: #f8fafc
604 |
Hex: #1e293b
605 |
Hex: #f1f5f9
606 |
Hex: #475569
607 |
Hex: #f1f1f1
608 |
Hex: #181818
609 |
Hex: #e2e8f0
610 |
Hex: #94a3b8
611 |
Hex: #4f46e5
612 |
Hex: #64748b
613 |
Hex: #231f20
614 |
Hex: #ffffff
615 |
Hex: #212121
616 |
Hex: #616e7c
617 |
Hex: #3b82f6
618 |
Hex: #00306e
619 |
Hex: #ebebeb
620 |
Hex: #7e858e
621 |
Hex: #d7dfe9
622 |
Hex: #cbd5e1
623 |
Hex: #000000
624 |
Hex: #ff0b37
625 |
Hex: #ff0000
626 |
Hex: #383838
627 |
Hex: #606060
628 |
Hex: #909090
629 |
Hex: #cccccc
630 |
Hex: #424242
631 |
Hex: #313131
632 |
Hex: #f4f4f4
633 |
Hex: #424242
634 |
635 |
636 |
637 |
638 | Font-families
639 |
640 | - Roboto
641 |
642 |
643 |
644 | > ### _Things to Keep in Mind_
645 | >
646 | > - All components you implement should go in the `src/components` directory.
647 | > - Don't change the component folder names as those are the files being imported into the tests.
648 | > - **Do not remove the pre-filled code**
649 | > - Want to quickly review some of the concepts you’ve been learning? Take a look at the Cheat Sheets.
650 |
--------------------------------------------------------------------------------