Fixes places inreader where navbar width was not considered (#908)
* Fixes two places where navbar was not considered When set to static, the navbar consumes space, so `vw` units are not enough. On small screens, the `left`+`transform` approach does not work nicely, so just use standard flex alignment, the container is already a flexbox. * Change card also consider wide viewports * Update src/modules/reader/components/viewer/ReaderTransitionPage.tsx Co-authored-by: schroda <50052685+schroda@users.noreply.github.com> * Reader: Apply new alignment code also to horizontal scroll mode --------- Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
This commit is contained in:
@@ -72,13 +72,7 @@ export const getImagePlaceholderStyling = (
|
||||
): CSSObject => {
|
||||
const OVER_9000 = 9000;
|
||||
|
||||
const getMaxWidth = (width: string) => {
|
||||
if (width === '100vw') {
|
||||
return `calc(${width} - ${widthOffset}px)`;
|
||||
}
|
||||
|
||||
return width;
|
||||
};
|
||||
const getMaxWidth = (width: string) => `calc(${width} - ${widthOffset}px)`;
|
||||
const getDesktopWidth = (width: number, readerWidthValue?: number) =>
|
||||
getMaxWidth(`${coerceIn(readerWidthValue ?? width, Math.min(width, readerWidthValue ?? OVER_9000), width)}vw`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user