-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #674 from bobanetwork/fix/container-style-fixes
Fix: Scrollbar and height style for mobile and desktop view
- Loading branch information
Showing
12 changed files
with
175 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import React, { useState } from 'react' | ||
import { useSelector } from 'react-redux' | ||
import { selectTheme } from 'selectors' | ||
import { getEcoImage } from 'util/gitdata' | ||
import { | ||
PlaceholderImage, | ||
ExternalIcon, | ||
Card, | ||
Title, | ||
Description, | ||
CardList, | ||
OutlineButton, | ||
} from './styles' | ||
import Tooltip from 'components/tooltip/Tooltip' | ||
import externalSvg from 'assets/external.svg' | ||
|
||
export const CardItem = ({ name, description, icon, link }) => { | ||
const theme = useSelector(selectTheme) | ||
const iconImage = getEcoImage(theme === 'light' ? icon.dark : icon.light) | ||
return ( | ||
<Card> | ||
<PlaceholderImage> | ||
<img src={iconImage} alt={name} width="100%" /> | ||
</PlaceholderImage> | ||
<Title href={link} target="_blank" rel="noopener noreferrer"> | ||
{name} <ExternalIcon src={externalSvg} /> | ||
</Title> | ||
<Tooltip title={description}> | ||
<Description>{description}</Description> | ||
</Tooltip> | ||
</Card> | ||
) | ||
} | ||
|
||
export const TradeCardList = ({ items }: any) => { | ||
return ( | ||
<CardList> | ||
{items.map( | ||
(item: any, index) => | ||
item.visible && ( | ||
<CardItem | ||
key={`${item.name}-${item.pairName}` || index} | ||
{...item} | ||
description={item.pairName} | ||
/> | ||
) | ||
)} | ||
</CardList> | ||
) | ||
} | ||
|
||
export const EcosystemCardList = ({ items, types }) => { | ||
const [selectedType, setType] = useState('all') | ||
|
||
return ( | ||
<> | ||
<div style={{ display: 'flex', flexWrap: 'wrap', marginBottom: '10px' }}> | ||
<OutlineButton | ||
className={`${'all' !== selectedType ? '' : 'active'}`} | ||
onClick={() => setType('all')} | ||
> | ||
All | ||
</OutlineButton> | ||
{types.filter(Boolean).map((type) => ( | ||
<OutlineButton | ||
className={`${type.toLowerCase() !== selectedType ? '' : 'active'}`} | ||
onClick={() => setType(type.toLowerCase())} | ||
key={type} | ||
> | ||
{type} | ||
</OutlineButton> | ||
))} | ||
</div> | ||
|
||
<CardList> | ||
{items | ||
.filter((c: any) => | ||
selectedType === 'all' | ||
? true | ||
: c.type.toLowerCase() === selectedType | ||
) | ||
.map( | ||
(item: any, index) => | ||
item.visible && <CardItem key={item.name || index} {...item} /> | ||
)} | ||
</CardList> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.