Reformatting Channel page to display buttons better on mobile. Creating BackButton to consolidate functionality. Expanding search input on mobile.

This commit is contained in:
Roland 2022-11-30 19:31:18 -07:00
parent 759560dc6f
commit 9f52f41d56
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
6 changed files with 235 additions and 225 deletions

View file

@ -1,4 +1,4 @@
import React, {useContext, useEffect, useState} from 'react';
import React, {Fragment, useContext, useEffect, useState} from 'react';
import {Link, Route, Routes, useParams} from "react-router-dom";
import {
CardLink,
@ -50,7 +50,7 @@ export function VideoWrapper() {
setFavorite={setFavorite} autoplay={true}/>
}
function Videos({filter}) {
function VideosPage({filter}) {
let title = 'Videos';
if (filter && filter.indexOf('favorite') >= 0) {
title = 'Favorite Videos';
@ -105,7 +105,7 @@ function Videos({filter}) {
videoOrders = [{key: 'rank', value: 'rank', text: 'Search Rank'}, ...videoOrders];
}
const menuColumns = <>
const menuColumns = <Fragment>
<Grid.Column mobile={8} computer={5}>
<SearchInput clearable searchStr={searchStr} onSubmit={setSearchStr} actionIcon='search'/>
</Grid.Column>
@ -118,7 +118,7 @@ function Videos({filter}) {
onChange={(e, {value}) => setOrderBy(value)}
/>
</Grid.Column>
</>;
</Fragment>;
let header;
if (channel && channel.name) {
@ -287,13 +287,13 @@ export function VideosRoute(props) {
<PageContainer>
<TabLinks links={links}/>
<Routes>
<Route path='/' exact element={<Videos/>}/>
<Route path='favorites' exact element={<Videos filter='favorite' header='Favorite Videos'/>}/>
<Route path='/' exact element={<VideosPage/>}/>
<Route path='favorites' exact element={<VideosPage filter='favorite' header='Favorite Videos'/>}/>
<Route path='channel' exact element={<Channels/>}/>
<Route path='statistics' exact element={<Statistics/>}/>
<Route path='channel/new' exact element={<NewChannel/>}/>
<Route path='channel/:channelId/edit' exact element={<EditChannel/>}/>
<Route path='channel/:channelId/video' exact element={<Videos/>}/>
<Route path='channel/:channelId/video' exact element={<VideosPage/>}/>
</Routes>
</PageContainer>
)