diff --git a/client/components/file-dropdown/dropdown.module.css b/client/components/file-dropdown/dropdown.module.css index 30dde7f8..e113001d 100644 --- a/client/components/file-dropdown/dropdown.module.css +++ b/client/components/file-dropdown/dropdown.module.css @@ -23,7 +23,7 @@ transition: var(--transition); border-radius: var(--radius); margin: 0; - padding: 2px var(--gap); + padding: 0 0; } .content li:hover, @@ -32,9 +32,11 @@ } .content li a { - display: block; - height: 100%; - width: min-content; + display: flex; + align-items: center; + text-align: center; + padding: var(--gap-half) var(--gap); + color: var(--dark-gray); } .button { diff --git a/client/components/file-dropdown/index.tsx b/client/components/file-dropdown/index.tsx index ee361f40..2efbe92e 100644 --- a/client/components/file-dropdown/index.tsx +++ b/client/components/file-dropdown/index.tsx @@ -1,8 +1,8 @@ import { Button, Link, Text, Popover } from '@geist-ui/core' import FileIcon from '@geist-ui/icons/fileText' -import CodeIcon from '@geist-ui/icons/fileLambda' +import CodeIcon from '@geist-ui/icons/fileFunction' import styles from './dropdown.module.css' -import { useCallback, useEffect, useState } from "react" +import { useCallback, useEffect, useRef, useState } from "react" import { codeFileExtensions } from "@lib/constants" import ChevronDown from '@geist-ui/icons/chevronDown' import ShiftBy from "@components/shift-by" @@ -20,6 +20,16 @@ const FileDropdown = ({ }) => { const [expanded, setExpanded] = useState(false) const [items, setItems] = useState([]) + + const onOpen = useCallback(() => { + setExpanded(true) + }, []) + + const onClose = useCallback(() => { + setExpanded(false) + // contentRef.current?.focus() + }, []) + useEffect(() => { const newItems = files.map(file => { const extension = file.title.split('.').pop() @@ -40,24 +50,24 @@ const FileDropdown = ({ const content = useCallback(() => ( - ), [items]) + ), [items, onClose]) // a list of files with an icon and a title return ( - + ) } diff --git a/client/components/post-page/index.tsx b/client/components/post-page/index.tsx index 9f255043..36496b3e 100644 --- a/client/components/post-page/index.tsx +++ b/client/components/post-page/index.tsx @@ -54,7 +54,7 @@ const PostPage = ({ post }: Props) => { {/* {!isLoading && } */}
- {post.title} + {post.title}
{time} diff --git a/client/components/post-page/post-page.module.css b/client/components/post-page/post-page.module.css index 4a42e544..a5137bb9 100644 --- a/client/components/post-page/post-page.module.css +++ b/client/components/post-page/post-page.module.css @@ -11,9 +11,13 @@ align-items: center; } +.header .title h3 { + margin: 0; + padding: 0; +} + .header .title .badges > * { margin-left: var(--gap); - margin-bottom: var(--gap-quarter); } .header .buttons { @@ -42,6 +46,6 @@ display: flex; flex-direction: row; justify-content: space-between; - width: 80%; + width: 100%; } } diff --git a/client/components/scroll-to-top/index.tsx b/client/components/scroll-to-top/index.tsx index 3fd7c04b..cb7902a0 100644 --- a/client/components/scroll-to-top/index.tsx +++ b/client/components/scroll-to-top/index.tsx @@ -14,13 +14,15 @@ const ScrollToTop = () => { return () => window.removeEventListener('scroll', handleScroll) }, []) - const onClick = () => { + const onClick = (e: React.MouseEvent) => { + // blur the button + e.currentTarget.blur() window.scrollTo({ top: 0, behavior: 'smooth' }) } return (
- +