double qutes eslint rule

This commit is contained in:
tmshv committed 2022-09-06 14:52:56 +03:00
1 parent 2e517cc7f7
commit 85bc8c4af5
57 files changed
+370 -366

No files matched your search

+19 -19
View File
@@ -1,18 +1,18 @@
import dynamic from 'next/dynamic'
import { Wrapper } from '../Wrapper'
import { ConfigContext } from 'src/context/ConfigContext'
import config from 'src/config'
import { Footer } from '../Footer'
import { Content } from '../Content'
import { Block } from '../Block'
import { Breadcrumbs } from '../Breadcrumbs'
import { IBreadcumbsPart, IMenu } from 'src/types'
import { useRouter } from 'next/router'
import { useMobile } from 'src/hooks/useMobile'
import { Gosuslugi } from '../Gosuslugi'
import { INavigationProps } from '@/components/Navigation'
import dynamic from "next/dynamic"
import { Wrapper } from "../Wrapper"
import { ConfigContext } from "src/context/ConfigContext"
import config from "src/config"
import { Footer } from "../Footer"
import { Content } from "../Content"
import { Block } from "../Block"
import { Breadcrumbs } from "../Breadcrumbs"
import { IBreadcumbsPart, IMenu } from "src/types"
import { useRouter } from "next/router"
import { useMobile } from "src/hooks/useMobile"
import { Gosuslugi } from "../Gosuslugi"
import { INavigationProps } from "@/components/Navigation"
const Navigation = dynamic<INavigationProps>(() => import('../Navigation').then(mod => mod.Navigation), {
const Navigation = dynamic<INavigationProps>(() => import("../Navigation").then(mod => mod.Navigation), {
ssr: false,
})
@@ -27,7 +27,7 @@ export const App: React.FC<IAppProps> = ({ showAuthor = false, menu, ...props })
const hideBreadcrumbs = useMobile()
const router = useRouter()
const blockStyle = {
justifyContent: 'center',
justifyContent: "center",
}
return (
@@ -39,10 +39,10 @@ export const App: React.FC<IAppProps> = ({ showAuthor = false, menu, ...props })
header={(
<header>
<Navigation style={{
margin: '0 var(--size-m) var(--size-m)',
margin: "0 var(--size-m) var(--size-m)",
}} />
{hideBreadcrumbs || !props.breadcrumbs ? null : (
<Block direction={'horizontal'} style={blockStyle}>
<Block direction={"horizontal"} style={blockStyle}>
<Content>
<Breadcrumbs
items={props.breadcrumbs}
@@ -58,7 +58,7 @@ export const App: React.FC<IAppProps> = ({ showAuthor = false, menu, ...props })
showAuthor={showAuthor}
>
<div style={{
backgroundColor: 'white',
backgroundColor: "white",
padding: 10,
borderRadius: 10,
marginBottom: 30,
@@ -68,7 +68,7 @@ export const App: React.FC<IAppProps> = ({ showAuthor = false, menu, ...props })
</Footer>
)}
>
<Block direction={'horizontal'} style={blockStyle}>
<Block direction={"horizontal"} style={blockStyle}>
<Content style={props.contentStyle}>
{props.children}
</Content>
+6 -6
View File
@@ -1,16 +1,16 @@
import s from './styles.module.css'
import s from "./styles.module.css"
import cx from 'classnames'
import { createElement } from 'react'
import cx from "classnames"
import { createElement } from "react"
export type BlockProps = {
as?: keyof HTMLElementTagNameMap
style?: React.CSSProperties
direction: 'horizontal' | 'vertical'
direction: "horizontal" | "vertical"
}
export const Block: React.FC<BlockProps> = ({ as = 'div', style, direction, ...props }) => {
const directionClass = direction === 'horizontal'
export const Block: React.FC<BlockProps> = ({ as = "div", style, direction, ...props }) => {
const directionClass = direction === "horizontal"
? s.horizontal
: s.vertical
const newProps = {
+9 -9
View File
@@ -1,8 +1,8 @@
import s from './styles.module.css'
import s from "./styles.module.css"
import { IBreadcumbsPart } from 'src/types'
import { Button } from '../Button'
import { insertBetween } from 'src/lib/array'
import { IBreadcumbsPart } from "src/types"
import { Button } from "../Button"
import { insertBetween } from "src/lib/array"
export type BreadcrumbsProps = {
style?: React.CSSProperties
@@ -11,15 +11,15 @@ export type BreadcrumbsProps = {
}
export const Breadcrumbs: React.FC<BreadcrumbsProps> = props => {
const items = insertBetween(props.items, () => '/')
const items = insertBetween(props.items, () => "/")
return (
<nav className={s.breadcrumbs} style={props.style}>
{items.map((x, i) => {
if (typeof x === 'string') {
if (typeof x === "string") {
return (
<li key={i}>
<span style={{ margin: '0 var(--size-xs)' }}>{x}</span>
<span style={{ margin: "0 var(--size-xs)" }}>{x}</span>
</li>
)
}
@@ -28,8 +28,8 @@ export const Breadcrumbs: React.FC<BreadcrumbsProps> = props => {
<li key={x.href}>
<Button
href={x.href}
theme={'ghost'}
size={'small'}
theme={"ghost"}
size={"small"}
disabled={x.href === props.path}
>
{x.name}
+8 -8
View File
@@ -1,8 +1,8 @@
import s from './styles.module.css'
import s from "./styles.module.css"
import Link from 'next/link'
import cx from 'classnames'
import { useCallback } from 'react'
import Link from "next/link"
import cx from "classnames"
import { useCallback } from "react"
const sizeClass = {
default: s.sizeDefault,
@@ -10,7 +10,7 @@ const sizeClass = {
}
const themeClass = {
default: '',
default: "",
icon: s.themeIcon,
ghost: s.themeGhost,
}
@@ -19,13 +19,13 @@ export type ButtonProps = {
value?: any
style?: React.CSSProperties
href?: string
theme?: 'default' | 'ghost' | 'icon'
size?: 'default' | 'small'
theme?: "default" | "ghost" | "icon"
size?: "default" | "small"
disabled?: boolean
onClick?: (value: any, event: MouseEvent) => void
}
export const Button: React.FC<ButtonProps> = ({ size = 'default', theme = 'default', disabled = false, ...props }) => {
export const Button: React.FC<ButtonProps> = ({ size = "default", theme = "default", disabled = false, ...props }) => {
const className = cx(s.button, sizeClass[size], themeClass[theme], {
[s.disabled]: disabled,
})
+4 -4
View File
@@ -1,14 +1,14 @@
import s from './styles.module.css'
import s from "./styles.module.css"
import cx from 'classnames'
import Link from 'next/link'
import cx from "classnames"
import Link from "next/link"
const layoutClass = {
simple: s.simple,
featured: s.featured,
}
export type CardLayout = 'simple' | 'featured'
export type CardLayout = "simple" | "featured"
export type CardProps = {
style?: React.CSSProperties
href: string
+1 -1
View File
@@ -1,4 +1,4 @@
import s from './styles.module.css'
import s from "./styles.module.css"
export type CardGridProps = {
style?: React.CSSProperties
+4 -4
View File
@@ -1,8 +1,8 @@
import s from './contacts.module.css'
import s from "./contacts.module.css"
import { useContext } from 'react'
import { ConfigContext } from 'src/context/ConfigContext'
import Link from 'next/link'
import { useContext } from "react"
import { ConfigContext } from "src/context/ConfigContext"
import Link from "next/link"
export const Contacts: React.FC = props => {
const { contacts } = useContext(ConfigContext)
+4 -4
View File
@@ -1,5 +1,5 @@
import cx from 'classnames'
import { useReducedMotion } from 'src/hooks/useReducedMotion'
import cx from "classnames"
import { useReducedMotion } from "src/hooks/useReducedMotion"
export type ContentProps = {
style?: React.CSSProperties
@@ -10,8 +10,8 @@ export const Content: React.FC<ContentProps> = props => {
return (
<div
className={cx('content', {
'reduced-motion': motionDisabled,
className={cx("content", {
"reduced-motion": motionDisabled,
})}
style={props.style}
>
+2 -2
View File
@@ -1,5 +1,5 @@
import { useContext } from 'react'
import { ConfigContext } from 'src/context/ConfigContext'
import { useContext } from "react"
import { ConfigContext } from "src/context/ConfigContext"
export const Copyright: React.FC = () => {
const { yearStart, yearEnd } = useContext(ConfigContext)
+6 -6
View File
@@ -1,9 +1,9 @@
import 'rc-tooltip/assets/bootstrap_white.css'
import s from './signature.module.css'
import "rc-tooltip/assets/bootstrap_white.css"
import s from "./signature.module.css"
import { Sign } from '@/types'
import { FiShield } from 'react-icons/fi'
import Tooltip from 'rc-tooltip'
import { Sign } from "@/types"
import { FiShield } from "react-icons/fi"
import Tooltip from "rc-tooltip"
export type SignatureProps = Sign
export const Signature: React.FC<SignatureProps> = props => {
@@ -17,7 +17,7 @@ export const Signature: React.FC<SignatureProps> = props => {
)
return (
<Tooltip overlayClassName={'hudozka'} placement="left" trigger={['hover', 'click']} overlay={content}>
<Tooltip overlayClassName={"hudozka"} placement="left" trigger={["hover", "click"]} overlay={content}>
<FiShield className={s.secure} size={20} />
</Tooltip>
)
+9 -9
View File
@@ -1,11 +1,11 @@
import s from './filecard.module.css'
import s from "./filecard.module.css"
import Image from 'next/image'
import { FileTokenData, Sign } from '@/types'
import { size, ext } from '@/lib/file'
import { getResizedUrl } from '@/lib/image'
import { Signature } from './Signature'
import Link from 'next/link'
import Image from "next/image"
import { FileTokenData, Sign } from "@/types"
import { size, ext } from "@/lib/file"
import { getResizedUrl } from "@/lib/image"
import { Signature } from "./Signature"
import Link from "next/link"
export type FileCardProps = FileTokenData & {
sign?: Sign
@@ -29,10 +29,10 @@ export const FileCard: React.FC<FileCardProps> = props => {
})
}}
src={props.image_url}
alt={''}
alt={""}
width={100}
height={100}
objectFit={'contain'}
objectFit={"contain"}
/>
</div>
</a>
+4 -4
View File
@@ -1,8 +1,8 @@
import s from './styles.module.css'
import s from "./styles.module.css"
import { FileDefinition } from 'src/types'
import { ext, size } from 'src/lib/file'
import Link from 'next/link'
import { FileDefinition } from "src/types"
import { ext, size } from "src/lib/file"
import Link from "next/link"
export type FileProps = FileDefinition & {
style?: React.CSSProperties
+12 -12
View File
@@ -1,32 +1,32 @@
import s from './footer.module.css'
import s from "./footer.module.css"
import cx from 'classnames'
import { Copyright } from '../Copyright'
import { Author } from './Author'
import { Block } from '../Block'
import { Spacer } from '../Spacer'
import { Contacts } from '../Contacts'
import cx from "classnames"
import { Copyright } from "../Copyright"
import { Author } from "./Author"
import { Block } from "../Block"
import { Spacer } from "../Spacer"
import { Contacts } from "../Contacts"
export interface IFooterProps {
showAuthor: boolean
}
export const Footer: React.FC<IFooterProps> = props => (
<footer className={cx(s.footer, 'opposite')}>
<Block direction={'vertical'} style={{
marginBottom: 'var(--size-l)',
<footer className={cx(s.footer, "opposite")}>
<Block direction={"vertical"} style={{
marginBottom: "var(--size-l)",
}}>
<Contacts />
</Block>
{props.children}
<Block direction={'horizontal'}>
<Block direction={"horizontal"}>
<Copyright />
{!props.showAuthor ? null : (
<>
<Spacer as={'span'} />
<Spacer as={"span"} />
<Author />
</>
)}
+1 -1
View File
@@ -1,4 +1,4 @@
import React from 'react'
import React from "react"
function script(account) {
return `
+3 -3
View File
@@ -1,11 +1,11 @@
import { useEffect } from 'react'
import { getCode } from './lib'
import { useEffect } from "react"
import { getCode } from "./lib"
export type GosuslugiProps = {}
export const Gosuslugi: React.FC<GosuslugiProps> = () => {
useEffect(() => {
window.dispatchEvent(new Event('resize'))
window.dispatchEvent(new Event("resize"))
})
return (
+2 -2
View File
@@ -1,4 +1,4 @@
import { createElement } from 'react'
import { createElement } from "react"
export type HtmlProps = {
className?: string
@@ -6,7 +6,7 @@ export type HtmlProps = {
html: string
}
export const Html: React.FC<HtmlProps> = ({ as = 'div', ...props }) => {
export const Html: React.FC<HtmlProps> = ({ as = "div", ...props }) => {
return createElement(as, {
className: props.className,
dangerouslySetInnerHTML: {
+3 -3
View File
@@ -1,6 +1,6 @@
import s from './title.module.css'
import s from "./title.module.css"
import { memo } from 'react'
import { memo } from "react"
export type HudozkaTitleProps = {
style?: React.CSSProperties
@@ -14,4 +14,4 @@ export const HudozkaTitle: React.FC<HudozkaTitleProps> = memo(props => (
</h1>
))
HudozkaTitle.displayName = 'HudozkaTitle'
HudozkaTitle.displayName = "HudozkaTitle"
+1 -1
View File
@@ -1,4 +1,4 @@
import Link from 'next/link'
import Link from "next/link"
export interface ActiveLinkProps {
href?: string
+7 -7
View File
@@ -1,15 +1,15 @@
import s from './styles.module.css'
import cx from 'classnames'
import { useRouter } from 'next/router'
import { ActiveLink } from './ActiveLink'
import { isPartOfPath } from 'src/lib/url'
import s from "./styles.module.css"
import cx from "classnames"
import { useRouter } from "next/router"
import { ActiveLink } from "./ActiveLink"
import { isPartOfPath } from "src/lib/url"
export type MenuItemProps = {
href: string
}
export const MenuItem: React.FC<MenuItemProps> = props => {
const ignore = ['/']
const ignore = ["/"]
const router = useRouter()
const current = router.asPath === props.href
const selected = current || (!ignore.includes(props.href) && isPartOfPath(props.href, router.asPath))
@@ -24,7 +24,7 @@ export const MenuItem: React.FC<MenuItemProps> = props => {
<ActiveLink
href={href}
activeStyle={{
fontWeight: 'bold',
fontWeight: "bold",
}}
>
{props.children}
+5 -5
View File
@@ -1,8 +1,8 @@
import s from './styles.module.css'
import s from "./styles.module.css"
import cx from 'classnames'
import { MenuItem } from './MenuItem'
import { IMenu } from 'src/types'
import cx from "classnames"
import { MenuItem } from "./MenuItem"
import { IMenu } from "src/types"
const layoutClass = {
desktop: s.desktop,
@@ -10,7 +10,7 @@ const layoutClass = {
}
export type MenuProps = {
layout: 'desktop' | 'mobile'
layout: "desktop" | "mobile"
items: IMenu[]
}
+4 -4
View File
@@ -1,7 +1,7 @@
import s from './styles.module.css'
import s from "./styles.module.css"
import cx from 'classnames'
import { Button } from '../Button'
import cx from "classnames"
import { Button } from "../Button"
export interface IMenuToggleProps {
style?: React.CSSProperties
@@ -14,7 +14,7 @@ export const MenuToggle: React.FC<IMenuToggleProps> = props => {
<Button
onClick={props.onClick}
style={props.style}
theme={'icon'}
theme={"icon"}
>
<div
className={cx(s.toggle, {
+1 -1
View File
@@ -1,4 +1,4 @@
import { IMeta } from 'src/types'
import { IMeta } from "src/types"
export type MetaProps = {
meta: IMeta
+17 -17
View File
@@ -1,11 +1,11 @@
import { MenuToggle } from '../MenuToggle'
import { useMobile } from 'src/hooks/useMobile'
import { Menu } from '../Menu'
import { Overlay } from '../Overlay'
import { useState, useCallback, useContext } from 'react'
import { ConfigContext } from 'src/context/ConfigContext'
import { Block } from '../Block'
import { Spacer } from '../Spacer'
import { MenuToggle } from "../MenuToggle"
import { useMobile } from "src/hooks/useMobile"
import { Menu } from "../Menu"
import { Overlay } from "../Overlay"
import { useState, useCallback, useContext } from "react"
import { ConfigContext } from "src/context/ConfigContext"
import { Block } from "../Block"
import { Spacer } from "../Spacer"
export interface INavigationProps {
style?: React.CSSProperties
@@ -28,24 +28,24 @@ export const Navigation: React.FC<INavigationProps> = props => {
show={open}
onClickOverlay={onClick}
>
<Block direction={'horizontal'}>
<Block direction={"horizontal"}>
<Spacer />
<MenuToggle
open={open}
onClick={onClick}
style={{
margin: 'var(--size-xs)',
margin: "var(--size-xs)",
}}
/>
</Block>
<Block direction={'horizontal'} style={{
justifyContent: 'center',
<Block direction={"horizontal"} style={{
justifyContent: "center",
}}>
<nav style={{
width: '75%',
width: "75%",
}}>
<Menu
layout={'mobile'}
layout={"mobile"}
items={menu}
/>
</nav>
@@ -53,20 +53,20 @@ export const Navigation: React.FC<INavigationProps> = props => {
</Overlay>
{collapseMenu ? (
<Block direction={'horizontal'}>
<Block direction={"horizontal"}>
<Spacer />
<MenuToggle
open={open}
onClick={onClick}
style={{
margin: 'var(--size-xs)',
margin: "var(--size-xs)",
}}
/>
</Block>
) : (
<nav style={props.style}>
<Menu
layout={'desktop'}
layout={"desktop"}
items={menu}
/>
</nav>
+3 -3
View File
@@ -1,6 +1,6 @@
import s from './error.module.css'
import s from "./error.module.css"
import Link from 'next/link'
import Link from "next/link"
export const NotFound: React.FC = () => (
<section className={s.section}>
@@ -10,7 +10,7 @@ export const NotFound: React.FC = () => (
</div>
<div>
<Link href={'/'}>
<Link href={"/"}>
<a>На главную</a>
</Link>
</div>
+1 -1
View File
@@ -1,4 +1,4 @@
import * as React from 'react'
import * as React from "react"
export interface ITransitionProps {
duration: number
+6 -6
View File
@@ -1,8 +1,8 @@
import s from './styles.module.css'
import s from "./styles.module.css"
import { Transition } from './Transition'
import { useReducedMotion } from '../../hooks/useReducedMotion'
import { useCallback, useEffect } from 'react'
import { Transition } from "./Transition"
import { useReducedMotion } from "../../hooks/useReducedMotion"
import { useCallback, useEffect } from "react"
export interface IOverlayProps {
show: boolean
@@ -21,9 +21,9 @@ export const Overlay: React.FC<IOverlayProps> = props => {
useEffect(() => {
if (props.show) {
document.body.classList.add('noscroll')
document.body.classList.add("noscroll")
} else {
document.body.classList.remove('noscroll')
document.body.classList.remove("noscroll")
}
}, [props.show])
+4 -4
View File
@@ -1,7 +1,7 @@
import s from './styles.module.css'
import s from "./styles.module.css"
import { PageMeta } from '../PageMeta'
import { ITag } from 'src/types'
import { PageMeta } from "../PageMeta"
import { ITag } from "src/types"
export type PageProps = {
style?: React.CSSProperties
@@ -15,7 +15,7 @@ export const Page: React.FC<PageProps> = props => (
<PageMeta
style={{
marginTop: 'var(--size-m)',
marginTop: "var(--size-m)",
}}
date={props.date}
tags={props.tags}
+2 -2
View File
@@ -1,6 +1,6 @@
import s from './date.module.css'
import s from "./date.module.css"
import { dateFormat } from 'src/lib/date'
import { dateFormat } from "src/lib/date"
export type DateProps = {
style?: React.CSSProperties
+15 -15
View File
@@ -1,10 +1,10 @@
import Image from 'next/image'
import { PageCardDto } from '@/types'
import { CardGrid } from '../CardGrid'
import { Card, CardLayout } from '../Card'
import { Date } from './Date'
import { Block } from '../Block'
import { Spacer } from '../Spacer'
import Image from "next/image"
import { PageCardDto } from "@/types"
import { CardGrid } from "../CardGrid"
import { Card, CardLayout } from "../Card"
import { Date } from "./Date"
import { Block } from "../Block"
import { Spacer } from "../Spacer"
export type PageGridProps = {
items: PageCardDto[]
@@ -14,23 +14,23 @@ export const PageGrid: React.FC<PageGridProps> = props => {
return (
<CardGrid
style={{
marginBottom: 'var(--size-xl)',
marginBottom: "var(--size-xl)",
}}
>
{props.items.map(item => {
const gridColumn = item.featured ? 'span 2' : 'auto'
const layout: CardLayout = item.featured ? 'featured' : 'simple'
const gridColumn = item.featured ? "span 2" : "auto"
const layout: CardLayout = item.featured ? "featured" : "simple"
const content = !item.featured
? (
<Block
direction={'vertical'}
direction={"vertical"}
>
{item.title}
<Spacer />
{!item.date ? null : (
<Date style={{
marginTop: 'var(--size-m)',
marginTop: "var(--size-m)",
}}>{item.date}</Date>
)}
</Block>
@@ -44,11 +44,11 @@ export const PageGrid: React.FC<PageGridProps> = props => {
href={item.url}
cover={(
<Image
layout={'fill'}
objectFit={'cover'}
layout={"fill"}
objectFit={"cover"}
src={item.cover.src}
alt={item.cover.alt}
placeholder={'blur'}
placeholder={"blur"}
blurDataURL={item.cover.blur}
/>
)}
+9 -9
View File
@@ -1,10 +1,10 @@
import s from './styles.module.css'
import s from "./styles.module.css"
import cx from 'classnames'
import { dateFormat } from 'src/lib/date'
import { ITag } from 'src/types'
import { TagList, Direction } from '../TagList'
import { useMobile } from 'src/hooks/useMobile'
import cx from "classnames"
import { dateFormat } from "src/lib/date"
import { ITag } from "src/types"
import { TagList, Direction } from "../TagList"
import { useMobile } from "src/hooks/useMobile"
export type PageMetaProps = {
style?: React.CSSProperties
@@ -14,15 +14,15 @@ export type PageMetaProps = {
export const PageMeta: React.FC<PageMetaProps> = props => {
const mobile = useMobile()
const center = mobile ? null : 'center'
const direction: Direction = mobile ? 'vertical' : 'horizontal'
const center = mobile ? null : "center"
const direction: Direction = mobile ? "vertical" : "horizontal"
return (
<div className={cx(s.pageMeta, {
[s.center]: center,
})} style={props.style}>
{!props.date ? null : (
<p className={'date'}>Опубликовано {dateFormat(props.date)}</p>
<p className={"date"}>Опубликовано {dateFormat(props.date)}</p>
)}
{!(props.tags?.length) ? null : (
+5 -5
View File
@@ -1,14 +1,14 @@
import { Block, BlockProps } from '../Block'
import { Button } from '../Button'
import { Spacer } from '../Spacer'
import { Block, BlockProps } from "../Block"
import { Button } from "../Button"
import { Spacer } from "../Spacer"
export type PagerProps = Omit<BlockProps, 'direction'> & {
export type PagerProps = Omit<BlockProps, "direction"> & {
nextHref: string | null
prevHref: string | null
}
export const Pager: React.FC<PagerProps> = ({ prevHref, nextHref, ...props }) => (
<Block {...props} direction={'horizontal'}>
<Block {...props} direction={"horizontal"}>
{!prevHref ? null : (
<Button href={prevHref}>Предыдущая страница</Button>
)}
+15 -15
View File
@@ -1,26 +1,26 @@
import s from './picture.module.css'
import s from "./picture.module.css"
import { memo } from 'react'
import Image from 'next/image'
import { Pic } from '@/types'
import { memo } from "react"
import Image from "next/image"
import { Pic } from "@/types"
const modifiers = new Map([
['square', s.square],
['vertical', s.vertical],
['horizontal', ''],
["square", s.square],
["vertical", s.vertical],
["horizontal", ""],
])
function size(w: number, h: number, tolerance: number) {
const r = w / h
if (r < 1 && r > tolerance) {
return 'square'
return "square"
}
if (w < h) {
return 'vertical'
return "vertical"
}
return 'horizontal'
return "horizontal"
}
export type PictureProps = Pic & {
@@ -31,19 +31,19 @@ export type PictureProps = Pic & {
export const Picture: React.FC<PictureProps> = memo(({ wide = false, ...props }) => {
const ss = size(props.width, props.height, 0.95)
const layout = modifiers.get(ss)
const w = ss === 'horizontal' ? wide : false
const w = ss === "horizontal" ? wide : false
return (
<figure className={`${s.pic} ${layout} ${w ? s.wide : ''}`}>
<figure className={`${s.pic} ${layout} ${w ? s.wide : ""}`}>
<Image
className={s.img}
src={props.src}
alt={props.alt}
width={props.width}
height={props.height}
layout={'responsive'}
layout={"responsive"}
blurDataURL={props.blur}
placeholder={'blur'}
placeholder={"blur"}
/>
{!props.caption ? null : (
<figcaption>{props.caption}</figcaption>
@@ -52,4 +52,4 @@ export const Picture: React.FC<PictureProps> = memo(({ wide = false, ...props })
)
})
Picture.displayName = 'Picture'
Picture.displayName = "Picture"
+2 -2
View File
@@ -1,10 +1,10 @@
import { createElement } from 'react'
import { createElement } from "react"
export type SpacerProps = {
as?: keyof HTMLElementTagNameMap
}
export const Spacer: React.FC<SpacerProps> = ({ as = 'div' }) => createElement(as, {
export const Spacer: React.FC<SpacerProps> = ({ as = "div" }) => createElement(as, {
style: {
flex: 1,
},
+3 -3
View File
@@ -1,6 +1,6 @@
import s from './wrapper.module.css'
import s from "./wrapper.module.css"
import cx from 'classnames'
import cx from "classnames"
export type WrapperProps = {
header: React.ReactNode
@@ -10,7 +10,7 @@ export type WrapperProps = {
}
export const Wrapper: React.FC<WrapperProps> = props => (
<div className={cx(s.container, 'theme-default')} style={props.style}>
<div className={cx(s.container, "theme-default")} style={props.style}>
{props.header}
<main className={s.main} style={props.mainStyle}>
+1 -1
View File
@@ -1,4 +1,4 @@
import React from 'react'
import React from "react"
function script(account) {
return `
+1 -1
View File
@@ -4,7 +4,7 @@ export type YoutubeProps = {
export const Youtube: React.FC<{ url: string }> = props => {
const url = new URL(props.url)
const videoId = url.searchParams.get('v')
const videoId = url.searchParams.get("v")
if (!videoId) {
return null
}