Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OE-685: Makes adjustments per VQA feedback #147

Merged
merged 5 commits into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/ui/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function Header(
return (
<HeaderWrapper bg={mainBgColor}>
{headerLeft ?? <DefaultHeaderLeft />}
<HStack ml="auto" spacing={1}>
<HStack ml="auto" spacing={0}>
<TableOfContent
containerRef={containerRef}
navigator={navigator}
Expand All @@ -81,16 +81,18 @@ export default function Header(
aria-expanded={isFullscreen}
aria-label="Toggle full screen"
border="none"
bgColor={mainBgColor}
gap={[0, 0, 2]}
onClick={toggleFullScreen}
leftIcon={
<Icon
as={isFullscreen ? ToggleFullScreenExit : ToggleFullScreen}
fill={iconFill}
w={6}
h={6}
/>
}
_active={{ bgColor: mainBgColor }}
_focus={{ bgColor: mainBgColor, ring: '2px', ringInset: 'inset' }}
>
<Icon
as={isFullscreen ? ToggleFullScreenExit : ToggleFullScreen}
fill={iconFill}
w={6}
h={6}
/>
<Text variant="headerNav">
{isFullscreen ? 'Full screen exit' : 'Full screen'}
</Text>
Expand All @@ -116,7 +118,7 @@ export const HeaderWrapper = React.forwardRef<
zIndex="sticky"
alignContent="space-between"
alignItems="center"
px={8}
px={[0, 0, 8]}
borderBottom="1px solid"
borderColor="gray.100"
{...rest}
Expand Down
15 changes: 11 additions & 4 deletions src/ui/HtmlSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { ButtonGroup, Heading, Stack, Text } from '@chakra-ui/react';
import { Box, ButtonGroup, Heading, Text } from '@chakra-ui/react';
import { HtmlNavigator, ReaderSettings, ReaderState } from '../types';
import Button from './Button';
import {
Expand Down Expand Up @@ -78,11 +78,17 @@ export default function HtmlSettings(
fontWeight="regular"
/>
</ToggleGroup>
<Stack bgColor={checkedButtonBgColor} px={7} py={5}>
<Box
bgColor={checkedButtonBgColor}
display="flex"
flexDirection="column"
px={[3, 3, 7]}
py={[4, 4, 5]}
>
<Heading
as="h3"
color={buttonTextColor}
pb="10px"
pb={[1.5, 1.5, 2.5]}
fontSize={2}
fontWeight="light"
>
Expand All @@ -93,10 +99,11 @@ export default function HtmlSettings(
fontFamily={FONT_DETAILS[fontFamily].token}
fontSize={-1}
fontWeight={FONT_DETAILS[fontFamily].fontWeight}
margin={0}
>
{FONT_DETAILS[fontFamily].body}
</Text>
</Stack>
</Box>
<ToggleGroup
value={colorMode}
label="reading theme options"
Expand Down
13 changes: 8 additions & 5 deletions src/ui/SettingsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default function SettingsCard(
>
<PopoverTrigger>
<Button
aria-label="Settings"
onClick={open}
/**
* preventDefault fixes a Chakra bug where in Safari,
Expand All @@ -64,18 +65,20 @@ export default function SettingsCard(
e.preventDefault()
}
border="none"
aria-label="Settings"
leftIcon={<Icon as={ReaderSettings} w={6} h={6} fill={iconFill} />}
gap={[0, 0, 2]}
>
<Icon as={ReaderSettings} fill={iconFill} w={6} h={6} />
<Text variant="headerNav">Settings</Text>
</Button>
</PopoverTrigger>
<PopoverContent
overflow="hidden"
bgColor={contentBgColor}
borderRadius="0 0 4px 4px"
boxShadow="0 4px 4px -2px #424242"
width="inherit"
borderColor="ui.gray.disabled"
borderRadius="0 0 2px 2px"
filter="drop-shadow(0 1px 2px #00000040)"
width={['90vw', '90vw', 'inherit']}
marginRight={[4, 4, 4, 0]}
maxWidth="100vw"
>
<PopoverBody p={0}>
Expand Down
3 changes: 2 additions & 1 deletion src/ui/ToggleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function ToggleButton(
}

export const FontToggleButton: typeof ToggleButton = (props) => {
return <ToggleButton fontSize={[-1, -1, 0]} py={6} {...props} />;
return <ToggleButton fontSize={[-2, -2, -1, -1, 0]} py={6} {...props} />;
};

export const ColorModeToggleButton: typeof ToggleButton = ({
Expand All @@ -77,6 +77,7 @@ export const ColorModeToggleButton: typeof ToggleButton = ({
bgColor,
p: {
textDecoration: 'underline',
textUnderlinePosition: 'under',
},
},
}}
Expand Down
13 changes: 11 additions & 2 deletions src/ui/theme/components/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ const variantSolid = (getColor: GetColor) => (
);
const color = getColor('gray.800', 'ui.white', 'gray.800');

const _focus = { bgColor: bgColorActive, color };
const _focus = {
bgColor: bgColorActive,
color,
ring: '2px',
ringInset: 'inset',
};
const _hover = {
bgColor: bgColorActive,
color,
Expand All @@ -58,7 +63,7 @@ const variantSolid = (getColor: GetColor) => (
return {
border: 'none',
borderColor: 'gray.100',
height: '48px',
height: '45px',
transition: 'none',
fontSize: 0,
letterSpacing: 1,
Expand Down Expand Up @@ -96,6 +101,9 @@ const variantSettings = (getColor: GetColor) => (
width: [8, 16, 36],
fontSize: [0, 0, 2],
whiteSpace: ['normal', 'normal', 'nowrap'],
p: {
textAlign: 'center',
},
_active: {
bgColor,
},
Expand All @@ -105,6 +113,7 @@ const variantSettings = (getColor: GetColor) => (
borderBottomColor: checkedBgColor,
p: {
textDecoration: 'underline',
textUnderlinePosition: 'under',
},
},
_hover: {
Expand Down