Skip to content

Commit

Permalink
fix: mark ui bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
fbwoolf authored and pete-watters committed Nov 28, 2023
1 parent 8dbfefe commit e9da651
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { sanitize } from 'dompurify';
import { Box } from 'leather-styles/jsx';

import { parseJson } from '@app/components/json';
import { LoadingSpinner } from '@app/components/loading-spinner';
import { useInscriptionTextContentQuery } from '@app/query/bitcoin/ordinals/inscription-text-content.query';

Expand All @@ -16,12 +17,6 @@ export function InscriptionText(props: InscriptionTextProps) {

return (
<Box
height="100%"
color="white"
p="20px"
position="relative"
overflow="hidden"
textAlign="left"
_after={{
content: '""',
position: 'absolute',
Expand All @@ -31,8 +26,16 @@ export function InscriptionText(props: InscriptionTextProps) {
width: '100%',
backgroundImage: 'linear-gradient(rgba(0,0,0,0), rgba(0,0,0,1))',
}}
color="white"
fontSize="9px"
height="100%"
p="space.03"
position="relative"
overflow="hidden"
textAlign="left"
width="100%"
>
{sanitize(query.data)}
<pre>{sanitize(parseJson(query.data))}</pre>
</Box>
);
}
8 changes: 8 additions & 0 deletions src/app/components/json.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import { Box } from 'leather-styles/jsx';

import { isBigInt, isTypedArray } from '@shared/utils';

export function parseJson(content: string) {
try {
return JSON.stringify(JSON.parse(content), null, 2);
} catch (e) {
return content;
}
}

function parseJsonReadable(value: any) {
if (isBigInt(value)) return value.toString();
if (isTypedArray(value)) return bytesToHex(value);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import { parseJson } from '@app/components/json';
import { useInscriptionTextContentQuery } from '@app/query/bitcoin/ordinals/inscription-text-content.query';
import { OrdinalIcon } from '@app/ui/components/icons/ordinal-icon';

import { CollectibleText } from '../_collectible-types/collectible-text';

function processContent(content: string) {
try {
return JSON.stringify(JSON.parse(content), null, 2);
} catch (e) {
return content;
}
}

interface InscriptionTextProps {
contentSrc: string;
inscriptionNumber: number;
Expand All @@ -33,7 +26,7 @@ export function InscriptionText({
key={inscriptionNumber}
onClickCallToAction={onClickCallToAction}
onClickSend={onClickSend}
content={processContent(query.data)}
content={parseJson(query.data)}
subtitle="Ordinal inscription"
title={`# ${inscriptionNumber}`}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ export function CollectibleItemLayout({
<Box p="space.02">
<styled.button
_focus={{ clipPath: 'none', outline: 'focus' }}
_hover={{ bg: 'accent.background-primary', fontWeight: 500 }}
_hover={{ bg: 'accent.background-primary' }}
bg="accent.background-primary"
borderRadius="sm"
clipPath={isHovered ? 'none' : 'circle(0%)'}
fontWeight={500}
onClick={e => {
e.stopPropagation();
onClickSend();
Expand Down
1 change: 0 additions & 1 deletion src/app/features/psbt-signer/psbt-signer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export function PsbtSigner(props: PsbtSignerProps) {
<PsbtSignerLayout>
<PsbtRequestHeader name={name} origin={origin} />
<PsbtRequestDetailsLayout>
<PsbtRequestSighashWarningLabel />
{isPsbtMutable ? <PsbtRequestSighashWarningLabel /> : null}
<PsbtRequestDetailsHeader />
<PsbtInputsOutputsTotals />
Expand Down
3 changes: 1 addition & 2 deletions src/app/features/theme-drawer/theme-list-item-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Box, Flex, styled } from 'leather-styles/jsx';
import { token } from 'leather-styles/tokens';

import { CheckmarkIcon } from '@app/ui/components/icons/checkmark-icon';

Expand All @@ -21,7 +20,7 @@ export function ThemeListItemLayout({
isActive
? undefined
: {
backgroundColor: token('colors.brown.2'),
backgroundColor: 'accent.component-background-hover',
}
}
px="space.05"
Expand Down

0 comments on commit e9da651

Please sign in to comment.