mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Front: Add Gradient behind navabar if transparent
This commit is contained in:
parent
d187c63704
commit
f9623089a2
@ -201,7 +201,7 @@ const App = ({ Component, pageProps }: AppProps) => {
|
||||
{...props}
|
||||
/>
|
||||
</ConnectionErrorVerifier>
|
||||
<Tooltip id="tooltip" positionStrategy={"fixed"} />
|
||||
<Tooltip id="tooltip" style={{ zIndex: 10 }} positionStrategy={"fixed"} />
|
||||
<SetupChecker />
|
||||
</SnackbarProvider>
|
||||
</PortalProvider>
|
||||
|
@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
import { Main } from "@kyoo/primitives";
|
||||
import { LinearGradient } from "expo-linear-gradient";
|
||||
import type { ReactElement } from "react";
|
||||
import { useYoshiki, vw } from "yoshiki/native";
|
||||
import { Navbar } from "./navbar";
|
||||
@ -30,8 +31,7 @@ export const DefaultLayout = ({
|
||||
page: ReactElement;
|
||||
transparent?: boolean;
|
||||
}) => {
|
||||
const { css } = useYoshiki();
|
||||
|
||||
const { css, theme } = useYoshiki();
|
||||
return (
|
||||
<>
|
||||
<Navbar
|
||||
@ -45,6 +45,22 @@ export const DefaultLayout = ({
|
||||
shadowOpacity: 0,
|
||||
},
|
||||
)}
|
||||
background={
|
||||
transparent ? (
|
||||
<LinearGradient
|
||||
start={{ x: 0, y: 0.25 }}
|
||||
end={{ x: 0, y: 1 }}
|
||||
colors={[theme.themeOverlay, "transparent"]}
|
||||
{...css({
|
||||
height: "100%",
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
})}
|
||||
/>
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
<Main
|
||||
{...css({
|
||||
|
@ -85,8 +85,8 @@ const SearchBar = forwardRef<TextInput, Stylable>(function SearchBar(props, ref)
|
||||
setQuery(q);
|
||||
}}
|
||||
placeholder={t("navbar.search")}
|
||||
placeholderTextColor={theme.colors.white}
|
||||
containerStyle={{ height: ts(4), flexShrink: 1, borderColor: (theme) => theme.colors.white }}
|
||||
placeholderTextColor={theme.contrast}
|
||||
containerStyle={{ height: ts(4), flexShrink: 1, borderColor: (theme) => theme.contrast }}
|
||||
{...tooltip(t("navbar.search"))}
|
||||
{...props}
|
||||
/>
|
||||
@ -177,9 +177,14 @@ export const NavbarRight = () => {
|
||||
export const Navbar = ({
|
||||
left,
|
||||
right,
|
||||
background,
|
||||
...props
|
||||
}: { left?: ReactElement | null; right?: ReactElement | null } & Stylable) => {
|
||||
const { css } = useYoshiki();
|
||||
}: {
|
||||
left?: ReactElement | null;
|
||||
right?: ReactElement | null;
|
||||
background?: ReactElement;
|
||||
} & Stylable) => {
|
||||
const { css, theme } = useYoshiki();
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
@ -205,6 +210,7 @@ export const Navbar = ({
|
||||
props,
|
||||
)}
|
||||
>
|
||||
{background}
|
||||
<View {...css({ flexDirection: "row", alignItems: "center", height: percent(100) })}>
|
||||
{left !== undefined ? (
|
||||
left
|
||||
|
Loading…
x
Reference in New Issue
Block a user