(null);
const handlePlanetClick = (planetNumber: number) => {
diff --git a/frontend/src/config/routes.tsx b/frontend/src/config/routes.tsx
index 930fe5f..2d60d6b 100644
--- a/frontend/src/config/routes.tsx
+++ b/frontend/src/config/routes.tsx
@@ -33,7 +33,7 @@ export const useNav = () => {
},
{
path: "https://dao.enterprise.money/daos",
- name: "Alliance DAO Staking",
+ name: "Staking",
isExternal: true,
},
]
diff --git a/frontend/src/content/TheStory.mdx b/frontend/src/content/TheStory.mdx
index 8d97df3..6bb5262 100644
--- a/frontend/src/content/TheStory.mdx
+++ b/frontend/src/content/TheStory.mdx
@@ -5,9 +5,9 @@ import styles from './MDX.module.scss';
Millions of years from now, there are ten planets hosting humanoid life. The planets and their inhabitants are wildly different, and none of them know the others exist, isolated by the vast emptiness of space.
-
+
One day, something inexplicable happened. In a flash, hundreds of people on each planet suddenly vanished. They were transported to one of the other planets or to a different location on their home planet. Thousands were displaced and forced to make their way on strange new worlds.
-
+
This occurrence is known simply as “The Warp.”
@@ -36,11 +36,11 @@ import styles from './MDX.module.scss';
The Alliance devices themselves were also lost, and the thoughts of their use, the Last Journey, and the origins of humanity faded from memory. Some planets have ancient structures with inscriptions describing the Last Journey, but their true meaning has been lost as various cultures and religions rewrote their significance.
-
+
## Survival
For the next seven million years, the inhabitants of the ten planets evolved and adapted to their surroundings, each becoming suited to the environment and climate of their homes. Their bodies changed, and so did the plants and animals around them. Ten planets created ten distinct cultures of human descendants, each with its own civilization and technology.
-
+
The populations on each planet varied, though no planet ever became densely populated. Survival was difficult, even after millions of years. A few planets went through periods of near extinction, resetting civilization and beginning the cycle again. Some went through cycles of technological advancement followed by destruction and cultural decimation from wars and natural disasters. Several planets had achieved societal and technological advancements nearly on par with those of Earth. Despite their differences, the planets all had two things in common: none of them knew their origins, and most believed themselves to be the singular source of life across the cosmos.
@@ -63,4 +63,3 @@ import styles from './MDX.module.scss';
-
diff --git a/frontend/src/fakeData/mockNFTs.ts b/frontend/src/fakeData/mockNFTs.ts
index 89abae7..6793ec8 100644
--- a/frontend/src/fakeData/mockNFTs.ts
+++ b/frontend/src/fakeData/mockNFTs.ts
@@ -1,87 +1,99 @@
+export interface NFTType {
+ id: number;
+ planet: string;
+ image: string;
+ biome: string;
+ character: string;
+ object: string;
+ rarityScore: number;
+ rewards: number;
+ claimed: string;
+}
+
export const mockNFTs = [
{
id: 0,
- background_color: "",
+ planet: "Cristall South",
image: "/src/assets/nfts/MOUNTAINS 2 1.png",
biome: "water",
- character: "fire",
- object: "sword",
+ character: "Kitan F",
+ object: "Quartz Ray Gun",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 1,
- background_color: "",
+ planet: "Crutha South",
image: "/src/assets/nfts/MOUNTAINS 2 2.png",
- biome: "water",
- character: "fire",
- object: "sword",
+ biome: "fire",
+ character: "Cristallian F",
+ object: "Sword of Zando",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 2,
- background_color: "",
+ planet: "Kita South",
image: "/src/assets/nfts/MOUNTAINS 2 3.png",
- biome: "water",
- character: "fire",
- object: "sword",
+ biome: "ice",
+ character: "Kitan M",
+ object: "Staff of Zando",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 3,
- background_color: "",
+ planet: "Kita North",
image: "/src/assets/nfts/MOUNTAINS 2 4.png",
- biome: "water",
- character: "fire",
- object: "sword",
+ biome: "jungle",
+ character: "Kitan F",
+ object: "Kitan Ice Staff",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 4,
- background_color: "",
+ planet: "Ozara South",
image: "/src/assets/nfts/MOUNTAINS 2 5.png",
- biome: "water",
- character: "fire",
- object: "sword",
+ biome: "mountain",
+ character: "Pampan M",
+ object: "Cristallian Bow",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 5,
- background_color: "",
+ planet: "Zando North",
image: "/src/assets/nfts/MOUNTAINS 2 1second.png",
- biome: "water",
- character: "fire",
- object: "sword",
+ biome: "meadows",
+ character: "Lusan M",
+ object: "Ice Cleaver",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 6,
- background_color: "",
+ planet: "Sindari North",
image: "/src/assets/nfts/MOUNTAINS 2 2second.png",
- biome: "water",
- character: "fire",
- object: "sword",
+ biome: "asteroid",
+ character: "Sindarin M",
+ object: "Ice Cleaver",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 7,
- background_color: "",
+ planet: "Sindari South",
image: "/src/assets/nfts/MOUNTAINS 2 3second.png",
- biome: "water",
- character: "fire",
+ biome: "flowerbeds",
+ character: "Gredican M",
object: "sword",
rarityScore: 0.4,
rewards: 89.49,
@@ -89,82 +101,82 @@ export const mockNFTs = [
},
{
id: 8,
- background_color: "",
+ planet: "Minas South",
image: "/src/assets/nfts/MOUNTAINS 2 4second.png",
- biome: "water",
- character: "fire",
- object: "sword",
+ biome: "crystal",
+ character: "Kitan F",
+ object: "Pampan Grass Sword",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 9,
- background_color: "",
+ planet: "Ozara South",
image: "/src/assets/nfts/MOUNTAINS 2 5second.png",
- biome: "water",
- character: "fire",
- object: "sword",
+ biome: "desert",
+ character: "Gredican F",
+ object: "Sindarin Fire Staff",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 10,
- background_color: "",
+ planet: "Ozara North",
image: "/src/assets/nfts/MOUNTAINS 2 1third.png",
- biome: "water",
- character: "fire",
- object: "sword",
+ biome: "fire",
+ character: "Gredican F",
+ object: "Phoenix Rising",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 11,
- background_color: "",
+ planet: "Gredica North",
image: "/src/assets/nfts/MOUNTAINS 2 2third.png",
biome: "water",
- character: "fire",
- object: "sword",
+ character: "Cruthan F",
+ object: "Lusan Xtreme Soaker",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 12,
- background_color: "",
+ planet: "Gredica South",
image: "/src/assets/nfts/MOUNTAINS 2 3third.png",
biome: "water",
character: "fire",
- object: "sword",
+ object: "Golden Hammer",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 13,
- background_color: "",
+ planet: "Crutha North",
image: "/src/assets/nfts/MOUNTAINS 2 4third.png",
biome: "water",
- character: "fire",
- object: "sword",
+ character: "Minas M",
+ object: "Sindarin Flame Thrower",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
{
id: 14,
- background_color: "",
+ planet: "Pampas South",
image: "/src/assets/nfts/MOUNTAINS 2 5third.png",
biome: "water",
- character: "fire",
- object: "sword",
+ character: "Minas M",
+ object: "Cruthan Death Mace",
rarityScore: 0.4,
rewards: 89.49,
claimed: "24 December 2023"
},
-];
+] as NFTType[];
export const signedInUserData = {
id: 0,
diff --git a/frontend/src/fakeData/planetsByName.tsx b/frontend/src/fakeData/planetsByName.tsx
new file mode 100644
index 0000000..79a6987
--- /dev/null
+++ b/frontend/src/fakeData/planetsByName.tsx
@@ -0,0 +1,102 @@
+export const planetsByName = {
+ 'Cristall South': {
+ name: 'Cristall South',
+ terrain: 'crystal',
+ inhabitants: 'Cristall',
+ },
+ 'Cristall North': {
+ name: 'Cristall North',
+ terrain: 'crystal',
+ inhabitants: 'Cristall',
+ },
+ 'Crutha South': {
+ name: 'Crutha South',
+ terrain: 'mountain',
+ inhabitants: 'Crutha',
+ },
+ 'Crutha North': {
+ name: 'Crutha North',
+ terrain: 'mountain',
+ inhabitants: 'Crutha',
+ },
+ 'Gredica South': {
+ name: 'Gredica South',
+ terrain: 'flowerbeds',
+ inhabitants: 'Gredica',
+ },
+ 'Gredica North': {
+ name: 'Gredica North',
+ terrain: 'flowerbeds',
+ inhabitants: 'Gredica',
+ },
+ 'Kita South': {
+ name: 'Kita South',
+ terrain: 'ice',
+ inhabitants: 'Kita',
+ },
+ 'Kita North': {
+ name: 'Kita North',
+ terrain: 'ice',
+ inhabitants: 'Kita',
+ },
+ 'Lusa South': {
+ name: 'Lusa South',
+ terrain: 'water',
+ inhabitants: 'Lusa',
+ },
+ 'Lusa North': {
+ name: 'Lusa North',
+ terrain: 'water',
+ inhabitants: 'Lusa',
+ },
+ 'Minas South': {
+ name: 'Minas South',
+ terrain: 'asteroid',
+ inhabitants: 'Minas',
+ },
+ 'Minas North': {
+ name: 'Minas North',
+ terrain: 'asteroid',
+ inhabitants: 'Minas',
+ },
+ 'Ozara South': {
+ name: 'Ozara South',
+ terrain: 'desert',
+ inhabitants: 'Ozara',
+ },
+ 'Ozara North': {
+ name: 'Ozara North',
+ terrain: 'desert',
+ inhabitants: 'Ozara',
+ },
+ 'Pampas South': {
+ name: 'Pampas South',
+ terrain: 'meadows',
+ inhabitants: 'Pampas',
+ },
+ 'Pampas North': {
+ name: 'Pampas North',
+ terrain: 'meadows',
+ inhabitants: 'Pampas',
+ },
+ 'Sindari South': {
+ name: 'Sindari South',
+ terrain: 'fire',
+ inhabitants: 'Sindari',
+ },
+ 'Sindari North': {
+ name: 'Sindari North',
+ terrain: 'fire',
+ inhabitants: 'Sindari',
+ },
+ 'Zando South': {
+ name: 'Zando South',
+ terrain: 'jungle',
+ inhabitants: 'Zando',
+ },
+ 'Zando North': {
+ name: 'Zando North',
+ terrain: 'jungle',
+ inhabitants: 'Zando',
+ },
+};
\ No newline at end of file
diff --git a/frontend/src/pages/nft-view/NFTViewMobile.tsx b/frontend/src/pages/nft-view/NFTViewMobile.tsx
index d4eac98..699d87d 100644
--- a/frontend/src/pages/nft-view/NFTViewMobile.tsx
+++ b/frontend/src/pages/nft-view/NFTViewMobile.tsx
@@ -4,7 +4,6 @@ import styles from './NFTViewMobile.module.scss';
interface NFTViewProps {
nft: {
id: number;
- background_color: string;
image: string;
biome: string;
character: string;
@@ -61,7 +60,7 @@ export const NFTViewMobile = ({ nft }: NFTViewProps) => {
-
+
diff --git a/frontend/src/pages/nft/NFTs.module.scss b/frontend/src/pages/nft/NFTs.module.scss
index 2ab8b76..b710a41 100644
--- a/frontend/src/pages/nft/NFTs.module.scss
+++ b/frontend/src/pages/nft/NFTs.module.scss
@@ -1,54 +1,81 @@
.main {
+ display: flex;
padding: 24px 80px;
- .buttons {
- display: flex;
- align-items: center;
- gap: 40px;
- margin-bottom: 32px;
-
- .button {
- color: #797979;
- font-size: 18px;
- font-weight: 600;
- position: relative;
- margin-bottom: 10px;
-
- .button__count {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 20px;
- width: 20px;
- border-radius: 8px;
- background: #797979;
- color: var(--token-light-800, #F1EEE9);
- text-align: center;
- font-size: 14px;
- font-weight: 700;
- margin-left: 11px;
- }
+ .facet__space {
+ flex: 0 0 0;
+ }
+
+ &.facet__closed {
+ .facet__space {
+ flex: 0 0 0;
+ transition: flex-basis 0.5s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ }
+
+ &.facet__open {
+ .facet__space {
+ flex: 0 0 20%;
+ transition: flex-basis 0.5s cubic-bezier(0.22, 1, 0.36, 1);
+ }
+ }
+
+ .main__content {
+ flex: 1 1 0;
- &::before {
- position: absolute;
- content: "";
- width: 0;
- height: 2px;
- background: var(--token-primary-500, #00C2FF);
- left: 50%;
- bottom: -10px;
- transform: translateX(-50%);
- border-radius: 10px;
- transition: all .2s ease;
- opacity: 0;
+ .buttons {
+ display: flex;
+ align-items: center;
+ gap: 40px;
+ margin-bottom: 32px;
+
+ svg {
+ margin-bottom: 8px;
}
- &.button__selected {
- color: var(--token-dark-500, #2F2E2D);
+ .button {
+ color: #797979;
+ font-size: 18px;
+ font-weight: 600;
+ position: relative;
+ margin-bottom: 10px;
+
+ .button__count {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 20px;
+ width: 20px;
+ border-radius: 8px;
+ background: #797979;
+ color: var(--token-light-800, #F1EEE9);
+ text-align: center;
+ font-size: 14px;
+ font-weight: 700;
+ margin-left: 11px;
+ }
&::before {
- width: 100%;
- opacity: 1;
+ position: absolute;
+ content: "";
+ width: 0;
+ height: 2px;
+ background: var(--token-primary-500, #00C2FF);
+ left: 50%;
+ bottom: -10px;
+ transform: translateX(-50%);
+ border-radius: 10px;
+ transition: all .2s ease;
+ opacity: 0;
+ }
+
+ &.button__selected {
+ color: var(--token-dark-500, #2F2E2D);
+
+ &::before {
+ width: 100%;
+ opacity: 1;
+ }
}
}
}
diff --git a/frontend/src/pages/nft/NFTs.tsx b/frontend/src/pages/nft/NFTs.tsx
index 256cab2..be170f9 100644
--- a/frontend/src/pages/nft/NFTs.tsx
+++ b/frontend/src/pages/nft/NFTs.tsx
@@ -1,49 +1,140 @@
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
import classNames from 'classnames/bind';
import NFTItem from 'components/nft/NFTItem';
-import styles from './NFTs.module.scss';
+import { filterNFTs } from 'components/filters/helpers';
+import { FilterDropdowns } from 'components/filters/dropdowns';
+import { ReactComponent as FilterIcon } from 'assets/Filter.svg';
import { mockNFTs, signedInUserData } from 'fakeData/mockNFTs';
+import styles from './NFTs.module.scss';
+import { SearchByID } from 'components/filters/search/SearchByID';
const cx = classNames.bind(styles);
+export interface GalleryFiltersProps {
+ planetNumber: number | null
+ planetNames: string[]
+ planetInhabitants: string[]
+ nftObjects: string[]
+}
+
export const NFTsPage = () => {
- const [isMyNFTSelected, setIsMyNFTSelected] = useState(false);
+ const [showFilterRow, setShowFilterRow] = useState(false);
+ const [searchValue, setSearchValue] = useState('');
+ const [searchLoading, setSearchLoading] = useState(false);
+
+ const [activeTab, setActiveTab] = useState('all');
+ const [galleryFilters, setGalleryFilters] = useState({
+ planetNumber: null,
+ planetNames: [],
+ planetInhabitants: [],
+ nftObjects: [],
+ });
+
+ const [displayedNFTs, setDisplayedNFTs] = useState(mockNFTs);
+
+ useEffect(() => {
+ if (!galleryFilters.planetNames.length && !galleryFilters.planetInhabitants.length && !galleryFilters.nftObjects.length) {
+ setDisplayedNFTs(mockNFTs);
+ return;
+ }
+
+ const filtered = filterNFTs(mockNFTs, galleryFilters);
+ setDisplayedNFTs(filtered);
+ }, [galleryFilters]);
+
+ useEffect(() => {
+ if (!searchValue) {
+ setSearchLoading(false);
+ setDisplayedNFTs(mockNFTs);
+ return;
+ }
+
+ setSearchLoading(true);
+ setTimeout(() => {
+ const filtered = mockNFTs.filter(nft => nft.id.toString() === searchValue);
+ setDisplayedNFTs(filtered);
+ setSearchLoading(false);
+ }, 1000)
+
+ }, [searchValue]);
+
+ const handleSwitch = (tab: string) => {
+ if (tab === 'all' && activeTab === 'all') {
+ return;
+ } else if (tab === 'my' && activeTab === 'my') {
+ return;
+ }
+
+ if (tab === 'all') {
+ setActiveTab('all');
+ setShowFilterRow(false);
+ } else {
+ setActiveTab('my');
+ setShowFilterRow(false);
+ }
+ }
return (
-
- setIsMyNFTSelected(false)}
- >
- All NFTs
-
- setIsMyNFTSelected(true)}
- >
- My NFTs
- {signedInUserData.nftIDs.length}
-
-
- {!isMyNFTSelected ? (
-
- {mockNFTs.map(nft => (
-
- ))}
+
+
+ {activeTab === 'all' && (
+ setShowFilterRow(!showFilterRow)}
+ >
+
+
+ )}
+ handleSwitch('all')}
+ >
+ All NFTs
+
+ handleSwitch('my')}
+ >
+ My NFTs
+ {signedInUserData.nftIDs.length}
+
- ) : (
-
- {signedInUserData.nftIDs.map(nft => (
-
+
- ))}
-
- )}
+
+ >
+ )}
+
+ {activeTab === 'all' ? (
+
+ {displayedNFTs.map(nft => (
+
+ ))}
+
+ ) : (
+
+ {signedInUserData.nftIDs.map(nft => (
+
+ ))}
+
+ )}
+
);
};
diff --git a/frontend/src/styles/_reboot.scss b/frontend/src/styles/_reboot.scss
index 9116c74..ff88a86 100644
--- a/frontend/src/styles/_reboot.scss
+++ b/frontend/src/styles/_reboot.scss
@@ -137,7 +137,7 @@ select {
input,
textarea {
- width: 100%;
+ // width: 100%;
}
textarea {