Skip to content

Commit 92d38b0

Browse files
authored
fix: size and position of touch indicator and checkbox (#282)
1 parent 7aabc38 commit 92d38b0

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/components/ExampleCheckbox.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const ExampleCheckbox: React.FC<
1010
}
1111
> = ({ id, showTouchIndicator, pseudoFocusColor }) => {
1212
const theme = useTheme()
13-
const checkboxSize = '1em'
13+
const checkboxSize = '15px'
1414

1515
return (
1616
<div aria-hidden="true" style={{ position: 'relative' }}>
@@ -25,14 +25,15 @@ export const ExampleCheckbox: React.FC<
2525
marginTop: '8px',
2626
marginBottom: '8px',
2727
marginRight: '12px',
28+
marginLeft: '4px',
2829
width: checkboxSize,
2930
height: checkboxSize,
3031
}}
3132
tabIndex={-1}
3233
type="checkbox"
3334
/>
3435
{/* Position the touch indicator to be centered over the checkbox */}
35-
{showTouchIndicator && <TouchIndicator style={{ left: '-9px', top: '-4px' }} />}
36+
{showTouchIndicator && <TouchIndicator style={{ left: '-8px', top: '-4px' }} />}
3637
{/* If we are showing the psuedo touch indicator, also show the pseudo-focus for the checkbox */}
3738
{showTouchIndicator && (
3839
<div

src/components/TouchIndicator.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export const TouchIndicator: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
1212

1313
const styles: React.CSSProperties = {
1414
position: 'absolute',
15-
height: '36px',
16-
width: '36px',
15+
height: '37px',
16+
width: '37px',
1717
background: `radial-gradient(circle, ${hover} 0%, ${selected} 100%)`,
1818
stroke: theme.palette.divider,
1919
filter: 'drop-shadow(0 2px 8px rgba(0, 0, 0, 0.12))',

src/views/oauth/experiments/PredirectInstructions.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ function PredirectInstructions(
127127
const isLastItem = index === checkboxItems.length - 1
128128

129129
return (
130-
<>
131-
<li key={item}>
130+
<React.Fragment key={item}>
131+
<li>
132132
<ExampleCheckbox
133133
id={item}
134134
pseudoFocusColor={institutionColor}
@@ -139,8 +139,8 @@ function PredirectInstructions(
139139
</Text>
140140
</li>
141141

142-
{!isLastItem && <Divider key={`divider-${index}`} />}
143-
</>
142+
{!isLastItem && <Divider />}
143+
</React.Fragment>
144144
)
145145
})}
146146
</ul>

0 commit comments

Comments
 (0)