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/nft improve #128

Merged
merged 4 commits into from
Nov 23, 2023
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
30 changes: 24 additions & 6 deletions packages/react/stories/nft/NftMint.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as React from "react";
import type { Meta, StoryObj } from "@storybook/react";

import NftMint from "../../src/ui/nft-mint";
Expand Down Expand Up @@ -28,12 +29,29 @@ export const Primary: Story = {
limited: 50,
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/f_auto,w_700/ighabxq1rjqr5xblblue",
starsPrice: 0.01063943,
onMint: () => {
console.log("onMint");
},
onChange: (value) => {
pricePerToken: 0.01063943,
tokenName: "STARS",
},
render: (props) => {
const [amount, setAmount] = React.useState<number>(0);
const onChange = (value) => {
console.log("onChange", value);
},
setAmount(value);
};

const onMint = () => {
setAmount(0);
console.log("minted and reset amount to 0");
};

return (
<NftMint
{...props}
amount={amount}
defaultAmount={0}
onChange={onChange}
onMint={onMint}
/>
);
},
};
233 changes: 189 additions & 44 deletions packages/react/stories/nft/NftProfile.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import type { Meta, StoryObj } from "@storybook/react";

import NftProfile from "../../src/ui/nft-profile";
import type { NftProfileCardProps } from "../../src/ui/nft-profile-card/nft-profile-card.types";

const meta: Meta<typeof NftProfile> = {
component: NftProfile,
Expand All @@ -14,10 +15,197 @@ export default meta;

type Story = StoryObj<typeof meta>;

const list1: NftProfileCardProps[] = [
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/m4sxagqpu98z76lcggyj.jpg",
name: "Bad Kid #9501",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/wnfkydgxvp2vf0fqq277.jpg",
name: "Bad Kid #9502",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/zkmiu7m7jelttu6ewrvu.jpg",
name: "Bad Kid #9505",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/yisqceq5imrkgrzml02b.jpg",
name: "Bad Kid #9506",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/benc6jvttlv9nbemyxch.jpg",
name: "Bad Kid #9508",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/ndkbjpwtgys09w1xxwny.jpg",
name: "Bad Kid #9509",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
];

const list2: NftProfileCardProps[] = [
{
imgSrc:
"https://ipfs-gw.stargaze-apis.com/ipfs/bafybeibl5rrhfola4m2gxyzfji63fxyboeic36pjxjmrnmgablqhy3mnvy/3054.png",
name: "Bad Kid #9501",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
{
imgSrc:
"https://ipfs-gw.stargaze-apis.com/ipfs/bafybeibl5rrhfola4m2gxyzfji63fxyboeic36pjxjmrnmgablqhy3mnvy/6.png",
name: "Bad Kid #9502",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
{
imgSrc:
"https://ipfs-gw.stargaze-apis.com/ipfs/bafybeicf6q3az6bk4fyilhgk7ytgkctxjb3jsm4542cxtb6r4xsb35zoni/images/608.png",
name: "Bad Kid #9505",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
{
imgSrc:
"https://ipfs-gw.stargaze-apis.com/ipfs/bafybeicf6q3az6bk4fyilhgk7ytgkctxjb3jsm4542cxtb6r4xsb35zoni/images/444.png",
name: "Bad Kid #9506",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
{
imgSrc:
"https://ipfs-gw.stargaze-apis.com/ipfs/bafybeicf6q3az6bk4fyilhgk7ytgkctxjb3jsm4542cxtb6r4xsb35zoni/images/668.png",
name: "Bad Kid #9508",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/ndkbjpwtgys09w1xxwny.jpg",
name: "Bad Kid #9509",
priceItems: [
{
label: "Highest offer",
value: "450",
},
{
label: "Listing price",
value: "373",
},
],
},
];

/* This is primary NftProfile */
export const Primary: Story = {
args: {
title: "Profile",
thumbnailBehavior: "contain",
headerButtonLabel: "View on Stargaze",
meta: [
{
Expand All @@ -38,49 +226,6 @@ export const Primary: Story = {
onView() {
console.log("onView");
},
list: [
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/m4sxagqpu98z76lcggyj.jpg",
name: "Bad Kid #9501",
highestOffer: "450",
listPrice: "373",
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/wnfkydgxvp2vf0fqq277.jpg",
name: "Bad Kid #9502",
highestOffer: "450",
listPrice: "373",
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/zkmiu7m7jelttu6ewrvu.jpg",
name: "Bad Kid #9505",
highestOffer: "450",
listPrice: "373",
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/yisqceq5imrkgrzml02b.jpg",
name: "Bad Kid #9506",
highestOffer: "450",
listPrice: "373",
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/benc6jvttlv9nbemyxch.jpg",
name: "Bad Kid #9508",
highestOffer: "450",
listPrice: "373",
},
{
imgSrc:
"https://res.cloudinary.com/stargaze/image/upload/w_700/ndkbjpwtgys09w1xxwny.jpg",
name: "Bad Kid #9509",
highestOffer: "450",
listPrice: "373",
},
],
list: list2,
},
};
13 changes: 10 additions & 3 deletions src/styles/rainbow-sprinkles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ const allSpace = { ...themeVars.space, ...extendedSpace };
const margins = themeVars.space;

const responsiveProperties = defineProperties({
conditions: transformBreakpoints<{ mobile: {}; tablet: {}; desktop: {}, mdMobile: {} }>(
breakpoints
),
conditions: transformBreakpoints<{
mobile: {};
tablet: {};
desktop: {};
mdMobile: {};
}>(breakpoints),
defaultCondition: "mobile",
dynamicProperties: {
display: true,
backgroundImage: true,
backgroundSize: true,
backgroundPosition: true,
backgroundRepeat: true,
objectFit: true,
flex: true,
flexBasis: true,
Expand Down
4 changes: 2 additions & 2 deletions src/ui/icon/icon.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,8 @@ export default function Icon(props: IconProps) {
y="0px"
viewBox="0 0 432 432"
style={{
"enable-background": "new 0 0 432 432",
"background-color": "black",
enableBackground: "new 0 0 432 432",
backgroundColor: "black",
}}
>
<g>
Expand Down
Loading