Skip to content

Commit

Permalink
removed unused libraries and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitmalhotra1420 committed May 13, 2024
1 parent 4074a29 commit 34c8f8c
Show file tree
Hide file tree
Showing 14 changed files with 668 additions and 2,900 deletions.
35 changes: 17 additions & 18 deletions README.md

Large diffs are not rendered by default.

29 changes: 0 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,16 @@
"preview": "vite preview"
},
"dependencies": {
"@apollo/client": "^3.3.7",
"@babel/runtime": "^7.21.0",
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
"@ethersproject/abi": "^5.6.0",
"@ethersproject/bignumber": "^5.6.0",
"@ethersproject/contracts": "^5.6.0",
"@ethersproject/providers": "^5.6.0",
"@firebase/app": "^0.7.24",
"@firebase/messaging": "^0.9.13",
"@fontsource/ibm-plex-mono": "^5.0.12",
"@material-ui/core": "4.11.0",
"@material-ui/icons": "^4.11.3",
"@metamask/eth-sig-util": "^4.0.0",
"@mui/icons-material": "^5.8.4",
"@mui/lab": "^5.0.0-alpha.72",
"@mui/material": "^5.5.0",
"@pushprotocol/restapi": "1.7.15",
"@pushprotocol/socket": "0.5.3",
Expand All @@ -58,7 +52,6 @@
"assert": "2.0.0",
"babel-plugin-styled-components": "1.10.7",
"blockies": "0.0.2",
"blockies-identicon": "0.1.0",
"browserify-zlib": "^0.2.0",
"browserslist": "4.14.6",
"buffer": "6.0.3",
Expand All @@ -75,64 +68,43 @@
"eth-crypto": "1.6.0",
"eth-sig-util": "^3.0.1",
"ethers": "^5.7.2",
"font-awesome": "^4.7.0",
"graphql": "^15.4.0",
"graphql-request": "^3.4.0",
"https-browserify": "1.0.0",
"image-size": "0.9.3",
"immer": "^10.0.2",
"ipfs-api": "26.1.2",
"ipfs-http-client": "^57.0.3",
"jotai": "^2.0.3",
"jotai-immer": "^0.2.0",
"merkletreejs": "^0.3.11",
"moment": "2.30.1",
"nano-ipfs-store": "0.1.3",
"openpgp": "^5.5.0",
"os-browserify": "0.3.0",
"path-browserify": "1.0.1",
"peerjs": "^1.4.7",
"pica": "^9.0.1",
"postcss-normalize": "10.0.1",
"process": "0.11.10",
"qrcode.react": "^3.1.0",
"react": "^18.2.0",
"react-animation": "1.2.2",
"react-animations": "1.0.0",
"react-cookie": "4.1.1",
"react-datetime-picker": "^3.5.0",
"react-dom": "^18.2.0",
"react-dotenv": "0.1.3",
"react-dropdown": "1.9.0",
"react-dropzone-uploader": "2.11.0",
"react-easy-crop": "^4.1.4",
"react-ga": "2.7.0",
"react-icons": "4.12.0",
"react-image-file-resizer": "^0.4.7",
"react-images-upload": "^1.2.8",
"react-joyride": "^2.4.0",
"react-loader-spinner": "^5.3.4",
"react-multi-select-component": "^4.2.3",
"react-player": "^2.16.0",
"react-query": "^3.39.1",
"react-redux": "^7.2.6",
"react-router-dom": "^6.9.0",
"react-scroll-to-bottom": "^4.2.0",
"react-select": "^5.2.2",
"react-spinners": "0.8.3",
"react-stack-grid": "0.7.1",
"react-switch": "^7.0.0",
"react-time-picker": "^4.5.0",
"react-toastify": "9.1.3",
"react-toggle-dark-mode": "1.1.1",
"react-transition-group": "4.4.2",
"react-twitter-embed": "^4.0.4",
"react-use": "^17.3.2",
"react-wavify": "^1.5.4",
"react-waypoint": "^9.0.3",
"secp256k1-v4": "https://github.com/HarshRajat/secp256k1-node",
"simple-peer": "9.11.1",
"socket.io-client": "4.5.2",
"stream-browserify": "3.0.0",
"styled-components": "^5.3.8",
"url": "0.11.0",
Expand All @@ -147,7 +119,6 @@
"@types/openpgp": "^4.4.18",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@types/react-scroll-to-bottom": "^4.2.0",
"@types/styled-components": "5.1.26",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
Expand Down
29 changes: 17 additions & 12 deletions src/components/ChannelSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ import React from 'react';

// External Packages
import { AiOutlineEllipsis } from 'react-icons/ai';
import styled from 'styled-components';
import styled, { useTheme } from 'styled-components';

// Internal Compoonents
import { ItemHV2, ItemVV2 } from 'components/reusables/SharedStylingV2';
import ChannelSettingsDropdown from './ChannelSettingsDropdown';
import { Button } from './SharedStyling';
import { useTheme } from '@emotion/react';

export default function ChannelSettings() {
const DropdownRef = React.useRef(null);
Expand All @@ -25,14 +24,20 @@ export default function ChannelSettings() {
};

return (
<ItemHV2 flex="0" ref={DropdownRef}>
<Settings active={isDropdownOpen} onClick={toggleDropdownHandler} />
<ItemHV2
flex="0"
ref={DropdownRef}
>
<Settings
active={isDropdownOpen}
onClick={toggleDropdownHandler}
/>
{isDropdownOpen && (
<ChannelSettingsDropdown
DropdownRef={DropdownRef}
isDropdownOpen={isDropdownOpen}
closeDropdown={closeDropdownHandler}
/>
<ChannelSettingsDropdown
DropdownRef={DropdownRef}
isDropdownOpen={isDropdownOpen}
closeDropdown={closeDropdownHandler}
/>
)}
</ItemHV2>
);
Expand All @@ -59,7 +64,7 @@ const Settings = styled(AiOutlineEllipsis)`
width: 40px;
height: 36px;
border: 1px solid;
border-color: ${(props)=>props.theme.default.borderColor};
border-color: ${(props) => props.theme.default.borderColor};
border-radius: 8px;
cursor: pointer;
transition: 400ms;
Expand All @@ -70,7 +75,7 @@ const SubmitButton = styled(Button)`
width: 7rem;
background: #cf1c84;
color: #fff;
z-Index:0;
z-index: 0;
font-family: 'Strawford';
font-style: normal;
font-weight: 500;
Expand All @@ -79,7 +84,7 @@ const SubmitButton = styled(Button)`
margin-right: 20px;
border-radius: 8px;
padding: 11px 10px;
@media (min-width:600px) and (max-width:700px){
@media (min-width: 600px) and (max-width: 700px) {
margin-right: 9px;
}
`;
4 changes: 1 addition & 3 deletions src/components/StakingInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// React + Web3 Essentials
import { ethers } from 'ethers';
import React, { Fragment, useEffect, useState } from 'react';
import { Fragment, useEffect, useState } from 'react';

// External Packages
import styled from 'styled-components';
Expand All @@ -10,7 +9,6 @@ import FaucetInfo from './FaucetInfo';
import { Button, Item, Span } from 'primaries/SharedStyling';

// Internal Configs
import { abis, addresses, appConfig } from 'config/index.js';
import { useAccount, useAsyncOperation, useDeviceWidthCheck } from 'hooks';
import { device } from 'config/Globals';
import { getPushTokenFromWallet, importPushToken, mintPushToken } from 'helpers';
Expand Down
101 changes: 68 additions & 33 deletions src/components/TransferNFT.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// React + Web3 Essentials
import { ethers } from 'ethers';
import React from "react";
import React from 'react';

// External Packages
import 'react-dropzone-uploader/dist/styles.css';
import styled, { css } from 'styled-components';

// Internal Compoonents
Expand All @@ -12,7 +11,7 @@ import LoaderSpinner, { LOADER_TYPE } from 'components/reusables/loaders/LoaderS
import { useAccount } from 'hooks';

// Internal Configs
import { abis, addresses } from "config/index.js";
import { abis, addresses } from 'config/index.js';

// Create Header
function TransferNFT({ tokenId }) {
Expand All @@ -34,47 +33,60 @@ function TransferNFT({ tokenId }) {

const handleTransferNFT = async (e) => {
if (nftWriteProvider) {
console.info("🚀 ~ file: TransferNFT.js ~ line 64 ~ handleTransferNFT ~ nftWriteProvider", nftWriteProvider)
console.info('🚀 ~ file: TransferNFT.js ~ line 64 ~ handleTransferNFT ~ nftWriteProvider', nftWriteProvider);
e.preventDefault();

if (isEmpty(toAddress)) {
setProcessing(3);
setProcessingInfo("Recipient address field is empty! Please retry!");
setProcessingInfo('Recipient address field is empty! Please retry!');

return false;
}
setProcessing(1);
setProcessingInfo("Transferring NFT...")
setProcessingInfo('Transferring NFT...');
let signer = provider.getSigner(account);
const signerInstance = new ethers.Contract(addresses.rockstar, abis.rockstar, signer)
const signerInstance = new ethers.Contract(addresses.rockstar, abis.rockstar, signer);
var txPromise = nftWriteProvider['safeTransferFrom(address,address,uint256)'](account, toAddress, tokenId);
const tx = await txPromise;
console.debug(tx);
console.info("waiting for tx to finish");
setProcessingInfo("Waiting for Transfer tx to finish...");
console.info('waiting for tx to finish');
setProcessingInfo('Waiting for Transfer tx to finish...');
await provider.waitForTransaction(tx.hash);
setProcessingInfo("Transfer successfull! ");
setProcessingInfo('Transfer successfull! ');
setProcessing(3);
}
}
};

const isEmpty = (field) => {
if (field.trim().length == 0) {
return true;
}
return false;
}
};

return (
<>
<Section>
<Content padding="10px 20px 20px">
<Item align="flex-start">
<H2 textTransform="uppercase" spacing="0.1em">
<H2
textTransform="uppercase"
spacing="0.1em"
>
<Span weight="200">Transfer Your NFT!</Span>
</H2>
<H2 textTransform="uppercase" spacing="0.1em">
<Span bg="#674c9f" color="#fff" weight="600" padding="0px 8px">Token #{tokenId}</Span>
<H2
textTransform="uppercase"
spacing="0.1em"
>
<Span
bg="#674c9f"
color="#fff"
weight="600"
padding="0px 8px"
>
Token #{tokenId}
</Span>
</H2>
</Item>
</Content>
Expand All @@ -90,8 +102,12 @@ function TransferNFT({ tokenId }) {
size="1.1rem"
onSubmit={handleTransferNFT}
>

<Item margin="-10px 20px 15px 20px" flex="1" self="stretch" align="stretch">
<Item
margin="-10px 20px 15px 20px"
flex="1"
self="stretch"
align="stretch"
>
<Input
required
placeholder="Recipient Address"
Expand All @@ -102,9 +118,11 @@ function TransferNFT({ tokenId }) {
size="1.2em"
bg="#fff"
value={toAddress}
onChange={(e) => { setToAddress(e.target.value) }}
onChange={(e) => {
setToAddress(e.target.value);
}}
/>
{toAddress.trim().length == 0 &&
{toAddress.trim().length == 0 && (
<Span
padding="4px 10px"
right="0px"
Expand All @@ -117,35 +135,53 @@ function TransferNFT({ tokenId }) {
>
Recipient Address
</Span>
}
)}
</Item>
<Item margin="15px 0px 0px 0px" flex="1" self="stretch" align="stretch">
<Item
margin="15px 0px 0px 0px"
flex="1"
self="stretch"
align="stretch"
>
<Button
bg='#674c9f'
color='#fff'
bg="#674c9f"
color="#fff"
flex="1"
radius="0px"
padding="20px 10px"
disabled={processing == 1 ? true : false}
>
{processing == 1 &&
<LoaderSpinner type={LOADER_TYPE.SEAMLESS} spinnerSize={24} spinnerColor="#fff" />
}
{processing != 1 &&
<Input cursor="hand" textTransform="uppercase" color="#fff" weight="400" size="0.8em" spacing="0.2em" type="submit" value="Transfer" />
}
{processing == 1 && (
<LoaderSpinner
type={LOADER_TYPE.SEAMLESS}
spinnerSize={24}
spinnerColor="#fff"
/>
)}
{processing != 1 && (
<Input
cursor="hand"
textTransform="uppercase"
color="#fff"
weight="400"
size="0.8em"
spacing="0.2em"
type="submit"
value="Transfer"
/>
)}
</Button>
</Item>
</FormSubmision>
</Content>
</Section>

{(processing == 1 || processing == 3) &&
{(processing == 1 || processing == 3) && (
<Section>
<Content padding="0px 0px 0px 0px">
<Item
color="#fff"
bg={processing == 1 ? "#e1087f" : "#000"}
bg={processing == 1 ? '#e1087f' : '#000'}
padding="10px 15px"
margin="15px 0px"
>
Expand All @@ -159,10 +195,9 @@ function TransferNFT({ tokenId }) {
{processingInfo}
</Span>
</Item>

</Content>
</Section>
}
)}
</>
);
}
Expand Down
Loading

0 comments on commit 34c8f8c

Please sign in to comment.