diff --git a/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/Loading/index.tsx b/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/Loading/index.tsx
index 9afac96..aefb7c1 100644
--- a/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/Loading/index.tsx
+++ b/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/Loading/index.tsx
@@ -1,7 +1,7 @@
import React from 'react'
import { Box, Dialog as MuiDialog, Typography } from '@mui/material'
import { useSelector } from 'react-redux'
-import { Oval as OvalLoader } from 'svg-loaders-react'
+import ClipLoader from "react-spinners/ClipLoader";
import { RootState } from '../../../../../store'
import { COLORS } from '../../../../../../core/theme/colors'
@@ -24,7 +24,7 @@ const Loading = () => {
}}>
{message ?
- {loadingSpinner ? : null}
+ {loadingSpinner ? : null}
{message}
: null}
diff --git a/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/WalletSelector/index.tsx b/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/WalletSelector/index.tsx
index 4c8600c..16246b2 100644
--- a/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/WalletSelector/index.tsx
+++ b/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/WalletSelector/index.tsx
@@ -3,7 +3,7 @@ import { Box, Tooltip, Typography, Dialog as MuiDialog, MenuItem, Select } from
import { LoadingButton } from '@mui/lab'
import { ThreeDots as ThreeDotsLoading } from 'svg-loaders-react'
import { useDispatch, useSelector } from 'react-redux'
-import { Oval as OvalLoader } from 'svg-loaders-react'
+import ClipLoader from "react-spinners/ClipLoader";
import {
detectUserBrowser,
@@ -256,7 +256,7 @@ const WalletSelector = () => {
{selectChainId ?
- {loadSelectChainId ? :
+ {loadSelectChainId ? :
:
- {loadSelectChainId ? :
+ {loadSelectChainId ? :
{getSupportedWallets().map((wallet, idx) => {
return (
diff --git a/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/WalletSelector/styles.ts b/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/WalletSelector/styles.ts
index bdcb89a..d5121d5 100644
--- a/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/WalletSelector/styles.ts
+++ b/apps/frontend/src/core/presentation/components/Dialog/ModalComponents/WalletSelector/styles.ts
@@ -27,7 +27,6 @@ export const styles = {
width: '50px',
height: '50px',
margin: '37px 0px',
- stroke: COLORS.LIGHT_BLUE[90]
},
pluginWarning: {
maxWidth: '550px',
diff --git a/apps/frontend/src/core/presentation/components/Layout/helpers.tsx b/apps/frontend/src/core/presentation/components/Layout/helpers.tsx
index f210f92..8683fa8 100644
--- a/apps/frontend/src/core/presentation/components/Layout/helpers.tsx
+++ b/apps/frontend/src/core/presentation/components/Layout/helpers.tsx
@@ -1,9 +1,9 @@
-import React from 'react';
+import React, { CSSProperties } from 'react';
import SVG from 'react-inlinesvg';
import moment from "moment";
import { Box, Divider } from '@mui/material';
import { JdenticonConfig, toSvg } from 'jdenticon';
-import { Oval as OvalLoader } from 'svg-loaders-react'
+import ClipLoader from "react-spinners/ClipLoader";
import { APP_DETAILS } from '../../../utilities/Constants';
import { COLORS } from '../../../theme/colors';
@@ -282,6 +282,8 @@ export const SVG_FRAMES = {
frame1674: frame1674
}
+
export const StyledPuffLoader = () => {
- return
+ const override: CSSProperties = generalStyles.spinner;
+ return
}
diff --git a/apps/frontend/src/core/presentation/components/SearchBar/index.tsx b/apps/frontend/src/core/presentation/components/SearchBar/index.tsx
index c385082..ba66e30 100644
--- a/apps/frontend/src/core/presentation/components/SearchBar/index.tsx
+++ b/apps/frontend/src/core/presentation/components/SearchBar/index.tsx
@@ -1,6 +1,6 @@
import React, { Fragment, useEffect, useRef, useState } from "react"
import { useDispatch, useSelector } from "react-redux"
-import { Box, Divider, Fade, Input, MenuItem, Select, Tooltip, Typography } from "@mui/material"
+import { Box, Divider, Fade, Input, MenuItem, Select, SelectChangeEvent, Tooltip, Typography } from "@mui/material"
import { CancelRounded } from '@mui/icons-material'
import { getCosmosNetworkPrettyName } from "cudosjs"
@@ -17,14 +17,15 @@ const SearchBar = ({ networks, displayDataLength }: { networks: string[], displa
const dispatch = useDispatch()
const searchBar = useRef()
- const chainSelector = useRef()
+ const chainSelector = useRef()
+ const hide = useRef()
const { searchTerms, appliedFilter, ascendingOrder, chainFilter, activeSearch } = useSelector((state: RootState) => state.searchState)
const [filterOpen, setFilterOpen] = useState(false)
const [displaySortingIcon, setDisplaySortingIcon] = useState(true)
const [dropDownOpen, setDropDownOpen] = useState(false)
- const [expandChainSelector, setExpandChainSelector] = useState(false)
const [showChainSelectorCloseIcon, setChainSelectorCloseIcon] = useState(false)
const [chainSelectorPlaceholder, setChainSelectorPlaceholder] = useState('')
+ const [chainSelectorOpen, setChainSelectorOpen] = useState(false)
const [showSearchBarCloseIcon, setShowSearchBarCloseIcon] = useState(false)
const [expandSearchBar, setExpandSearchBar] = useState(false)
@@ -32,6 +33,16 @@ const SearchBar = ({ networks, displayDataLength }: { networks: string[], displa
const invalidSearch = expandSearchBar && !displayDataLength && !!searchTerms
+ const estimateStringWidth = (string: string, fontSize: string) => {
+ const element = document.createElement('span');
+ element.innerHTML = string;
+ element.style.fontSize = fontSize;
+ document.body.appendChild(element);
+ const width = element.getBoundingClientRect().width;
+ document.body.removeChild(element);
+ return width;
+ }
+
const hasScrollbar = () => {
return document.documentElement.scrollHeight > document.documentElement.clientHeight;
};
@@ -58,30 +69,42 @@ const SearchBar = ({ networks, displayDataLength }: { networks: string[], displa
}
//CHAIN SELECTOR
- const handleChainSelectorTransitionEnd = () => {
- if (expandChainSelector) {
- chainSelector.current?.click()
- setChainSelectorCloseIcon(true)
- setChainSelectorPlaceholder('Select Network')
+ const handleNetworkFilterChange = (e: SelectChangeEvent, child: React.ReactNode) => {
+ if (hide.current) {
+ hide.current.style.opacity = '0'
}
- }
+ const width = estimateStringWidth(e.target.value, '16px');
+ dispatch(updateSearchState({ chainFilter: e.target.value }));
+ setTimeout(() => {
+ chainSelector.current.style.width = `${width + 80}px`;
- const handleExpandChainSelector = () => {
- setExpandChainSelector(true)
+ }, 200);
+ setTimeout(() => {
+ hide.current.style.opacity = '1'
+ }, 600)
}
- const handleShrinkChainSelector = () => {
- if (expandChainSelector) {
- setExpandChainSelector(false)
- setChainSelectorCloseIcon(false)
+ const handleExpandChainSelector = () => {
+ if (!chainSelectorOpen) {
+ chainSelector.current.style.width = '195px'
setTimeout(() => {
- dispatch(updateSearchState({
- chainFilter: ''
- }))
+ setChainSelectorCloseIcon(true)
+ setChainSelectorPlaceholder('Select Network')
+ setChainSelectorOpen(true)
}, 300)
}
}
+ const handleShrinkChainSelector = () => {
+ dispatch(updateSearchState({ chainFilter: '' }))
+ setChainSelectorPlaceholder('')
+ setChainSelectorCloseIcon(false)
+ setChainSelectorOpen(false)
+ setTimeout(() => {
+ chainSelector.current.style.width = '48px'
+ }, 100)
+ }
+
//SEARCH BAR
const handleSearchBarTransitionEnd = () => {
if (expandSearchBar) {
@@ -117,15 +140,6 @@ const SearchBar = ({ networks, displayDataLength }: { networks: string[], displa
//eslint-disable-next-line
}, [showSearchBarCloseIcon])
- useEffect(() => {
- if (!showChainSelectorCloseIcon) {
- setChainSelectorPlaceholder('')
- handleShrinkChainSelector()
- }
-
- //eslint-disable-next-line
- }, [showChainSelectorCloseIcon])
-
return (
-
+ setDropDownOpen(true) : null} sx={{ display: 'flex', marginLeft: '-9px' }}>
diff --git a/apps/frontend/src/features/allowlists/presentation/components/CreateAllowlistForm.tsx b/apps/frontend/src/features/allowlists/presentation/components/CreateAllowlistForm.tsx
index 801a4bc..eb295a7 100644
--- a/apps/frontend/src/features/allowlists/presentation/components/CreateAllowlistForm.tsx
+++ b/apps/frontend/src/features/allowlists/presentation/components/CreateAllowlistForm.tsx
@@ -156,10 +156,12 @@ const CreateAllowlistForm = () => {
variant='subtitle2'
color={COLORS.STEEL_GRAY[20]}
>
- This image will be used as profile image on your allowlist page. 350 x 350 recommended.
+ This image will be used as profile image on your allowlist page. 350 x 350 recommended (max 0.3mb in size)
alert('Invalid size')}
handleChange={(file: Blob) => dispatch(updateAllowlistObject({ image: file }))}
types={acceptedImgTypes}
children={
@@ -195,9 +197,11 @@ const CreateAllowlistForm = () => {
variant='subtitle2'
color={COLORS.STEEL_GRAY[20]}
>
- This image will appear at the top of your allow list page. 1400 x 400 px recommended.
+ This image will appear at the top of your allow list page. 1400 x 400 px recommended. (max 0.5mb in size)
alert('Invalid')}
+ maxSize={0.5}
handleChange={(file: Blob) => dispatch(updateAllowlistObject({ banner_image: file }))}
types={acceptedImgTypes}
children={
diff --git a/apps/frontend/src/features/allowlists/presentation/components/GridCardContent.tsx b/apps/frontend/src/features/allowlists/presentation/components/GridCardContent.tsx
index 5dff88a..df89e0d 100644
--- a/apps/frontend/src/features/allowlists/presentation/components/GridCardContent.tsx
+++ b/apps/frontend/src/features/allowlists/presentation/components/GridCardContent.tsx
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react"
-import { Oval as OvalLoader } from 'svg-loaders-react'
+import ClipLoader from "react-spinners/ClipLoader";
import { Box, Typography } from "@mui/material"
import { COLORS } from "../../../../core/theme/colors"
@@ -26,13 +26,13 @@ const GridCardContent = ({ allowlist, width }: { allowlist: FetchedAllowlist, wi
useEffect(() => {
if (allowlist.banner_image) {
- setBlobToB64Img(allowlist.banner_image, setBanner)
+ setBlobToB64Img(allowlist.banner_image, setBanner, { MAX_WIDTH: 284, MAX_HEIGHT: 210 })
} else {
setBanner('')
}
if (allowlist.image) {
- setBlobToB64Img(allowlist.image, setAvatar)
+ setBlobToB64Img(allowlist.image, setAvatar, { MAX_WIDTH: 128, MAX_HEIGHT: 128 })
} else {
setAvatar('')
}
@@ -65,7 +65,7 @@ const GridCardContent = ({ allowlist, width }: { allowlist: FetchedAllowlist, wi
return (
navigateToRoute(`/allowlist/${allowlist.url}`)} sx={{ ...generalStyles.gridDataBox, width: width, minWidth: width }}>
- {contentLoaded() ? null : }
+ {contentLoaded() ? null : }
{
return (
- {activeSearch ? :
+ {activeSearch ? :
{
}
//HANDLING TWITTER REQUIREMENTS
- if (isTwitterRequired && !!connectedSocialMedia.twitter.id) {
+ if (isTwitterRequired && !!connectedSocialMedia.twitter?.id) {
//If page to follow
if (!!props.twitter_account_to_follow) {
const isFollowingAcc = await IS_FOLLOWING_TWITTER_ACCOUNT(connectedSocialMedia.twitter.id, props.twitter_account_to_follow)
@@ -206,7 +206,7 @@ const UserView = ({ props }: { props: FetchedAllowlist }) => {
}
}, [props.id, connectedAddress, connectedSocialMedia.discord.id, connectedSocialMedia.twitter.id])
- return loading ? : (
+ return loading ? : (
diff --git a/apps/frontend/src/features/allowlists/presentation/components/helpers.tsx b/apps/frontend/src/features/allowlists/presentation/components/helpers.tsx
index cf3e93d..a25fd8a 100644
--- a/apps/frontend/src/features/allowlists/presentation/components/helpers.tsx
+++ b/apps/frontend/src/features/allowlists/presentation/components/helpers.tsx
@@ -14,7 +14,7 @@ import useSocialMedia from "../../../../core/utilities/CustomHooks/useSocialMedi
import { getTimeFromNumber } from "../../../../core/utilities/ProjectUtils";
import { LinkBox } from "../../../../core/theme/helpers";
import { updateModalState } from "../../../../core/store/modals";
-import { Oval as OvalLoader } from 'svg-loaders-react'
+import ClipLoader from "react-spinners/ClipLoader";
import { headerStyles } from "../../../../core/presentation/components/Layout/styles";
import { allowlistPreviewStyles, allowListStyles, menuStyles } from "./styles";
@@ -263,7 +263,7 @@ export const SocialMediaBoxes = ({
const getCheckBox = (action: SocialMediaAction[]) => {
if (ongoingEligibilityCheck) {
- return
+ return
}
return
}
- if (Object.keys(allowlist || {}).length) {
- return
+ if (allowlist && Object.keys(allowlist).length) {
+ return
}
}, [loading, allowlist])
@@ -31,7 +31,7 @@ function AllowlistPage() {
try {
setLoading(true)
const res = await GET_ALLOWLIST_DETAILS(id)
- const data = res.data;
+ let data = res.data;
delete data.createdAt;
delete data.updatedAt;
if (data.discord_invite_link) {
@@ -40,6 +40,7 @@ function AllowlistPage() {
data.server_role = await getServerRoleNameByRoleId(data.discord_invite_link, data.server_role)
}
}
+ data = { ...data, end_date: new Date(data.end_date) }
setAllowlist(data);
} catch (error) {
diff --git a/apps/frontend/src/features/allowlists/presentation/pages/CreateAllowlist.tsx b/apps/frontend/src/features/allowlists/presentation/pages/CreateAllowlist.tsx
index 437fda1..76b1e2c 100644
--- a/apps/frontend/src/features/allowlists/presentation/pages/CreateAllowlist.tsx
+++ b/apps/frontend/src/features/allowlists/presentation/pages/CreateAllowlist.tsx
@@ -36,20 +36,22 @@ const CreateAllowlistPage = () => {
const cleanUp = () => {
dispatch(updateAllowlistObject(initialAllowlistState))
- dispatch(updateUser({
- connectedSocialMedia: {
- twitter: {
- id: connectedSocialMedia.twitter.id,
- userName: connectedSocialMedia.twitter.userName,
- guild: emptyGuildInfo
- },
- discord: {
- id: connectedSocialMedia.discord.id,
- userName: connectedSocialMedia.discord.userName,
- guild: emptyGuildInfo
+ if (connectedSocialMedia && (connectedSocialMedia.twitter || connectedSocialMedia.discord)) {
+ dispatch(updateUser({
+ connectedSocialMedia: {
+ twitter: {
+ id: connectedSocialMedia.twitter ? connectedSocialMedia.twitter.id : '',
+ userName: connectedSocialMedia.twitter ? connectedSocialMedia.twitter.userName : '',
+ guild: emptyGuildInfo
+ },
+ discord: {
+ id: connectedSocialMedia.discord ? connectedSocialMedia.discord.id : '',
+ userName: connectedSocialMedia.discord ? connectedSocialMedia.discord.userName : '',
+ guild: emptyGuildInfo
+ }
}
- }
- }))
+ }))
+ }
}
// CLEAN-UP
diff --git a/apps/frontend/src/features/allowlists/presentation/pages/styles.ts b/apps/frontend/src/features/allowlists/presentation/pages/styles.ts
index ebd6af6..770e70c 100644
--- a/apps/frontend/src/features/allowlists/presentation/pages/styles.ts
+++ b/apps/frontend/src/features/allowlists/presentation/pages/styles.ts
@@ -160,10 +160,8 @@ export const generalStyles = {
background: COLORS.STEEL_GRAY[100]
},
spinner: {
- width: '40px',
- height: '80vh',
+ marginTop: '40vh',
display: 'flex',
alignSelf: 'center',
- stroke: COLORS.LIGHT_BLUE[90]
}
}
diff --git a/apps/frontend/src/features/app-routes/presentation/components/Home/index.tsx b/apps/frontend/src/features/app-routes/presentation/components/Home/index.tsx
index 321ed3f..8c7fea0 100644
--- a/apps/frontend/src/features/app-routes/presentation/components/Home/index.tsx
+++ b/apps/frontend/src/features/app-routes/presentation/components/Home/index.tsx
@@ -1,25 +1,45 @@
-import React from 'react';
+import React, { Suspense, lazy } from 'react';
import { Box } from '@mui/material';
+import ClipLoader from "react-spinners/ClipLoader";
-import Features from './Features';
-import MainCard from './MainCard';
-import LowerSection from './LowerSection';
+const FeaturesPreview = lazy(() => import('./Features'));
+const MainCardPreview = lazy(() => import('./MainCard'));
+const LowerSectionPreview = lazy(() => import('./LowerSection'));
import { homeStyles } from './styles';
+import { COLORS } from '../../../../../core/theme/colors';
+import { GradientText } from '../../../../../core/theme/helpers';
+const InitialLoading = () => {
+ return (
+
+
+
+ )
+}
const Home = () => {
-
return (
-
-
-
-
-
-
+ }>
+
+
+
+
+
+
+
);
};
diff --git a/package-lock.json b/package-lock.json
index fc7ed0f..a1f288a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -53,6 +53,7 @@
"react-redux": "^8.0.2",
"react-responsive": "^9.0.2",
"react-scroll-parallax": "^3.3.2",
+ "react-spinners": "^0.13.8",
"redux": "^4.2.0",
"redux-persist": "^6.0.0",
"reflect-metadata": "^0.1.13",
@@ -16629,6 +16630,15 @@
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
},
+ "node_modules/react-spinners": {
+ "version": "0.13.8",
+ "resolved": "https://registry.npmjs.org/react-spinners/-/react-spinners-0.13.8.tgz",
+ "integrity": "sha512-3e+k56lUkPj0vb5NDXPVFAOkPC//XyhKPJjvcGjyMNPWsBKpplfeyialP74G7H7+It7KzhtET+MvGqbKgAqpZA==",
+ "peerDependencies": {
+ "react": "^16.0.0 || ^17.0.0 || ^18.0.0",
+ "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
"node_modules/react-transition-group": {
"version": "4.4.5",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
@@ -32077,6 +32087,12 @@
"react-transition-group": "^4.3.0"
}
},
+ "react-spinners": {
+ "version": "0.13.8",
+ "resolved": "https://registry.npmjs.org/react-spinners/-/react-spinners-0.13.8.tgz",
+ "integrity": "sha512-3e+k56lUkPj0vb5NDXPVFAOkPC//XyhKPJjvcGjyMNPWsBKpplfeyialP74G7H7+It7KzhtET+MvGqbKgAqpZA==",
+ "requires": {}
+ },
"react-transition-group": {
"version": "4.4.5",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
diff --git a/package.json b/package.json
index 5f7f9e4..f3d95b2 100644
--- a/package.json
+++ b/package.json
@@ -68,6 +68,7 @@
"react-redux": "^8.0.2",
"react-responsive": "^9.0.2",
"react-scroll-parallax": "^3.3.2",
+ "react-spinners": "^0.13.8",
"redux": "^4.2.0",
"redux-persist": "^6.0.0",
"reflect-metadata": "^0.1.13",
diff --git a/webpack-frontend.config.js b/webpack-frontend.config.js
index 19209f9..34594f5 100644
--- a/webpack-frontend.config.js
+++ b/webpack-frontend.config.js
@@ -60,7 +60,25 @@ module.exports = function () {
mode: process.env.NODE_ENV,
externals: [],
devtool: devTool,
- optimization,
+ optimization: {
+ ...optimization,
+ splitChunks: {
+ chunks: 'all',
+ minSize: 30000,
+ maxSize: 100000,
+ minChunks: 1,
+ maxAsyncRequests: 5,
+ maxInitialRequests: 3,
+ automaticNameDelimiter: '~',
+ cacheGroups: {
+ vendor: {
+ test: /[\\/]node_modules[\\/]/,
+ name: 'vendor',
+ chunks: 'all',
+ },
+ },
+ },
+ },
entry: Path.join(srcPath, 'main.tsx'),
output: {
filename: '[name]-[fullhash].js',