Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): bug-and-ux-fixes #45

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,19 @@ const TopInfo: React.FC<ITopInfo> = ({
{isUndefined(description) ? <SkeletonDescription /> : <StyledP>{description}</StyledP>}
</TopLeftInfo>
<TopRightInfo>
<Copiable copiableContent={id ?? ""} info="Copy Registry Address" iconPlacement="left">
<StyledA
href={`${SUPPORTED_CHAINS[DEFAULT_CHAIN].blockExplorers?.default.url}/address/${id}`}
target="_blank"
rel="noreferrer"
>
{shortenAddress(id ?? "")}
</StyledA>
</Copiable>
{id !== "" ? (
<Copiable copiableContent={id} info="Copy Registry Address" iconPlacement="left">
<StyledA
href={`${SUPPORTED_CHAINS[DEFAULT_CHAIN].blockExplorers?.default.url}/address/${id}`}
target="_blank"
rel="noreferrer"
>
{shortenAddress(id)}
</StyledA>
</Copiable>
) : (
<Skeleton width={80} height={16} />
)}
Harman-singh-waraich marked this conversation as resolved.
Show resolved Hide resolved
<StatusDisplay {...{ status, disputed, registryAddress, latestRequestSubmissionTime }} />
</TopRightInfo>
</TopInfoContainer>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/AllLists/RegistryDetails/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const List: React.FC<IList> = ({ registryAddress }) => {
<Search />
<StatsAndFilters fields={[{ label: "Items", value: totalItems?.toString() }]} />
<ListContainer>
{registryDetails?.registry.items
{registryDetails?.registry?.items
? registryDetails?.registry.items.map((item) => <ItemCard key={item.id} {...(item as ItemDetailsFragment)} />)
: Array.from({ length: 3 }).map((_, index) => <SkeletonItemCard key={index} />)}
</ListContainer>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/SubmitItem/Preview/ItemDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ItemDisplay: React.FC<IItemDisplay> = ({}) => {

return (
<Container>
<StyledP>Check how the item is displayed on the Item page:</StyledP>
<StyledP>Check how the item is displayed on the List page:</StyledP>
<ItemCard props={props} status={Status.RegistrationRequested} />
</Container>
);
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/SubmitItem/Preview/ListDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ListDisplay: React.FC<IListDisplay> = ({}) => {

return (
<Container>
<StyledP>Check how the item is displayed on the List page:</StyledP>
<StyledP>Check how the item is displayed on the Item page:</StyledP>
<ItemInformationCard
props={props}
policyURI="/ipfs/QmSxGYpXHBWBGvGnBeZD1pFxh8fRHj4Z7o3fBzrGiqNx4v/tokens-policy.pdf"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import RegistryCard from "components/RegistryCard";
import { useSubmitListContext } from "context/SubmitListContext";
import { Status } from "src/graphql/graphql";
import { mapFromSubgraphStatus } from "components/RegistryCard/StatusBanner";
import { DEFAULT_LIST_LOGO } from "src/consts";

const Container = styled.div`
display: flex;
Expand All @@ -27,10 +28,9 @@ const HomePageDisplay: React.FC = () => {
id={"1"}
title={previewData.title}
status={mapFromSubgraphStatus(Status.RegistrationRequested, false)}
logoURI={previewData?.logoURI}
chainId={421614}
logoURI={previewData?.logoURI ?? DEFAULT_LIST_LOGO}
totalItems={23}
overrideIsList
overrideIsListView
/>
</Container>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { responsiveSize } from "styles/responsiveSize";
import RegistryInformationCard from "components/InformationCards/RegistryInformationCard";
import { useSubmitListContext } from "context/SubmitListContext";
import { Status } from "src/graphql/graphql";
import { DEFAULT_LIST_LOGO, MAIN_CURATE_ADDRESS } from "src/consts";
import { useAccount } from "wagmi";

const Container = styled.div`
display: flex;
Expand All @@ -22,21 +24,22 @@ const StyledInformationCard = styled(RegistryInformationCard)`

const ListPageDisplay: React.FC = () => {
const { listMetadata } = useSubmitListContext();
const { address } = useAccount();
const previewData = useMemo(() => listMetadata, [listMetadata]);

return (
<Container>
<StyledP>Check how the list is displayed on the List page:</StyledP>
<StyledInformationCard
id=""
parentRegistryAddress=""
registerer={{ id: "" }}
id={MAIN_CURATE_ADDRESS}
parentRegistryAddress={MAIN_CURATE_ADDRESS}
registerer={{ id: address }}
itemId=""
title={previewData.title}
description={previewData.description}
status={Status.Registered}
disputed={false}
logoURI={previewData.logoURI}
logoURI={previewData.logoURI ?? DEFAULT_LIST_LOGO}
policyURI="https://cdn.kleros.link/ipfs/QmSxGYpXHBWBGvGnBeZD1pFxh8fRHj4Z7o3fBzrGiqNx4v/tokens-policy.pdf"
/>
</Container>
Expand Down
Loading