mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-23 14:07:20 +03:00
feat(GlobalCarouselJumpers/FileDescription): add FileDescription jumper, triggered by the More button in the carousel header
This commit is contained in:
parent
e213b7b609
commit
c37ec1c70c
@ -0,0 +1,36 @@
|
||||
import * as React from "react";
|
||||
import * as Styles from "~/common/styles";
|
||||
import * as System from "~/components/system";
|
||||
import * as Jumper from "~/components/core/Jumper";
|
||||
|
||||
import { Show } from "~/components/utility/Show";
|
||||
|
||||
import LinkIcon from "~/components/core/LinkIcon";
|
||||
|
||||
export function FileDescription({ file, isOpen, onClose }) {
|
||||
return isOpen ? (
|
||||
<Jumper.Root onClose={onClose}>
|
||||
<Jumper.Header>
|
||||
<System.H3 as="h1">{file.name || file.filename}</System.H3>
|
||||
<Show when={file.isLink}>
|
||||
<div style={{ marginTop: 5 }} css={Styles.HORIZONTAL_CONTAINER_CENTERED}>
|
||||
<LinkIcon file={file} width={12} height={12} />
|
||||
<System.P2
|
||||
as="p"
|
||||
nbrOflines={1}
|
||||
href={file.url}
|
||||
css={Styles.LINK}
|
||||
style={{ marginLeft: 5 }}
|
||||
>
|
||||
{file.url}
|
||||
</System.P2>
|
||||
</div>
|
||||
</Show>
|
||||
</Jumper.Header>
|
||||
<Jumper.Divider />
|
||||
<Jumper.Item>
|
||||
<System.P2>{file.body}</System.P2>
|
||||
</Jumper.Item>
|
||||
</Jumper.Root>
|
||||
) : null;
|
||||
}
|
Loading…
Reference in New Issue
Block a user