Skip to content

Commit

Permalink
feat(spaceward): fix qa issues (#877)
Browse files Browse the repository at this point in the history
* fixes #869; add missing Dockerfile entry

* fix #874; #873

* fix tx sidebar scroll
  • Loading branch information
alex-nax authored Sep 20, 2024
1 parent 019809a commit 9a954da
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 17 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ ENV VITE_WARDEN_COSMOSKIT_CHAIN_NAME=%WARDEN_COSMOSKIT_CHAIN_NAME%
ENV VITE_WARDEN_CHAIN_ID=%WARDEN_CHAIN_ID%
ENV VITE_WARDEN_MAINTENANCE=%WARDEN_MAINTENANCE%
ENV VITE_WARDEN_SNAP_ORIGIN=%WARDEN_SNAP_ORIGIN%
ENV VITE_WARDEN_SNAP_VERSION=%WARDEN_SNAP_VERSION%
ENV VITE_WARDEN_ENVIRONMENT=%WARDEN_ENVIRONMENT%
ENV VITE_WARDEN_STORYBLOK_TOKEN=%WARDEN_STORYBLOK_TOKEN%
ENV VITE_WARDEN_ETHEREUM_ANALYZER_CONTRACT=%WARDEN_ETHEREUM_ANALYZER_CONTRACT%
Expand Down
2 changes: 2 additions & 0 deletions spaceward/src/components/ui/copy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const Copy = React.forwardRef<HTMLButtonElement, ButtonProps>(
const [showTooltip, setShowTooltip] = React.useState(false);
const onCopy = React.useCallback(() => {
setCopied(true);
setShowTooltip(true);

setTimeout(() => {
setCopied(false);
setShowTooltip(false);
Expand Down
2 changes: 1 addition & 1 deletion spaceward/src/features/actions/StatusSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ export default function StatusSidebar() {
sideOffset={20}
className="p-0"
>
<div className="bg-fill-quaternary">
<div className="bg-fill-quaternary max-h-80 overflow-auto">
{filtered.map((id) => {
const action = data?.[id];

Expand Down
8 changes: 4 additions & 4 deletions spaceward/src/features/modals/AssetSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const AssetSelector = ({
}, [_results, filterByChain, searchValue]);

return (
<div className="px-8 flex flex-col gap-6">
<div className="px-8 flex flex-col gap-6 max-h">
<div className="flex items-center justify-between relative z-30">
<button onClick={onClose} className="p-1 ">
<Icons.arrLeft className="invert dark:invert-0" />
Expand Down Expand Up @@ -144,7 +144,7 @@ const AssetSelector = ({
/>
</div>
{isNetworkDropdown && (
<div className="w-[248px] bg-fill-quaternary text-sm rounded-lg py-2 absolute z-10 bottom-[-8px] right-0 whitespace-nowrap backdrop-blur-[30px] translate-y-[100%] ">
<div className="w-60 bg-fill-quaternary text-sm rounded-lg py-2 absolute z-10 bottom-[-8px] right-0 whitespace-nowrap backdrop-blur-[30px] translate-y-[100%] ">
<div
onClick={() => {
setIsNetworkDropdown(false);
Expand Down Expand Up @@ -222,7 +222,7 @@ const AssetSelector = ({

<div>
{!searchValue && Object.keys(withBalance).length ? (
<div className="bg-fill-quaternary rounded-2xl p-4 no-scrollbar overflow-scroll max-h-[280px]">
<div className="bg-fill-quaternary rounded-2xl p-4 no-scrollbar overflow-scroll max-h-64">
<div className="font-bold mb-5 text-xl">
Your assets
</div>
Expand Down Expand Up @@ -319,7 +319,7 @@ const AssetSelector = ({
<></>
)}

<div className="flex flex-col mt-4 no-scrollbar overflow-scroll max-h-[240px] -mb-4 pb-4">
<div className="flex flex-col mt-4 no-scrollbar overflow-scroll max-h-56 -mb-4 pb-4">
{results
.filter(
({ chainName, token }) =>
Expand Down
15 changes: 8 additions & 7 deletions spaceward/src/features/modals/ReceiveAssets.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import clsx from "clsx";
import { useState } from "react";
import { useRef, useState } from "react";
import QRCode from "react-qr-code";
import { Copy } from "@/components/ui/copy";
import { TransferParams } from "./types";
Expand Down Expand Up @@ -102,6 +102,7 @@ export const fixAddress = (
};

export default function ReceiveAssetsModal(props: TransferParams) {
const copyRef = useRef<HTMLButtonElement>(null);
const { setData: setModal } = useModalState();
const { spaceId } = useSpaceId();
const { queryBalances } = useAssetQueries(spaceId);
Expand Down Expand Up @@ -200,14 +201,14 @@ export default function ReceiveAssetsModal(props: TransferParams) {
address
</div>
<div>
<Copy value={address?.address} />
<Copy ref={copyRef} value={address?.address} />
</div>

<CopyToClipboard text={address?.address ?? ""}>
<button className="bg-pixel-pink cursor-pointer rounded px-5 h-10 flex items-center justify-center font-semibold text-black duration-300 hover:bg-fill-accent-hover mt-4">
Copy Address
</button>
</CopyToClipboard>
<button className="bg-pixel-pink cursor-pointer rounded px-5 h-10 flex items-center justify-center font-semibold text-black duration-300 hover:bg-fill-accent-hover mt-4" onClick={() => {
copyRef.current?.click();
}}>
Copy Address
</button>
</div>
</div>
)}
Expand Down
10 changes: 5 additions & 5 deletions spaceward/src/features/modals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function hasEntry<T extends {}, K extends string>(key: K, obj?: T): obj is T & {

export default function ModalRoot() {
const { data, setData } = useModalState();
const isDesktop = useMediaQuery("(min-width: 768px)");
const isLargeScreen = useMediaQuery("(min-width: 1280px) and (min-height: 800px)");

// fixme
async function _cancel() {
Expand Down Expand Up @@ -65,20 +65,20 @@ export default function ModalRoot() {
)}
>
<div className="bg-overlay fixed left-0 top-0 w-full h-full backdrop-blur-[20px] -z-10"></div>
{!isDesktop ? (
{!isLargeScreen ? (
<button
onClick={_cancel}
className="absolute top-8 invert dark:invert-0 right-8 opacity-[0.5] hover:opacity-[100%] transition-all"
className="absolute top-8 invert dark:invert-0 right-8 opacity-[0.5] hover:opacity-[100%] transition-all z-10"
>
<img src="/images/button-close.svg" alt="" />
</button>
) : null}

<div className="flex flex-col relative">
{isDesktop ? (
{isLargeScreen ? (
<button
onClick={_cancel}
className="absolute -top-16 invert dark:invert-0 -right-16 opacity-[0.5] hover:opacity-[100%] transition-all"
className="absolute -top-12 invert dark:invert-0 -right-16 opacity-[0.5] hover:opacity-[100%] transition-all"
>
<img src="/images/button-close.svg" alt="" />
</button>
Expand Down
4 changes: 4 additions & 0 deletions spaceward/src/utils/shield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ export const validateAddressNumber = (expression?: Expression) => {

break;
}
// do not validate whitelist
case "contains": {
break;
}
default:
error = `Validation failed: unknown function name: ${name}`;
break;
Expand Down

0 comments on commit 9a954da

Please sign in to comment.