Skip to content

Commit b32b712

Browse files
Change shortcut th bg-color on hover. Decrease scroll throttle time
1 parent cf571d0 commit b32b712

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

web/components/ShortcutTable.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ import React, { useState } from 'react'
22
import TableRows from './TableRows'
33
import styled from 'styled-components'
44
import sortAlpha from '../utils/sorting'
5-
// import sortDown from '../src/icons/sort-down.svg'
6-
// import sortUp from '../src/icons/sort-up.svg'
7-
// import refresh from '../src/icons/refresh.svg'
85

96
const ShortcutNameTh = styled.th`
107
&:hover {
118
cursor: pointer;
9+
background-color: rgb(230, 255, 255);
1210
}
1311
`
1412
const SortTextSpan = styled.span`

web/src/pages/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Footer from '../../components/Footer'
77
import ToC from '../../components/TableOfContents'
88
import NavMenu from '../../components/NavMenu'
99
import TopicSection from '../../components/TopicSection'
10-
// import { styles } from 'prism-react-renderer/themes/oceanicNext'
1110

1211
const SecondaryNavBar = styled.nav`
1312
display: flex;
@@ -41,12 +40,11 @@ export default function Index({ data }) {
4140
const [activeSection, setActiveSection] = useState(null)
4241

4342
useEffect(() => {
44-
window.addEventListener('scroll', throttle(handleScroll, 500))
45-
window.addEventListener('scroll', throttle(handleObserver, 500))
43+
window.addEventListener('scroll', throttle(handleScroll, 300))
44+
window.addEventListener('scroll', throttle(handleObserver, 300))
4645
return () => {
47-
window.removeEventListener('scroll', throttle(handleScroll, 500))
48-
// TODO: this should be here, right?
49-
window.addEventListener('scroll', throttle(handleObserver, 500))
46+
window.removeEventListener('scroll', throttle(handleScroll, 300))
47+
window.addEventListener('scroll', throttle(handleObserver, 300))
5048
}
5149
}, [data])
5250

0 commit comments

Comments
 (0)