mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
blob: don't break words for UTF-8 decoding
This commit is contained in:
@@ -86,7 +86,7 @@ const BlobData = ({ data, isLoading, hash }: Props) => {
|
||||
return <BlobDataImage src={ imgSrc }/>;
|
||||
}
|
||||
case 'UTF-8':
|
||||
return <RawDataSnippet data={ hexToUtf8(data) } showCopy={ false } isLoading={ isLoading }/>;
|
||||
return <RawDataSnippet data={ hexToUtf8(data) } showCopy={ false } isLoading={ isLoading } contentProps={{ wordBreak: 'break-word' }}/>;
|
||||
case 'Base64':
|
||||
return <RawDataSnippet data={ hexToBase64(data) } showCopy={ false } isLoading={ isLoading }/>;
|
||||
case 'Raw':
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { ChakraProps } from '@chakra-ui/react';
|
||||
import { Box, Flex, chakra, useColorModeValue, Skeleton } from '@chakra-ui/react';
|
||||
import React from 'react';
|
||||
|
||||
@@ -12,9 +13,10 @@ interface Props {
|
||||
textareaMaxHeight?: string;
|
||||
showCopy?: boolean;
|
||||
isLoading?: boolean;
|
||||
contentProps?: ChakraProps;
|
||||
}
|
||||
|
||||
const RawDataSnippet = ({ data, className, title, rightSlot, beforeSlot, textareaMaxHeight, showCopy = true, isLoading }: Props) => {
|
||||
const RawDataSnippet = ({ data, className, title, rightSlot, beforeSlot, textareaMaxHeight, showCopy = true, isLoading, contentProps }: Props) => {
|
||||
// see issue in theme/components/Textarea.ts
|
||||
const bgColor = useColorModeValue('#f5f5f6', '#1a1b1b');
|
||||
return (
|
||||
@@ -39,6 +41,7 @@ const RawDataSnippet = ({ data, className, title, rightSlot, beforeSlot, textare
|
||||
overflowX="hidden"
|
||||
overflowY="auto"
|
||||
isLoaded={ !isLoading }
|
||||
{ ...contentProps }
|
||||
>
|
||||
{ data }
|
||||
</Skeleton>
|
||||
|
||||
Reference in New Issue
Block a user