Skip to content

Commit

Permalink
Merge branch 'main' into nebula-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
saminacodes authored Dec 16, 2024
2 parents ea56eee + b173ad2 commit 84e4ce3
Show file tree
Hide file tree
Showing 38 changed files with 2,092 additions and 369 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ name: Auto Author Assign

on:
pull_request:
types: [ opened, reopened ]
types: [opened, reopened]

permissions:
pull-requests: write

jobs:
assign-author:
runs-on: ubuntu-latest
if: |
github.event.pull_request.author_association == 'MEMBER' ||
github.event.pull_request.author_association == 'OWNER' ||
github.event.pull_request.author_association == 'COLLABORATOR'
steps:
- uses: toshimaru/[email protected]
13 changes: 12 additions & 1 deletion .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Linked Issue

on:
pull_request:
types: [opened, edited]
types: [opened, edited, ready_for_review]

env:
VALID_ISSUE_PREFIXES: "CNCT|DASH|PROT|INSIGHT|ENGINE|CS|DES|BIL|DEVX|SOLU|NEB"
Expand All @@ -22,6 +22,17 @@ jobs:
pull_number: context.issue.number
});
// Check if contributor is external
const isInternalContributor = ['MEMBER', 'OWNER', 'COLLABORATOR'].includes(
context.payload.pull_request.author_association
);
// Automatically pass for external contributors
if (!isInternalContributor) {
console.log('External contributor detected - automatically passing check');
return;
}
const body = pr.data.body || '';
const branchName = pr.data.head.ref;
const issueRegex = new RegExp(`(${process.env.VALID_ISSUE_PREFIXES})-\\d+`, 'i');
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: TypeDoc

on:
push:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment
concurrency:
group: "typedoc"
cancel-in-progress: true

jobs:
build:
name: "Generate TypeDoc"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install
uses: ./.github/composite-actions/install

- name: Run TypeDoc
run: pnpm typedoc

- name: Update Gist
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GIST_TOKEN }}
script: |
const fs = require('fs');
const content = fs.readFileSync('./packages/thirdweb/typedoc/parsed.json', 'utf8');
const gistId = '678fe1f331a01270bb002fee660f285d';
await github.rest.gists.update({
gist_id: gistId,
files: {
'data.json': {
content: content
}
}
});
console.log(`Permalink: https://gist.githubusercontent.com/raw/${gistId}/data.json`);
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ import {
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";
import { TabButtons } from "@/components/ui/tabs";
import { ListerOnly } from "@3rdweb-sdk/react/components/roles/lister-only";
import type { Account } from "@3rdweb-sdk/react/hooks/useApi";
import { isAlchemySupported } from "lib/wallet/nfts/alchemy";
import { isMoralisSupported } from "lib/wallet/nfts/moralis";
import { isSimpleHashSupported } from "lib/wallet/nfts/simpleHash";
import { PlusIcon } from "lucide-react";
import { useState } from "react";
import type { ThirdwebContract } from "thirdweb";
Expand All @@ -23,6 +27,8 @@ interface CreateListingButtonProps {
twAccount: Account | undefined;
}

const LISTING_MODES = ["Select NFT", "Manual"] as const;

export const CreateListingButton: React.FC<CreateListingButtonProps> = ({
createText = "Create",
type,
Expand All @@ -32,7 +38,13 @@ export const CreateListingButton: React.FC<CreateListingButtonProps> = ({
}) => {
const address = useActiveAccount()?.address;
const [open, setOpen] = useState(false);

const [listingMode, setListingMode] =
useState<(typeof LISTING_MODES)[number]>("Select NFT");
const isSupportedChain =
contract.chain.id &&
(isSimpleHashSupported(contract.chain.id) ||
isAlchemySupported(contract.chain.id) ||
isMoralisSupported(contract.chain.id));
return (
<ListerOnly contract={contract}>
<Sheet open={open} onOpenChange={setOpen}>
Expand All @@ -43,15 +55,47 @@ export const CreateListingButton: React.FC<CreateListingButtonProps> = ({
</SheetTrigger>
<SheetContent className="w-full overflow-y-auto sm:min-w-[540px] lg:min-w-[700px]">
<SheetHeader>
<SheetTitle className="mb-5 text-left">{createText}</SheetTitle>
<SheetTitle className="mb-3 text-left">{createText}</SheetTitle>
</SheetHeader>
<CreateListingsForm
twAccount={twAccount}
contract={contract}
type={type}
actionText={createText}
setOpen={setOpen}
/>
{/*
If the chain is not supported by the indexer providers
we don't show the tabs, we only show the Manual input form.
Otherwise we show both */}
{isSupportedChain ? (
<>
<TabButtons
tabs={LISTING_MODES.map((mode) => ({
name: mode,
isActive: mode === listingMode,
onClick: () => setListingMode(mode),
isEnabled: true,
}))}
tabClassName="text-sm gap-2 !text-sm"
tabContainerClassName="gap-0.5"
/>
<div className="mt-5">
<CreateListingsForm
twAccount={twAccount}
contract={contract}
type={type}
actionText={createText}
setOpen={setOpen}
mode={listingMode === "Select NFT" ? "automatic" : "manual"}
/>
</div>
</>
) : (
<div className="mt-5">
<CreateListingsForm
twAccount={twAccount}
contract={contract}
type={type}
actionText={createText}
setOpen={setOpen}
mode="manual"
/>
</div>
)}
</SheetContent>
</Sheet>
</ListerOnly>
Expand Down
Loading

0 comments on commit 84e4ce3

Please sign in to comment.