-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: redesign creations page #114
base: dev
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
export default function LogosCarousel({ companies, onChange }: LogosCarouselProps) { | ||
const [loop, setLoop] = useState(carouselState.desktop.loop); // iterations of the logos | ||
const [visibleItems, setVisibleItems] = useState(carouselState.desktop.visibleItems); // number of logos visible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend avoiding commenting on every line and writing self-explanatory code.
loop state could be renamed to interations
, or logoIteration
.
visibleItems
: it doesn’t need comments; it explains itself.
maxSize
: the same, could be renamed to logosMaxSize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// setSize is used to determine the size of the logos | ||
// if the index is the selected item, the size is the max size, Math.ceil(VISIBLE_ITEMS / 2) | ||
// otherwise, if the index is bigger or smaller than the selected item, the size is the module of the difference between selected item and index | ||
const setSize = (index: number, currIndex: number) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function could be renamed to setLogoSizeByIndex and avoid extra comments, the code explains itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const handleChangeItem = (index: number) => { | ||
if (index === selectedItem) return; | ||
|
||
if (index === items.length - centerIndex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use an or and avoid repeating code.
if(index === (items.length - centerIndex) || index === (centerIndex - 1)){
resetIndex();
return;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
setSelectedItem(index); | ||
if (onChange) onChange(index % companies.length); // get the index of the company |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not recommend commenting code unless is strictly necessary.
if(onChange){
const companyIndex = index % companies.length;
onChange(companyIndex);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
}, []); | ||
|
||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a useWindowSize hook, there are a lot of examples that you can follow and reuse in different carousels (and others), so you don't have to put this logic inside the carousel itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! I made some comments; here’s an overview:
-
Project Opening: What do you think about having only one project open at a time? If someone opens a new one, it should automatically close the last one. I think this could make navigation a bit smoother 😄
-
Text Size for "Made in Wonderland": Just a note that the "Made in Wonderland" text looks pretty big on some screens (like Mati's). Maybe we can shrink it a bit for better consistency?
-
Carousel Visibility: I chatted with Mati about showing the carousel as soon as you enter. If we drop the "We work with the best" section, it might give a cleaner look and allow people to dive into the projects right away
-
Projects JSON: I made some comments on specific details in this as well :)
-
Regarding the project list component, can we remove the ":" after the questions? Here’s an image for reference:
src/data/projects.json
Outdated
"web": "https://www.connext.network/" | ||
"name": "Crosschain Governance", | ||
"company": { | ||
"name": "Connext", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We should change "Connext" for "Everclear" (in all the projects)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public/img/logos/connext.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This one is the old logo of connext (my bad), let's change it for the Everclear one: https://cryptorank.io/ico/connext
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public/img/logos/makerdao.png
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Note: MakerDAO has rebranded as Sky. We should use their new logo. Here's a link to their current logo from Twitter, though I’m not sure about the quality of the image: https://pbs.twimg.com/profile_images/1828469202753122304/i8YRkB4A_400x400.jpg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/data/projects.json
Outdated
"content": { | ||
"challenge": { | ||
"title": "What was the challenge?", | ||
"description": "MakerDAO is one of the largest and oldest governance in the Crypto DeFi ecosystem and as such has on a daily basis a large number of votes that need to be executed on-chain. These votes which can be payments, parameter changes in the voult, or a contract update are known as spells." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update the description here?
"description": "Sky (formerly MakerDAO) is one of the largest and oldest governance systems in DeFi. Every day, it oversees a significant number of on-chain votes that need to be executed. These votes can include payments, parameter adjustments within vaults, or contract updates, collectively referred to as spells."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/data/projects.json
Outdated
{ | ||
"name": "Spells", | ||
"company": { | ||
"name": "MakerDAO", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"name":"Sky",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/data/projects.json
Outdated
"github": "https://github.com/defi-wonderland/xERC20" | ||
"name": "Everclear", | ||
"company": { | ||
"name": "Connext", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here "name":"Everclear",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/data/projects.json
Outdated
"twitter": "https://twitter.com/amphoraprotocol" | ||
"name": "Optimistic Merkle Root Aggregator", | ||
"company": { | ||
"name": "Connext", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, "name":"Everclear",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -32,7 +49,7 @@ export default function Creations() { | |||
<HeroDivider> | |||
<CreationsTitleContainer> | |||
<SquigglyTitle | |||
text='WHAT’S COOKING?' | |||
text='MADE IN WONDERLAND' | |||
sizes={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/pages/creations/index.tsx
Outdated
@@ -49,15 +66,26 @@ export default function Creations() { | |||
</HeroDivider> | |||
|
|||
<TitleContainer> | |||
<ProjectTitle title='Partner projects' /> | |||
<ProjectTitle> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -41,48 +69,70 @@ export default function ProjectsList({ projects = [] }: ProjectListProps) { | |||
}; | |||
|
|||
return ( | |||
<styles.List> | |||
<List> | |||
{projects.map((project) => ( | |||
<ProjectContainer key={project.name}> | |||
<ProjectHeader onClick={(e: React.MouseEvent<Element, MouseEvent>) => handleClick(project, e.currentTarget)}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Consider implementing a single open state for projects. If one project is opened, the others should automatically close : )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some UI/UX comments:
- the carousel in creations page should have cursor pointer
- maybe we can add a hover effect for the project icons in the carousel
- the user cant select the text in the project description, also it shouldn't have cursor pointer in that section
- i think we should remove the
:
in the project description titles
From:What was the challenge?:
To:What was the challenge?
import { styled } from 'styled-components'; | ||
import { MOBILE_MAX_WIDTH, TABLET_MAX_WIDTH } from '~/components'; | ||
import { Carousel } from 'react-responsive-carousel'; | ||
import { useCallback, useEffect, useMemo, useState } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
react imports should be on line 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/pages/creations/index.tsx
Outdated
import { PageContent } from '~/containers/PageContent'; | ||
import LogosCarousel from './LogosCarousel'; | ||
import { useMemo, useState } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Changes done
Issue ticket number and link
Redesign projects section in creations page
closes PRIUI-264