Skip to content

Commit

Permalink
add oracle logos
Browse files Browse the repository at this point in the history
  • Loading branch information
saml33 committed Jun 28, 2024
1 parent 6fc9657 commit f8e669d
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 17 deletions.
25 changes: 11 additions & 14 deletions app/components/home/Markets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import {
import { formatNumericValue, numberCompacter } from '../../utils/numbers'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import PythLogo from '../icons/PythLogo'
import SwitchboardLogo from '../icons/SwitchboardLogo'
dayjs.extend(relativeTime)

const Markets = () => {
Expand Down Expand Up @@ -148,6 +150,13 @@ const Markets = () => {
<GainersLosers tokens={gainers} isGainers loading={loadingTokens} />
<GainersLosers tokens={losers} loading={loadingTokens} />
</div>
<div className="flex justify-center pt-12">
<div className="flex items-center">
<PythLogo className="h-9 w-auto text-th-fgd-3" />
<div className="h-9 w-[1px] bg-th-bkg-4 ml-8 mr-6" />
<SwitchboardLogo className="h-9 w-auto text-th-fgd-3" />
</div>
</div>
</SectionWrapper>
)
}
Expand Down Expand Up @@ -217,13 +226,7 @@ const RecentlyListed = ({
>
<div className="flex items-center space-x-3 pl-3">
{logoPath ? (
<Image
className="rounded-full"
src={logoPath}
alt="Logo"
height={32}
width={32}
/>
<Image src={logoPath} alt="Logo" height={32} width={32} />
) : (
<QuestionMarkCircleIcon className="h-8 w-8 text-th-fgd-4" />
)}
Expand Down Expand Up @@ -318,13 +321,7 @@ const GainersLosers = ({
>
<div className="flex items-center space-x-3 pl-3">
{logoPath ? (
<Image
className="rounded-full"
src={logoPath}
alt="Logo"
height={32}
width={32}
/>
<Image src={logoPath} alt="Logo" height={32} width={32} />
) : (
<QuestionMarkCircleIcon className="h-8 w-8 text-th-fgd-4" />
)}
Expand Down
29 changes: 29 additions & 0 deletions app/components/icons/PythLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const PythLogo = ({ className }: { className?: string }) => {
return (
<svg
className={`${className}`}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 370.99 127.93"
fill="currentColor"
>
<path d="m127.92,47.62v-31.17h14.43c2.05,0,3.83.39,5.34,1.18s2.7,1.88,3.56,3.27c.86,1.4,1.29,3.02,1.29,4.85s-.43,3.46-1.29,4.85c-.86,1.4-2.06,2.49-3.58,3.27-1.53.79-3.3,1.18-5.32,1.18h-9.75v12.56h-4.68Zm4.68-16.52h9.26c1.84,0,3.3-.48,4.39-1.45s1.63-2.25,1.63-3.85-.54-2.88-1.63-3.83c-1.08-.95-2.55-1.42-4.39-1.42h-9.26v10.55Z" />
<path d="m166,48.07c-2.2,0-4.19-.52-5.99-1.56-1.8-1.04-3.21-2.45-4.25-4.23-1.04-1.78-1.56-3.77-1.56-5.97s.52-4.19,1.56-5.97c1.04-1.78,2.46-3.2,4.25-4.25,1.8-1.05,3.79-1.58,5.99-1.58s4.23.53,6.01,1.58c1.78,1.06,3.19,2.47,4.23,4.25,1.04,1.78,1.56,3.77,1.56,5.97s-.52,4.19-1.56,5.97-2.45,3.19-4.23,4.23-3.78,1.56-6.01,1.56Zm0-3.92c1.4,0,2.66-.35,3.79-1.05,1.13-.7,2.02-1.64,2.67-2.83.65-1.19.98-2.52.98-4.01s-.33-2.77-1-3.94c-.67-1.17-1.56-2.12-2.67-2.83-1.11-.71-2.37-1.07-3.76-1.07s-2.65.36-3.76,1.07c-1.11.71-2,1.65-2.67,2.83-.67,1.17-1,2.49-1,3.94s.33,2.82.98,4.01,1.54,2.13,2.67,2.83,2.39,1.05,3.79,1.05Z" />
<path d="m186.71,47.62l-6.32-22.67h4.32l4.41,16.66,5.17-16.66h3.83l5.17,16.66,4.41-16.66h4.19l-6.37,22.67h-4.27l-5.08-16.61-5.12,16.61h-4.32Z" />
<path d="m226.34,48.02c-2.23,0-4.24-.52-6.04-1.56-1.8-1.04-3.22-2.45-4.27-4.23-1.05-1.78-1.58-3.77-1.58-5.97s.5-4.13,1.51-5.9c1.01-1.77,2.38-3.18,4.1-4.23,1.72-1.05,3.64-1.58,5.74-1.58s3.98.53,5.61,1.58c1.63,1.06,2.93,2.48,3.9,4.28.96,1.8,1.45,3.82,1.45,6.08v1.25h-17.86c.24,1.25.71,2.36,1.4,3.34.7.98,1.59,1.75,2.67,2.32,1.08.56,2.26.85,3.54.85,1.1,0,2.16-.17,3.18-.51,1.02-.34,1.88-.84,2.56-1.49l2.85,2.81c-1.34,1.01-2.71,1.76-4.12,2.25-1.41.49-2.96.74-4.65.74Zm-7.39-13.63h13.4c-.18-1.19-.59-2.23-1.23-3.14-.64-.91-1.42-1.62-2.36-2.14-.94-.52-1.95-.78-3.05-.78s-2.17.25-3.12.76c-.95.51-1.74,1.21-2.38,2.12-.64.91-1.06,1.97-1.27,3.18Z" />
<path d="m241.89,47.62v-22.67h4.45v2.9c.71-1.07,1.6-1.91,2.65-2.52,1.05-.61,2.25-.91,3.59-.91.92.03,1.68.16,2.27.4v4.01c-.42-.18-.85-.3-1.29-.38-.45-.07-.89-.11-1.34-.11-1.31,0-2.47.35-3.48,1.05s-1.81,1.71-2.4,3.05v15.19h-4.45Z" />
<path d="m268.87,48.02c-2.23,0-4.24-.52-6.04-1.56-1.79-1.04-3.22-2.45-4.27-4.23-1.06-1.78-1.58-3.77-1.58-5.97s.51-4.13,1.51-5.9c1.01-1.77,2.38-3.18,4.1-4.23,1.72-1.05,3.64-1.58,5.75-1.58s3.98.53,5.61,1.58c1.63,1.06,2.93,2.48,3.9,4.28s1.45,3.82,1.45,6.08v1.25h-17.86c.24,1.25.71,2.36,1.4,3.34.7.98,1.59,1.75,2.67,2.32,1.08.56,2.26.85,3.54.85,1.1,0,2.16-.17,3.18-.51,1.02-.34,1.88-.84,2.56-1.49l2.85,2.81c-1.34,1.01-2.71,1.76-4.12,2.25s-2.96.74-4.65.74Zm-7.39-13.63h13.4c-.18-1.19-.59-2.23-1.22-3.14-.64-.91-1.43-1.62-2.36-2.14-.94-.52-1.95-.78-3.05-.78s-2.17.25-3.12.76c-.95.51-1.74,1.21-2.38,2.12-.64.91-1.06,1.97-1.27,3.18Z" />
<path d="m294.88,47.98c-2.11,0-4.04-.52-5.79-1.56-1.75-1.04-3.13-2.44-4.14-4.21-1.01-1.77-1.51-3.75-1.51-5.95s.51-4.17,1.54-5.92c1.02-1.75,2.41-3.15,4.16-4.19,1.75-1.04,3.7-1.56,5.83-1.56,1.25,0,2.45.19,3.61.58,1.16.39,2.23.95,3.21,1.69v-10.42l4.45-.85v32.02h-4.41v-2.18c-1.93,1.69-4.25,2.54-6.95,2.54Zm.58-3.87c1.3,0,2.5-.24,3.58-.71,1.08-.47,2-1.16,2.74-2.05v-10.2c-.74-.83-1.65-1.49-2.74-1.98s-2.28-.73-3.58-.73c-1.43,0-2.72.34-3.88,1.02-1.16.68-2.08,1.61-2.76,2.78-.68,1.17-1.02,2.5-1.02,3.99s.34,2.82,1.02,4.01c.68,1.19,1.6,2.13,2.76,2.83,1.16.7,2.45,1.05,3.88,1.05Z" />
<path d="m322.58,47.62v-31.17l4.45-.85v11.49c1.9-1.66,4.2-2.49,6.9-2.49,2.14,0,4.08.52,5.81,1.56,1.74,1.04,3.11,2.43,4.12,4.19,1.01,1.75,1.51,3.73,1.51,5.92s-.51,4.18-1.54,5.95c-1.02,1.77-2.4,3.17-4.14,4.21-1.74,1.04-3.69,1.56-5.86,1.56-1.25,0-2.46-.2-3.63-.6-1.17-.4-2.25-.97-3.23-1.72v1.96h-4.41Zm10.78-3.52c1.45,0,2.75-.34,3.9-1.02,1.14-.68,2.05-1.61,2.74-2.78.68-1.17,1.02-2.5,1.02-3.99s-.34-2.82-1.02-4.01c-.68-1.19-1.6-2.12-2.74-2.81-1.14-.68-2.44-1.02-3.9-1.02-1.28,0-2.47.24-3.56.71-1.1.47-2.02,1.14-2.76,2v10.24c.74.83,1.67,1.48,2.78,1.96,1.11.48,2.29.71,3.54.71Z" />
<path d="m351.35,57.2c-.47,0-.92-.02-1.34-.07s-.76-.11-1.02-.2v-3.92c.53.12,1.19.18,1.96.18,2.08,0,3.58-1.11,4.5-3.34l.98-2.18-9.08-22.71h4.94l6.59,17.28,7.3-17.28h4.81l-10.95,25.47c-.71,1.6-1.47,2.9-2.27,3.9-.8.99-1.72,1.72-2.76,2.18-1.04.46-2.26.69-3.65.69Z" />
<path d="m143.02,97.41v-8.49h20.13c3.08,0,5.48-.87,7.2-2.62,1.72-1.75,2.59-4.05,2.59-6.9s-.86-5.2-2.59-6.9-4.13-2.55-7.2-2.55h-26.54v42.39h-8.69v-51.17h35.23c2.9,0,5.48.43,7.76,1.28,2.27.85,4.19,2.05,5.76,3.59,1.56,1.54,2.76,3.42,3.59,5.62.83,2.21,1.24,4.69,1.24,7.46s-.42,5.19-1.24,7.42c-.83,2.23-2.03,4.15-3.59,5.77-1.56,1.61-3.48,2.86-5.76,3.76-2.27.9-4.86,1.35-7.76,1.35h-20.13Z" />
<path d="m210.01,112.33v-20.03l-26.61-31.14h11.79l19.51,23.13,19.58-23.13h11.17l-26.69,31.14v20.03h-8.75,0Z" />
<path d="m275.64,112.33v-42.4h-23.06v-8.77h54.9v8.77h-23.09v42.4h-8.75Z" />
<path d="m362.27,61.16h8.72v51.17h-8.72v-51.17Z" />
<path d="m324.63,112.33v-22.7h32.45v-7.77h-32.45v-20.7h-8.72v51.17h8.72Z" />
<path d="m51.17,0c-9.32,0-18.06,2.49-25.59,6.85-4.82,2.78-9.14,6.33-12.79,10.48C4.83,26.35,0,38.2,0,51.17v38.38l12.79,12.79v-51.17c0-11.36,4.94-21.58,12.79-28.61,3.69-3.3,8.03-5.9,12.79-7.58,4-1.42,8.31-2.19,12.79-2.19,21.19,0,38.38,17.18,38.38,38.38s-17.18,38.38-38.38,38.38v12.79c28.26,0,51.17-22.91,51.17-51.17S79.44,0,51.17,0Z" />
<path d="m63.96,51.17c0,7.06-5.73,12.79-12.79,12.79v12.79c14.13,0,25.59-11.46,25.59-25.59s-11.46-25.59-25.59-25.59c-4.66,0-9.03,1.24-12.79,3.43-7.65,4.42-12.79,12.69-12.79,22.16v63.97l11.5,11.5,1.29,1.29V51.17c0-7.06,5.73-12.79,12.79-12.79s12.79,5.73,12.79,12.79Z" />
</svg>
)
}

export default PythLogo
16 changes: 16 additions & 0 deletions app/components/icons/SwitchboardLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const SwitchboardLogo = ({ className }: { className?: string }) => {
return (
<svg
className={`${className}`}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 960 160"
fill="currentColor"
>
<path d="M45.3232 66.1506C45.3232 45.3213 59.7865 31.4012 82.0846 31H163.193C158.356 41.6727 154.461 47.084 151.51 47.2339H81.3641C69.2204 47.2666 61.9099 54.3271 61.9099 66.1506C61.9099 77.8459 69.1975 85.407 80.9546 85.454L112.017 85.407C116.529 85.454 120.395 89.3417 120.395 94.0223C120.395 98.703 116.875 101.41 112.448 101.635L81.8574 101.67C60.0634 101.67 45.6581 87.2747 45.329 66.8643L45.3232 66.1506Z" />
<path d="M149.87 93.8494C149.87 114.679 135.407 128.599 113.109 129L32 129C36.8378 118.327 40.7323 112.916 43.6834 112.766L113.829 112.766C125.973 112.733 133.284 105.673 133.284 93.8494C133.284 82.1541 125.996 74.593 114.239 74.546L83.1762 74.593C78.6646 74.546 74.7982 70.6583 74.7982 65.9777C74.7982 61.297 78.3184 58.5899 82.745 58.365L113.336 58.3296C135.13 58.3296 149.535 72.7253 149.864 93.1357L149.87 93.8494Z" />
<path d="M255 113H208.9V102.6H256.3C263.3 102.6 266.4 99.5 266.4 93.2C266.4 86.9 263.4 84.3 255.7 84.3H230.1C214.1 84.3 207.3 77.6 207.3 64.7C207.3 51.7 214.2 45.5 230.9 45.5H277.5V55.9H230.9C224 55.9 220.8 58.4 220.8 64.9C220.8 71.4 224 73.9 231.3 73.9H256.9C273.2 73.9 280 80.7 280 93.8C280 106.8 273.2 113 255 113ZM369.839 113H352.439L337.139 72.3L321.439 113H303.939L283.539 62.3H297.339L313.239 104.3L329.239 62.3H345.639L361.339 104.3L377.039 62.3H390.339L369.839 113ZM408.826 113H395.726V63H408.826V113ZM408.826 55.6H395.726V43.3H408.826V55.6ZM447.708 113H441.308C422.108 113 416.508 109.7 416.508 95V44.3H429.708V62.3H448.908V71.5H429.708V94.3C429.708 102 432.608 103.9 442.708 103.9H447.708V113ZM509.02 113H477.92C462.92 113 452.92 106.7 452.92 87.6C452.92 68.6 462.72 62.3 477.92 62.3H509.02V72.1H480.12C470.02 72.1 465.82 76.8 465.82 87.6C465.82 98.5 470.02 103.2 480.12 103.2H509.02V113ZM581.636 113H568.536V85.7C568.536 77.3 564.136 72 554.536 72H529.136V113H516.036V43.3H529.136V62.3H556.636C571.736 62.3 581.636 69.5 581.636 85.7V113ZM627.976 113H614.076C596.876 113 588.576 104 588.576 90.3V43.3H601.776V62.3H627.976C646.276 62.3 656.076 71.3 656.076 87.6C656.076 104 646.276 113 627.976 113ZM614.576 103.4H626.176C639.076 103.4 643.176 96.7 643.176 87.6C643.176 78.7 639.076 72 626.176 72H601.776V88.5C601.776 95.9 603.776 103.4 614.576 103.4ZM701.304 113H690.004C671.704 113 661.904 104 661.904 87.6C661.904 71.3 671.704 62.3 690.004 62.3H701.304C719.504 62.3 729.404 71.3 729.404 87.6C729.404 104 719.504 113 701.304 113ZM691.204 103.4H699.504C712.404 103.4 716.504 96.7 716.504 87.6C716.504 78.6 712.404 71.9 699.504 71.9H691.204C679.004 71.9 674.804 78.6 674.804 87.6C674.804 96.7 679.004 103.4 691.204 103.4ZM797.144 113H749.244C738.244 113 734.644 106.2 734.644 97.1C734.644 87.9 738.244 82 749.244 82H784.044C782.944 73.7 778.844 71.5 769.744 71.5H736.544V62.3H770.844C789.344 62.3 797.144 68.9 797.144 87.7V113ZM784.444 103.8V90.2H753.344C748.444 90.2 746.744 92.6 746.744 96.8C746.744 101.3 748.544 103.8 753.344 103.8H784.444ZM817.305 113H804.105V84.4C804.105 68.9 813.105 62.3 827.905 62.3H844.005V71.5H830.005C821.205 71.5 817.305 75.7 817.305 84.4V113ZM889.937 113H876.137C857.737 113 847.937 104 847.937 87.6C847.937 71.3 857.737 62.3 876.137 62.3H902.337V43.3H915.537V90.3C915.537 104 907.137 113 889.937 113ZM902.337 91.3V72H877.837C865.037 72 860.937 78.7 860.937 87.6C860.937 96.7 865.037 103.4 877.837 103.4H887.037C897.837 103.4 902.337 99 902.337 91.3Z" />
</svg>
)
}

export default SwitchboardLogo
1 change: 1 addition & 0 deletions app/types/mango.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ export type MangoTokenData = {
borrow_rate: number
deposit_rate: number
price_history: PriceHistoryData[]
listing_time: string
}
9 changes: 7 additions & 2 deletions app/utils/mango.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FormattedMarketData, MarketData } from '../types/mango'
import { FormattedMarketData, MangoTokenData, MarketData } from '../types/mango'
import { MANGO_DATA_API_URL } from './constants'

export const fetchAppStatsData = async () => {
Expand All @@ -24,7 +24,12 @@ export const fetchMangoTokensData = async () => {
})
const data = await response.json()
if (data && data?.length) {
return data
const uniqueTokens: MangoTokenData[] = Array.from(
data
.reduce((map, token) => map.set(token.symbol, token), new Map())
.values(),
)
return uniqueTokens
} else return []
} catch (e) {
console.error('Failed to fetch mango token data', e)
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit f8e669d

Please sign in to comment.