mirror of
https://github.com/System-End/site.git
synced 2026-04-19 19:45:07 +00:00
Silence forwardRef warning in Photo component
This commit is contained in:
parent
36ed6e1b6a
commit
a998e264c8
1 changed files with 6 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ import styled from '@emotion/styled'
|
|||
import { Box, Card, Text, useColorMode } from 'theme-ui'
|
||||
import Image from 'next/image'
|
||||
import theme from '../lib/theme'
|
||||
import React from 'react'
|
||||
|
||||
const Caption = styled(Text)`
|
||||
display: block;
|
||||
|
|
@ -16,7 +17,7 @@ const Caption = styled(Text)`
|
|||
z-index: 0;
|
||||
`
|
||||
|
||||
const Photo = ({
|
||||
const Photo = React.forwardRef(function Photo({
|
||||
src,
|
||||
width,
|
||||
height,
|
||||
|
|
@ -24,14 +25,16 @@ const Photo = ({
|
|||
showAlt,
|
||||
dark,
|
||||
loading,
|
||||
ref,
|
||||
...props
|
||||
}) => {
|
||||
}) {
|
||||
const [colorMode] = useColorMode()
|
||||
const showCaption = showAlt && alt
|
||||
return (
|
||||
<Card
|
||||
{...props}
|
||||
as="figure"
|
||||
ref={ref}
|
||||
sx={{
|
||||
p: [0, 0, 0],
|
||||
boxShadow: 'elevated',
|
||||
|
|
@ -62,6 +65,6 @@ const Photo = ({
|
|||
)}
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
export default Photo
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue