-
Notifications
You must be signed in to change notification settings - Fork 22
/
TopMenuHighlightedNews.tsx
37 lines (34 loc) · 1.07 KB
/
TopMenuHighlightedNews.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from "react";
import { Image } from "react-native";
import { TopMenuSection } from "./TopMenuSection";
import { useBanners } from "../../hooks/marketing/useBanners";
import { useSelectedNetworkId } from "../../hooks/useSelectedNetwork";
import { web3ToWeb2URI } from "../../utils/ipfs";
import FlexCol from "../FlexCol";
import { Link } from "../Link";
import { PrimaryBox } from "../boxes/PrimaryBox";
export const TopMenuHighlightedNews: React.FC = () => {
const networkId = useSelectedNetworkId();
const banners = useBanners(networkId);
const banner = banners?.length ? banners[0] : undefined;
return (
<TopMenuSection title="Highlighted News">
<FlexCol>
<Link to={banner?.url || ""}>
<PrimaryBox>
<Image
source={{
uri: web3ToWeb2URI(banner?.image),
}}
style={{
height: 94,
width: 298,
borderRadius: 7,
}}
/>
</PrimaryBox>
</Link>
</FlexCol>
</TopMenuSection>
);
};