mirror of
https://github.com/acid-info/logos-ordinals-dashboard.git
synced 2025-02-10 20:26:35 +00:00
fix: fix build errors
This commit is contained in:
parent
082843a0e8
commit
c68dba4414
@ -18,7 +18,6 @@ const OperatorGrid: React.FC<OperatorGridProps> = ({ data, isLoading }) => {
|
|||||||
const observerRef = useRef<IntersectionObserver | null>(null)
|
const observerRef = useRef<IntersectionObserver | null>(null)
|
||||||
const lastElementRef = useRef<HTMLDivElement | null>(null)
|
const lastElementRef = useRef<HTMLDivElement | null>(null)
|
||||||
|
|
||||||
// Infinite scroll logic
|
|
||||||
const handleObserver = useCallback(
|
const handleObserver = useCallback(
|
||||||
(entries: IntersectionObserverEntry[]) => {
|
(entries: IntersectionObserverEntry[]) => {
|
||||||
const target = entries[0]
|
const target = entries[0]
|
||||||
@ -67,7 +66,7 @@ const OperatorGrid: React.FC<OperatorGridProps> = ({ data, isLoading }) => {
|
|||||||
<img
|
<img
|
||||||
key={index}
|
key={index}
|
||||||
src={operator.image}
|
src={operator.image}
|
||||||
data-src={operator.gif}
|
data-src={operator?.gif}
|
||||||
alt={`Operator ${index + 1}`}
|
alt={`Operator ${index + 1}`}
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
className="lazyload"
|
className="lazyload"
|
||||||
@ -78,14 +77,14 @@ const OperatorGrid: React.FC<OperatorGridProps> = ({ data, isLoading }) => {
|
|||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
href={`/operators/${operator.id}`}
|
href={`/operators/${operator?.id}`}
|
||||||
key={'explore-operator-' + index}
|
key={'explore-operator-' + index}
|
||||||
>
|
>
|
||||||
<GridItem>
|
<GridItem>
|
||||||
<img
|
<img
|
||||||
key={index}
|
key={index}
|
||||||
src={operator.image}
|
src={operator?.image}
|
||||||
data-src={operator.gif}
|
data-src={operator?.gif}
|
||||||
alt={`Operator ${index + 1}`}
|
alt={`Operator ${index + 1}`}
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
className="lazyload"
|
className="lazyload"
|
||||||
|
@ -7,7 +7,8 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateImageUrl(inputUrl: string): string {
|
function updateImageUrl(inputUrl: string): string {
|
||||||
const urlParts = inputUrl.split('/')
|
if (!inputUrl) return ''
|
||||||
|
const urlParts = inputUrl?.split('/')
|
||||||
|
|
||||||
if (urlParts.length > 4 && urlParts[4] === '400') {
|
if (urlParts.length > 4 && urlParts[4] === '400') {
|
||||||
urlParts[4] = '1024'
|
urlParts[4] = '1024'
|
||||||
@ -37,7 +38,7 @@ const DownloadDropdown = ({ operator }: Props) => {
|
|||||||
</ChevronIconWrapper>
|
</ChevronIconWrapper>
|
||||||
</DropdownButton>
|
</DropdownButton>
|
||||||
<DropdownContent isOpen={isOpen}>
|
<DropdownContent isOpen={isOpen}>
|
||||||
<DropdownItem href={operator.gif} download>
|
<DropdownItem href={operator?.gif} download>
|
||||||
<Left>
|
<Left>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Image
|
<Image
|
||||||
@ -51,7 +52,7 @@ const DownloadDropdown = ({ operator }: Props) => {
|
|||||||
</Left>
|
</Left>
|
||||||
<FileType>.gif</FileType>
|
<FileType>.gif</FileType>
|
||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
<DropdownItem href={updateImageUrl(operator.gif)} download>
|
<DropdownItem href={updateImageUrl(operator?.gif)} download>
|
||||||
<Left>
|
<Left>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Image
|
<Image
|
||||||
@ -65,7 +66,7 @@ const DownloadDropdown = ({ operator }: Props) => {
|
|||||||
</Left>
|
</Left>
|
||||||
<FileType>.gif</FileType>
|
<FileType>.gif</FileType>
|
||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
<DropdownItem href={operator.image} download>
|
<DropdownItem href={operator?.image} download>
|
||||||
<Left>
|
<Left>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Image
|
<Image
|
||||||
@ -79,7 +80,7 @@ const DownloadDropdown = ({ operator }: Props) => {
|
|||||||
</Left>
|
</Left>
|
||||||
<FileType>.jpeg</FileType>
|
<FileType>.jpeg</FileType>
|
||||||
</DropdownItem>
|
</DropdownItem>
|
||||||
<DropdownItem href={updateImageUrl(operator.image)} download>
|
<DropdownItem href={updateImageUrl(operator?.image)} download>
|
||||||
<Left>
|
<Left>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Image
|
<Image
|
||||||
|
Loading…
x
Reference in New Issue
Block a user