Skip to content

Commit

Permalink
chore: unify the default visibility (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinxl authored Feb 26, 2024
1 parent 3af73a8 commit d6cd142
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/src/components/UploadKit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const uploadOptions: UploadKitOptions = {
operatorAddress: '0x89A1CC91B642DECbC4789474694C606E0E0c420b',
endpoint: 'https://gnfd-testnet-sp1.bnbchain.org',
},
visibility: 'VISIBILITY_TYPE_PRIVATE',
visibility: 'VISIBILITY_TYPE_PUBLIC_READ',
};

export default function App() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const wagmiConfig = createConfig({

const uploadOptions: UploadKitOptions = {
client: client,
visibility: 'VISIBILITY_TYPE_PRIVATE',
visibility: 'VISIBILITY_TYPE_PUBLIC_READ',
};

export default function Providers({ children }: { children: React.ReactNode }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const options: WalletKitOptions = {

const uploadOptions: UploadKitOptions = {
client: client,
visibility: 'VISIBILITY_TYPE_PRIVATE',
visibility: 'VISIBILITY_TYPE_PUBLIC_READ',
};

export default function Providers({ children }: { children: React.ReactNode }) {
Expand Down
2 changes: 1 addition & 1 deletion examples/uploadkit-with-remix-rainbowkit/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const loader: LoaderFunction = () => {

const uploadOptions: UploadKitOptions = {
client: client,
visibility: 'VISIBILITY_TYPE_PRIVATE',
visibility: 'VISIBILITY_TYPE_PUBLIC_READ',
};
export default function App() {
const { ENV } = useLoaderData<LoaderData>();
Expand Down
4 changes: 2 additions & 2 deletions packages/uploadkit/dev/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const uploadOptions: UploadKitOptions = {
operatorAddress: '0x89A1CC91B642DECbC4789474694C606E0E0c420b',
endpoint: 'https://gnfd-testnet-sp1.bnbchain.org',
},
visibility: 'VISIBILITY_TYPE_PRIVATE',
visibility: 'VISIBILITY_TYPE_PUBLIC_READ',
// onError: console.log,
};

Expand All @@ -64,7 +64,7 @@ export default function App() {
<button onClick={() => setMode(nextMode)}>switch to {nextMode}</button>
<div style={{ height: 20 }} />
<WalletKitProvider options={options} mode="light">
<UploadKitProvider options={uploadOptions} mode={mode} debugMode={true}>
<UploadKitProvider options={uploadOptions} mode={mode}>
<WalletKitButton />
<SwitchNetworkModal />
<div style={{ height: 16 }}></div>
Expand Down
5 changes: 1 addition & 4 deletions packages/uploadkit/src/components/UploadButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,13 @@ export const UploadButton = (props: ButtonProps) => {
const { totalFee } = useTotalFee();
const { address, connector } = useAccount();
const {
options: { seedString, sp, visibility, bucketName, onError },
options: { client, seedString, sp, visibility, bucketName, onError },
} = useUploadKitContext();
const { isGnfd, uploadButtonDisabled } = useUploadDisable();
const {
state: { loading },
dispatch,
} = useUpload();
const {
options: { client },
} = useUploadKitContext();
const setLoading = (show: boolean) => {
dispatch({
type: 'SET_IS_LOADING',
Expand Down

0 comments on commit d6cd142

Please sign in to comment.