forked from goplus/builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Page home & explore for community (goplus#973)
* community explore & home * ProjectItem hover details
- Loading branch information
Showing
19 changed files
with
523 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!-- Simple header component for pages like search & explore --> | ||
|
||
<template> | ||
<section class="header"> | ||
<CenteredWrapper class="header-content"> | ||
<h1 class="title"> | ||
<slot></slot> | ||
</h1> | ||
<label class="options"> | ||
<slot name="options"></slot> | ||
</label> | ||
</CenteredWrapper> | ||
</section> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import CenteredWrapper from '@/components/community/CenteredWrapper.vue' | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import '@/utils/utils'; | ||
.header { | ||
flex: 0 0 auto; | ||
background-color: var(--ui-color-grey-100); | ||
} | ||
.header-content { | ||
height: 64px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
gap: 20px; | ||
.title { | ||
flex: 1 1 0; | ||
@include text-ellipsis; | ||
line-height: 26px; | ||
font-size: 16px; | ||
color: var(--ui-color-title); | ||
} | ||
.options { | ||
flex: 0 0 auto; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!-- Project list as a section --> | ||
|
||
<template> | ||
<section> | ||
<header class="header"> | ||
<h2 class="title"> | ||
<slot name="title"></slot> | ||
</h2> | ||
<RouterLink class="link" :to="linkTo"> | ||
<slot name="link"></slot> | ||
<UIIcon class="link-icon" type="arrowRightSmall" /> | ||
</RouterLink> | ||
</header> | ||
<ul class="projects"> | ||
<UILoading v-if="queryRet.isLoading.value" :mask="false" /> | ||
<!-- TODO: simpler UIError & UIEmpty here --> | ||
<UIError v-else-if="queryRet.error.value != null" :retry="queryRet.refetch"> | ||
{{ $t(queryRet.error.value.userMessage) }} | ||
</UIError> | ||
<UIEmpty | ||
v-else-if="queryRet.data.value != null && queryRet.data.value.length === 0" | ||
size="large" | ||
/> | ||
<template v-else-if="queryRet.data.value != null"> | ||
<slot></slot> | ||
</template> | ||
</ul> | ||
</section> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { QueryRet } from '@/utils/exception' | ||
import { UIIcon, UILoading, UIError, UIEmpty } from '@/components/ui' | ||
defineProps<{ | ||
linkTo: string | ||
queryRet: QueryRet<unknown[]> | ||
}>() | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.header { | ||
height: 56px; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
.title { | ||
line-height: 28px; | ||
font-size: 20px; | ||
color: var(--ui-color-title); | ||
} | ||
.link { | ||
display: flex; | ||
color: var(--ui-color-primary-main); | ||
text-decoration: none; | ||
} | ||
.link-icon { | ||
margin-left: 8px; | ||
width: 20px; | ||
height: 20px; | ||
} | ||
} | ||
.projects { | ||
padding: 20px 0; | ||
margin-bottom: 12px; | ||
// same height as `ProjectItem`, to prevent layout shift | ||
min-height: 260px; | ||
position: relative; | ||
display: flex; | ||
overflow: hidden; | ||
align-items: center; | ||
gap: 20px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,7 @@ withDefaults( | |
.right { | ||
flex-basis: 30%; | ||
display: flex; | ||
gap: 8px; | ||
} | ||
.center { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,7 @@ const slots = useSlots() | |
} | ||
.size-large { | ||
width: 100%; | ||
flex-direction: column; | ||
gap: 12px; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.