-
Notifications
You must be signed in to change notification settings - Fork 295
/
LocalLiveAppSection.tsx
37 lines (34 loc) · 1.13 KB
/
LocalLiveAppSection.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 { Flex } from "@ledgerhq/react-ui";
import { MinimumCard } from "./Card";
import styled from "styled-components";
import { LiveAppManifest } from "@ledgerhq/live-common/platform/types";
import { useHistory } from "react-router";
import { SectionHeader } from "./SectionHeader";
import { useTranslation } from "react-i18next";
export function LocalLiveAppSection({ localLiveApps }: { localLiveApps: LiveAppManifest[] }) {
const history = useHistory();
const { t } = useTranslation();
return (
<Flex flexDirection="column" marginBottom={4}>
<SectionHeader iconLeft="Download">
{t("platform.catalog.section.locallyLoaded")}
</SectionHeader>
<Scroll>
{localLiveApps.map(manifest => (
<Flex key={manifest.id} margin={2}>
<MinimumCard
manifest={manifest}
onClick={(manifest: LiveAppManifest) => history.push(`/platform/${manifest.id}`)}
/>
</Flex>
))}
</Scroll>
</Flex>
);
}
const Scroll = styled(Flex).attrs({ overflowX: "scroll" })`
&::-webkit-scrollbar {
display: none;
}
`;