refactor: move more header stuff to elements package

This commit is contained in:
Satyajit Sahoo
2021-02-04 15:07:22 +01:00
parent 07ba7a9687
commit 509ca49b64
22 changed files with 324 additions and 200 deletions

View File

@@ -1,3 +0,0 @@
import * as React from 'react';
export default React.createContext<number | undefined>(undefined);

View File

@@ -1,5 +0,0 @@
import * as React from 'react';
const HeaderShownContext = React.createContext(false);
export default HeaderShownContext;

View File

@@ -1,14 +0,0 @@
import * as React from 'react';
import HeaderHeightContext from './HeaderHeightContext';
export default function useFloatingHeaderHeight() {
const height = React.useContext(HeaderHeightContext);
if (height === undefined) {
throw new Error(
"Couldn't find the header height. Are you inside a screen in Stack?"
);
}
return height;
}