From 5c8387ac7e7b268a7257ad6671b5dc9eb34cc90b Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Fri, 6 Nov 2020 12:31:18 +0900 Subject: Wip --- src/App.js | 79 +++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 19 deletions(-) diff --git a/src/App.js b/src/App.js index b89a532..ef78070 100644 --- a/src/App.js +++ b/src/App.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import React, { useState } from "react"; import he from 'he'; import { useTranslation } from "react-i18next"; import { makeStyles, withStyles, createMuiTheme, ThemeProvider } from '@material-ui/core/styles'; @@ -42,6 +42,8 @@ import HelpOutlineIcon from '@material-ui/icons/HelpOutline'; import NavigateNextIcon from '@material-ui/icons/NavigateNext'; import NavigateBeforeIcon from '@material-ui/icons/NavigateBefore'; import Grow from '@material-ui/core/Grow'; +import Link from '@material-ui/core/Link'; +import Breadcrumbs from '@material-ui/core/Breadcrumbs'; import LazyLoad from 'react-lazyload'; import { CarouselProvider, Slider, Slide, ButtonBack, ButtonNext } from 'pure-react-carousel'; import useTimeout from 'use-timeout' @@ -54,7 +56,7 @@ import { Switch, Route, Redirect, - Link, + Link as RouteLink, useLocation } from "react-router-dom"; @@ -70,18 +72,49 @@ const StyledBadge = withStyles((theme) => ({ function StoreItemDetails(props) { const { t } = useTranslation(); + const { height, width } = useWindowDimensions(); + const cols = Math.floor(width / 240); const classes = makeStyles((theme) => ({ + root: { paddingLeft: cols > 1 ? 18 : 4, paddingRight: cols > 1 ? 18 : 4 }, + controls: { position: 'relative', width: '100%', maxWidth: 640, margin: (cols > 1 ? 20 : 0) }, + prev: { position: 'absolute', left: cols > 1 ? -15 : -4, top: '50%', backgroundColor: 'rgba(0, 0, 0, 0.5)', color: 'white' }, + next: { position: 'absolute', right: cols > 1 ? -15 : -4, top: '50%', backgroundColor: 'rgba(0, 0, 0, 0.5)', color: 'white' }, + img: { width: '100%', height: (height > 1024 ? 480 : 240), objectFit: 'contain' } }))(); return ( - <> - - {props.data.title} - - - {props.data.desc} - - +
+ + {t('Store')} + author + id + + + +
+ + + + + + + + + + + + +
+
+
); } @@ -127,7 +160,7 @@ function StoreItem(props) { }> - + @@ -406,9 +439,9 @@ function BottomBar(props) { }))(); return ( - } component={Link} to='/store'/> - } component={Link} to='/library'/> - } component={Link} to='/account'/> + } component={RouteLink} to='/store'/> + } component={RouteLink} to='/library'/> + } component={RouteLink} to='/account'/> ); } @@ -417,10 +450,17 @@ function TopBar(props) { const { t } = useTranslation(); const classes = makeStyles((theme) => ({ title: { flexGrow: 1 }, + backButton: { marginRight: theme.spacing(1) }, }))(); + const search = (props.components[1] !== 'account'); return ( + 2} unmountOnExit> + window.history.back()}> + + + {t('DoujinSea')} @@ -433,12 +473,14 @@ function TopBar(props) { - + ); } function Routing() { + var location = useLocation(); + const components = location.pathname.split('/'); const classes = makeStyles((theme) => ({ content: { paddingTop: 105, @@ -446,20 +488,19 @@ function Routing() { minHeight: '100vh', }, }))(); - var location = useLocation(); - const path = location.pathname.split('/')[1]; return ( <> - + + - + ); } -- cgit v1.2.3