Skip to content

Commit

Permalink
Merge pull request #44 from storyprotocol/sam/fix-LicenseTermsList-co…
Browse files Browse the repository at this point in the history
…mmercialRevShare
  • Loading branch information
allenchuang authored Sep 27, 2024
2 parents 97e9a03 + cfc3758 commit 768b485
Show file tree
Hide file tree
Showing 5 changed files with 9,475 additions and 11,745 deletions.
2 changes: 1 addition & 1 deletion packages/storykit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@storyprotocol/storykit",
"author": "storyprotocol engineering <eng@storyprotocol.xyz>",
"version": "0.1.28",
"version": "0.1.29",
"type": "module",
"exports": {
".": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { STORYKIT_SUPPORTED_CHAIN } from "@/lib/constants"
import { PREVIEW_IP_ASSETS } from "@/stories/data"
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import React, { FC } from "react"
Expand All @@ -8,15 +9,16 @@ import IpLicenseAccordion from "../IpLicenseAccordion"

type Size = "small" | "medium" | "large"

const Example: FC<{ ipId: Address; size: Size }> = ({
const Example: FC<{ ipId: Address; chain?: STORYKIT_SUPPORTED_CHAIN; size: Size }> = ({
ipId = PREVIEW_IP_ASSETS[0] as `0x${string}`,
chain = STORYKIT_SUPPORTED_CHAIN.STORY_TESTNET,
size = "medium",
}) => {
const queryClient = new QueryClient()
return (
<QueryClientProvider client={queryClient}>
<div className="flex h-full w-full items-center justify-center">
<IpProvider ipId={ipId}>
<IpProvider chain={chain} ipId={ipId}>
<IpLicenseAccordion size={size} />
</IpProvider>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { STORYKIT_SUPPORTED_CHAIN } from "@/lib/constants"
import { PREVIEW_IP_ASSETS } from "@/stories/data"
import { PIL_FLAVOR } from "@/types/assets"
import type { Meta, StoryObj } from "@storybook/react"
Expand All @@ -12,7 +13,11 @@ const meta = {
layout: "centered",
},
// tags: ["autodocs"],
argTypes: {},
argTypes: {
chain: {
options: [...Object.values(STORYKIT_SUPPORTED_CHAIN)],
},
},
args: {},
// tags: ["isHidden"],
} satisfies Meta<typeof Example>
Expand All @@ -27,6 +32,7 @@ export const Select: Story = {
},
},
args: {
chain: STORYKIT_SUPPORTED_CHAIN.STORY_TESTNET,
ipId: PREVIEW_IP_ASSETS[0] as `0x${string}`,
size: "medium",
},
Expand All @@ -36,6 +42,7 @@ export const Input: Story = {
ipId: { control: "text" },
},
args: {
chain: STORYKIT_SUPPORTED_CHAIN.STORY_TESTNET,
ipId: PREVIEW_IP_ASSETS[0] as `0x${string}`,
size: "medium",
},
Expand All @@ -47,6 +54,7 @@ export const IpNoLicense: Story = {
},
},
args: {
chain: STORYKIT_SUPPORTED_CHAIN.STORY_TESTNET,
ipId: "0x0aEcA721aDceb65fbE81F450a1C59978fF903124",
size: "medium",
},
Expand All @@ -60,11 +68,12 @@ export const IpNoLicense: Story = {
export const IpOfCommercialRemix: Story = {
argTypes: {
ipId: {
options: ["0x9344852e16A4aCC2592FDeD4301eDcC58E8E0128"],
options: ["0x129B22b651529e2ee9243df8c2cDb9B47BD548C0"],
},
},
args: {
ipId: "0x9344852e16A4aCC2592FDeD4301eDcC58E8E0128",
chain: STORYKIT_SUPPORTED_CHAIN.STORY_TESTNET,
ipId: "0x129B22b651529e2ee9243df8c2cDb9B47BD548C0",
size: "large",
},
play: async ({ canvasElement }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const DescribeTerms = (selectedLicenseTerms: PILTerms) => {
cans.push(DESCRIPTIONS.COMMERCIAL_USE)
if (selectedLicenseTerms.commercialRevenueShare) {
extras.push(
`Anyone who creates a remix will share ${selectedLicenseTerms.commercialRevenueShare}% of their revenue with you`
`Anyone who creates a remix will share ${Math.round(selectedLicenseTerms.commercialRevenueShare / 10000) / 100}% of their revenue with you`
)
}
// cannot make more than the minimum between commercial rev ceiling and derivative rev ceiling
Expand Down
Loading

0 comments on commit 768b485

Please sign in to comment.