[fix] page options dialog (#302)

* fix rename pages

* Update sponsors.ts
This commit is contained in:
Steve Ruiz 2021-11-19 13:20:23 +00:00 committed by GitHub
parent cd48b67a74
commit 67a7935cfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -51,7 +51,7 @@ export default async function GetSponsors(req: NextApiRequest, res: NextApiRespo
const results = (
sponsorInfo.data.viewer.sponsorshipsAsMaintainer.edges as QueryResult[]
).map<SponsorResult>((edge) => ({
url: edge.node.sponsorEntity.avatarUrl?.replaceAll('&', '&amp;') ?? '',
url: edge.node.sponsorEntity.avatarUrl?.replace(/&/g, '&amp;') ?? '',
login: edge.node.sponsorEntity.login,
}))

View file

@ -9,6 +9,7 @@ import { DMContent, DMDivider } from '~components/Primitives/DropdownMenu'
import { SmallIcon } from '~components/Primitives/SmallIcon'
import { RowButton } from '~components/Primitives/RowButton'
import { ToolButton } from '~components/Primitives/ToolButton'
import { preventEvent } from '~components/preventEvent'
const sortedSelector = (s: TDSnapshot) =>
Object.values(s.document.pages).sort((a, b) => (a.childIndex || 0) - (b.childIndex || 0))

View file

@ -9,6 +9,7 @@ import { Divider } from '~components/Primitives/Divider'
import { IconButton } from '~components/Primitives/IconButton/IconButton'
import { SmallIcon } from '~components/Primitives/SmallIcon'
import { breakpoints } from '~components/breakpoints'
import { preventEvent } from '~components/preventEvent'
const canDeleteSelector = (s: TDSnapshot) => {
return Object.keys(s.document.pages).length > 1
@ -134,9 +135,12 @@ export const StyledDialogOverlay = styled(Dialog.Overlay, {
height: '100%',
})
function DialogAction({ ...rest }: RowButtonProps & { onSelect: (e: Event) => void }) {
function DialogAction({
onSelect,
...rest
}: RowButtonProps & { onSelect: (e: React.SyntheticEvent<HTMLButtonElement, Event>) => void }) {
return (
<Dialog.Action asChild>
<Dialog.Action asChild onClick={onSelect} onSelect={onSelect}>
<RowButton {...rest} />
</Dialog.Action>
)