Handle long app names correctly in app grid view

This commit is contained in:
Andrew Kingston 2021-05-07 13:29:05 +01:00
parent f0b39f2530
commit 81e9d8833c
2 changed files with 40 additions and 23 deletions

View File

@ -5,9 +5,11 @@
export let noPadding = false export let noPadding = false
export let gap = "M" export let gap = "M"
export let noGap = false export let noGap = false
export let alignContent = "normal"
</script> </script>
<div <div
style="align-content:{alignContent};"
class:horizontal class:horizontal
class="container paddingX-{!noPadding && paddingX} paddingY-{!noPadding && class="container paddingX-{!noPadding && paddingX} paddingY-{!noPadding &&
paddingY} gap-{!noGap && gap}" paddingY} gap-{!noGap && gap}"

View File

@ -17,7 +17,8 @@
let appExportLoading = false let appExportLoading = false
</script> </script>
<Layout noPadding gap="XS"> <div class="wrapper">
<Layout noPadding gap="XS" alignContent="start">
<div class="preview" use:gradient /> <div class="preview" use:gradient />
<div class="title"> <div class="title">
<Link href={$url(`../../app/${app._id}`)}> <Link href={$url(`../../app/${app._id}`)}>
@ -25,9 +26,10 @@
{app.name} {app.name}
</Heading> </Heading>
</Link> </Link>
<ActionMenu> <ActionMenu align="right">
<Icon slot="control" name="More" hoverable /> <Icon slot="control" name="More" hoverable />
<MenuItem on:click={() => exportApp(app)} icon="Download">Export</MenuItem <MenuItem on:click={() => exportApp(app)} icon="Download"
>Export</MenuItem
> >
</ActionMenu> </ActionMenu>
</div> </div>
@ -40,8 +42,12 @@
{/if} {/if}
</div> </div>
</Layout> </Layout>
</div>
<style> <style>
.wrapper {
overflow: hidden;
}
.preview { .preview {
height: 135px; height: 135px;
border-radius: var(--border-radius-s); border-radius: var(--border-radius-s);
@ -58,6 +64,15 @@
.title :global(a) { .title :global(a) {
text-decoration: none; text-decoration: none;
flex: 1 1 auto;
width: 0;
overflow: hidden;
text-overflow: ellipsis;
margin-right: var(--spacing-m);
}
.title :global(h1) {
overflow: hidden;
text-overflow: ellipsis;
} }
.title :global(h1:hover) { .title :global(h1:hover) {
color: var(--spectrum-global-color-blue-600); color: var(--spectrum-global-color-blue-600);