From 958cdf98fd1cb7c1bdb33aebb6c061750e9ab331 Mon Sep 17 00:00:00 2001 From: sct Date: Mon, 22 Mar 2021 01:22:24 +0900 Subject: [PATCH] feat(ui): experimental status bar style change for ios pwa app this might break things. just an experiment. :) --- .vscode/settings.json | 3 +- src/components/Common/ImageFader/index.tsx | 8 ++--- src/components/Common/Modal/index.tsx | 13 +++++--- src/components/Common/SlideOver/index.tsx | 6 ++-- src/components/Layout/Sidebar/index.tsx | 12 +++---- src/components/Layout/index.tsx | 14 ++++---- src/components/Login/index.tsx | 16 +++++----- src/components/PersonDetails/index.tsx | 18 +++++------ src/pages/_app.tsx | 30 +++++++++--------- src/pages/_document.tsx | 13 +++++--- src/styles/globals.css | 37 +++++++++++++++++++++- 11 files changed, 107 insertions(+), 63 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ed238007f..26aca34b8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,5 +17,6 @@ ], "editor.codeActionsOnSave": { "source.organizeImports": true - } + }, + "editor.formatOnSave": true } diff --git a/src/components/Common/ImageFader/index.tsx b/src/components/Common/ImageFader/index.tsx index eed8475fa..be656d89d 100644 --- a/src/components/Common/ImageFader/index.tsx +++ b/src/components/Common/ImageFader/index.tsx @@ -1,8 +1,8 @@ import React, { - useState, - useEffect, - HTMLAttributes, ForwardRefRenderFunction, + HTMLAttributes, + useEffect, + useState, } from 'react'; import CachedImage from '../CachedImage'; @@ -59,7 +59,7 @@ const ImageFader: ForwardRefRenderFunction = ( {backgroundImages.map((imageUrl, i) => (
= ({ show={!loading} >
{iconSvg && ( diff --git a/src/components/Common/SlideOver/index.tsx b/src/components/Common/SlideOver/index.tsx index 43c47cc82..79a9a0bb7 100644 --- a/src/components/Common/SlideOver/index.tsx +++ b/src/components/Common/SlideOver/index.tsx @@ -1,8 +1,8 @@ /* eslint-disable jsx-a11y/click-events-have-key-events */ -import React, { useState, useEffect, useRef } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import ReactDOM from 'react-dom'; -import Transition from '../../Transition'; import { useLockBodyScroll } from '../../../hooks/useLockBodyScroll'; +import Transition from '../../Transition'; interface SlideOverProps { show?: boolean; @@ -70,7 +70,7 @@ const SlideOver: React.FC = ({ onClick={(e) => e.stopPropagation()} >
-
+

{title} diff --git a/src/components/Layout/Sidebar/index.tsx b/src/components/Layout/Sidebar/index.tsx index 362310583..de57d9d60 100644 --- a/src/components/Layout/Sidebar/index.tsx +++ b/src/components/Layout/Sidebar/index.tsx @@ -1,10 +1,10 @@ -import React, { ReactNode, useRef } from 'react'; -import Transition from '../../Transition'; import Link from 'next/link'; import { useRouter } from 'next/router'; +import React, { ReactNode, useRef } from 'react'; import { defineMessages, useIntl } from 'react-intl'; -import { useUser, Permission } from '../../../hooks/useUser'; import useClickOutside from '../../../hooks/useClickOutside'; +import { Permission, useUser } from '../../../hooks/useUser'; +import Transition from '../../Transition'; const messages = defineMessages({ dashboard: 'Discover', @@ -148,8 +148,8 @@ const Sidebar: React.FC = ({ open, setClosed }) => { leaveTo="-translate-x-full" > <> -
-
+
+
-
+
diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index 5cbe11a30..330f7b3a6 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -1,11 +1,11 @@ -import React, { useEffect, useState } from 'react'; -import SearchInput from './SearchInput'; -import UserDropdown from './UserDropdown'; -import Sidebar from './Sidebar'; -import LanguagePicker from './LanguagePicker'; import { useRouter } from 'next/router'; +import React, { useEffect, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { Permission, useUser } from '../../hooks/useUser'; +import LanguagePicker from './LanguagePicker'; +import SearchInput from './SearchInput'; +import Sidebar from './Sidebar'; +import UserDropdown from './UserDropdown'; const messages = defineMessages({ alphawarning: @@ -37,14 +37,14 @@ const Layout: React.FC = ({ children }) => { return (
-
+
setSidebarOpen(false)} />
{ <> {(sortedCrew || sortedCast) && ( -
+
=> { @@ -122,8 +122,8 @@ const CoreApp: Omit = ({ Overseerr + content="initial-scale=1, viewport-fit=cover, width=device-width" + > {component} diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index f11144c99..308cec40a 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -1,12 +1,12 @@ -import React from 'react'; import Document, { - Html, + DocumentContext, + DocumentInitialProps, Head, + Html, Main, NextScript, - DocumentContext, - DocumentInitialProps, } from 'next/document'; +import React from 'react'; class MyDocument extends Document { static async getInitialProps( @@ -39,6 +39,11 @@ class MyDocument extends Document { sizes="16x16" href="/favicon-16x16.png" /> + + diff --git a/src/styles/globals.css b/src/styles/globals.css index 18277e9a2..4e72d0c41 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -3,10 +3,43 @@ @tailwind utilities; @tailwind screens; +html { + min-height: calc(100% + env(safe-area-inset-top)); + padding: env(safe-area-inset-top) env(safe-area-inset-right) + env(safe-area-inset-bottom) env(safe-area-inset-left); +} + body { @apply bg-gray-900; } +.searchbar { + padding-top: env(safe-area-inset-top); + height: calc(4rem + env(safe-area-inset-top)); +} + +.sidebar { + padding-top: env(safe-area-inset-top); + padding-left: env(safe-area-inset-left); +} + +.slideover { + padding-top: calc(1.5rem + env(safe-area-inset-top)); + padding-bottom: 1.5rem; +} + +.sidebar-close-button { + top: env(safe-area-inset-top); +} + +.absolute-top-shift { + top: calc(-4rem - env(safe-area-inset-top)); +} + +.min-h-screen-shift { + min-height: calc(100vh + env(safe-area-inset-top)); +} + .plex-button { @apply flex justify-center w-full px-4 py-2 text-sm font-medium text-center text-white transition duration-150 ease-in-out bg-indigo-600 border border-transparent rounded-md disabled:opacity-50; background-color: #cc7b19; @@ -42,7 +75,9 @@ a.slider-title { } .media-page { - @apply relative px-4 pt-16 -mx-4 -mt-16 bg-center bg-cover; + @apply relative px-4 -mx-4 bg-center bg-cover; + margin-top: calc(-4rem - env(safe-area-inset-top)); + padding-top: calc(4rem + env(safe-area-inset-top)); } .media-page-bg-image {