Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit 04d16bc

Browse files
committed
pull in pr
1 parent 9852b3c commit 04d16bc

File tree

28 files changed

+508
-344
lines changed

28 files changed

+508
-344
lines changed

packages/frontend/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ yarn-error.log*
2626

2727
# editors
2828
.idea
29+
30+
# local .env
31+
.env
32+
.env.local

packages/frontend/.husky/pre-commit

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/frontend/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14.17.6

packages/frontend/_tests_/Footer/index.test.jsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

packages/frontend/_tests_/utils/testCommons.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/frontend/cypress.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ export default defineConfig({
88
return require('./cypress/plugins/index.js')(on, config);
99
},
1010
baseUrl: 'http://localhost:3000/',
11-
video: false,
1211
},
1312
});

packages/frontend/cypress/e2e/home.cy.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/// <reference types="cypress" />
2+
3+
describe.skip('NFT Search', () => {
4+
it('Shows first token when loading, can search for another token', () => {
5+
cy.visit('/');
6+
7+
// display NFT of first token
8+
cy.findDeveloperNft(
9+
'macOS, Brackets, White Tanktop, Scala, Government, Kisumu, Divergent, JonGold',
10+
).should('exist');
11+
12+
// search for another token and display NFT
13+
cy.findByRole('textbox', { name: /search/i })
14+
.clear()
15+
.type('5555');
16+
cy.location('search').should('eq', '?id=5555');
17+
cy.findDeveloperNft(
18+
'Kali Linux, Brackets, Patagonia Vest, ArnoldC, Environmental, Bucharest, Anarchist, Cosmic',
19+
).should('exist');
20+
});
21+
22+
it('Shows NFT for token from the url', () => {
23+
cy.visit('/?id=200');
24+
cy.findDeveloperNft(
25+
'Linux Mint, Coda, Bubble Gum Wrapper, Whitespace, Farming, Kisumu, Analytical, Kind',
26+
).should('exist');
27+
});
28+
});

packages/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@
7171
"typechain": "^6.0.2",
7272
"typescript": "^4.4.3"
7373
}
74-
}
74+
}

packages/frontend/src/Components/Footer/index.tsx

Lines changed: 50 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ import {
33
ButtonGroup,
44
Flex,
55
Image,
6-
Link,
6+
Link as ChakraLink,
77
SimpleGrid,
88
Stack,
99
Text,
1010
useColorMode,
1111
} from '@chakra-ui/react';
12-
import { ReactNode } from 'react';
12+
import { FC, ReactNode, useCallback } from 'react';
1313
import { FaDiscord, FaGithub, FaTwitter, FaYoutube } from 'react-icons/fa';
1414
import { IconOpenSea } from '../OpenSea';
15+
import { Footer, Media, Link, SocialLinkName } from '../../types';
16+
import { NEXT_PUBLIC_CMS_URL } from '../../utils';
17+
import { TFunction, useTranslation } from 'next-i18next';
1518

1619
const ListHeader = ({ children }: { children: ReactNode }) => {
1720
return (
@@ -21,35 +24,60 @@ const ListHeader = ({ children }: { children: ReactNode }) => {
2124
);
2225
};
2326

24-
type link = {
25-
href: string;
26-
text: string;
27-
};
28-
29-
const ListLinks = (links: link[]) => {
27+
const listLinks = (links: Link[], translate: TFunction) => {
3028
return (
3129
<>
32-
{links.map((link: link, key) => {
30+
{links.map((link) => {
3331
return (
34-
<Link
35-
key={key}
32+
<ChakraLink
33+
key={link.id}
3634
textDecoration="underline"
3735
fontSize="1.3rem"
3836
color="#C3C3C3"
3937
_hover={{ textDecoration: 'none' }}
40-
href={link.href}
38+
href={link.link}
4139
isExternal
4240
>
43-
{link.text}
44-
</Link>
41+
{translate(link.title)}
42+
</ChakraLink>
4543
);
4644
})}
4745
</>
4846
);
4947
};
5048

51-
const Footer = () => {
49+
type FooterProps = {
50+
data: Footer;
51+
};
52+
53+
const Footer: FC<FooterProps> = ({ data: footer }) => {
5254
const { colorMode } = useColorMode();
55+
const { t } = useTranslation();
56+
57+
// // todo: use when footer would have logo-light/dark
58+
// const getLogoSrc = useCallback(
59+
// (logo?: Media) =>
60+
// logo?.provider === 'local'
61+
// ? `${NEXT_PUBLIC_CMS_URL}${logo?.url}`
62+
// : logo?.url,
63+
// [],
64+
// );
65+
66+
const getSocialIcon = useCallback(
67+
(name: SocialLinkName) => {
68+
return {
69+
twitter: <FaTwitter aria-label="Twitter" />,
70+
discord: <FaDiscord aria-label="Discord" />,
71+
github: <FaGithub aria-label="Github" />,
72+
youtube: <FaYoutube aria-label="Youtube" />,
73+
opensea: (
74+
<IconOpenSea color={colorMode === 'dark' ? 'white' : 'black'} />
75+
),
76+
}[name];
77+
},
78+
[colorMode],
79+
);
80+
5381
return (
5482
<Box pt="6rem" pb="5.875rem" width="100%">
5583
<SimpleGrid
@@ -81,66 +109,20 @@ const Footer = () => {
81109

82110
<Stack align={'flex-start'} paddingTop="1.4375rem">
83111
<ListHeader>Useful Links</ListHeader>
84-
{ListLinks([
85-
{
86-
href: 'https://developerdao.notion.site/developerdao/Developer-DAO-Wiki-eff4dcb00bef46fbaa93e9e4cf940e2e',
87-
text: 'Wiki',
88-
},
89-
{
90-
href: 'https://forum.developerdao.com/',
91-
text: 'Forum',
92-
},
93-
{
94-
href: 'https://snapshot.org/#/devdao.eth',
95-
text: 'Snapshot',
96-
},
97-
{
98-
href: 'https://airtable.com/shrYLrOrjhOHJUdVl',
99-
text: 'Become a partner',
100-
},
101-
])}
112+
{listLinks(footer?.useful_links!, t)}
102113
</Stack>
103114
<Stack align={'flex-start'} paddingTop="1.4375rem">
104115
<ListHeader>Discover</ListHeader>
105-
{ListLinks([
106-
{
107-
href: 'https://devdao.mirror.xyz/',
108-
text: 'Blog',
109-
},
110-
{
111-
href: 'https://developerdao.notion.site/Newsletter-d9c971f2bea446338624042ea20547f9',
112-
text: 'Newsletter',
113-
},
114-
{
115-
href: 'https://developerdao.notion.site/Projects-c2240a6c0b0c41bea285f1ef9629f6db',
116-
text: 'Projects',
117-
},
118-
])}
116+
{listLinks(footer?.discover!, t)}
119117
</Stack>
120118
<Stack align={'flex-start'} paddingTop="1.4375rem">
121119
<ListHeader>Social</ListHeader>
122120
<ButtonGroup>
123-
<Link target={'_blank'} href="https://twitter.com/developer_dao">
124-
<FaTwitter aria-label="Twitter" />
125-
</Link>
126-
<Link target={'_blank'} href="https://t.co/k407RuG8eV">
127-
<FaDiscord aria-label="Discord" />
128-
</Link>
129-
<Link target={'_blank'} href="https://github.com/Developer-DAO">
130-
<FaGithub aria-label="Github" />
131-
</Link>
132-
<Link
133-
target={'_blank'}
134-
href="hhttps://www.youtube.com/c/DeveloperDAO"
135-
>
136-
<FaYoutube aria-label="Youtube" />
137-
</Link>
138-
<Link
139-
target="_blank"
140-
href="https://opensea.io/collection/devs-for-revolution"
141-
>
142-
<IconOpenSea color={colorMode === 'dark' ? 'white' : 'black'} />
143-
</Link>
121+
{footer?.social?.map((link) => (
122+
<ChakraLink key={link.id} target={'_blank'} href={link.link}>
123+
{getSocialIcon(link.name as SocialLinkName)}
124+
</ChakraLink>
125+
))}
144126
</ButtonGroup>
145127
</Stack>
146128
</SimpleGrid>

0 commit comments

Comments
 (0)