Skip to content

Commit a4cc76e

Browse files
committed
fix stories and adjust spacing
1 parent 1f02569 commit a4cc76e

File tree

3 files changed

+29
-50
lines changed

3 files changed

+29
-50
lines changed

packages/ui/src/components/servers/server-list-empty/ServerListEmpty.vue

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="flex gap-8 items-center justify-center">
2+
<div class="flex gap-8 items-center justify-center py-10">
33
<!-- Left column -->
44
<div class="flex flex-col gap-8 items-start pr-8 shrink-0 w-[380px]">
55
<!-- Heading -->
@@ -100,7 +100,7 @@
100100
v-for="row in GRID_ROWS"
101101
:key="row"
102102
class="flex gap-4 items-center shrink-0"
103-
:class="row % 2 === 1 ? 'drift-left' : 'drift-right relative left-14'"
103+
:class="animated ? (row % 2 === 1 ? 'drift-left' : 'drift-right relative left-14') : ''"
104104
>
105105
<div class="hidden drift-right drift-left"></div>
106106
<div
@@ -170,10 +170,14 @@ import imgYum2 from './grid-images/yum2.png'
170170
import imgYum3 from './grid-images/yum3.png'
171171
import imgYung from './grid-images/yung.png'
172172
173-
defineProps<{
174-
onClickNewServer?: () => void
175-
onClickSignIn?: () => void
176-
}>()
173+
withDefaults(
174+
defineProps<{
175+
animated?: boolean
176+
onClickNewServer?: () => void
177+
onClickSignIn?: () => void
178+
}>(),
179+
{ animated: false },
180+
)
177181
178182
const GRID_ROWS = 6
179183
const GRID_COLS = 5
@@ -218,7 +222,7 @@ p {
218222
transform: translateX(-33%);
219223
}
220224
to {
221-
transform: translateX(66%);
225+
transform: translateX(33%);
222226
}
223227
}
224228
@@ -227,7 +231,7 @@ p {
227231
transform: translateX(33%);
228232
}
229233
to {
230-
transform: translateX(-66%);
234+
transform: translateX(-33%);
231235
}
232236
}
233237

packages/ui/src/layouts/wrapped/hosting/manage/index.vue

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -100,24 +100,9 @@
100100
<div
101101
v-else-if="serverList.length === 0 && !isPollingForNewServers"
102102
key="empty"
103-
class="flex h-full flex-col items-center justify-center gap-8"
103+
class="flex h-full flex-col items-center justify-center gap-8 grow max-h-[1100px]"
104104
>
105-
<img
106-
src="https://cdn.modrinth.com/servers/excitement.webp"
107-
alt=""
108-
class="max-w-[360px]"
109-
style="
110-
mask-image: radial-gradient(97% 77% at 50% 25%, #d9d9d9 0, hsla(0, 0%, 45%, 0) 100%);
111-
"
112-
/>
113-
<h1 class="m-0 text-contrast">You don't have any servers yet!</h1>
114-
<p class="m-0">Modrinth Hosting is a new way to play modded Minecraft with your friends.</p>
115-
<ButtonStyled size="large" type="standard" color="brand">
116-
<AutoLink v-if="isNuxt" to="/servers#plan">Create a server</AutoLink>
117-
<button v-else :disabled="!canOpenPurchaseModal" @click="openPurchaseModal">
118-
Create a server
119-
</button>
120-
</ButtonStyled>
105+
<ServerListEmpty @click-new-server="openPurchaseModal" @click-sign-in="handleSignIn" />
121106
</div>
122107

123108
<div v-else key="list">
@@ -189,8 +174,7 @@
189174
<div v-else-if="isLoading" class="flex h-full items-center justify-center">
190175
<p class="text-contrast"><LoaderCircleIcon class="size-5 animate-spin" /></p>
191176
</div>
192-
<div v-else-if="searchInput">No servers found.</div>
193-
<div v-else><ServerListEmpty /></div>
177+
<div v-else>No servers found.</div>
194178
</div>
195179
</Transition>
196180
</div>
@@ -440,8 +424,10 @@ watch([fetchError, serverResponse], ([error, response]) => {
440424
})
441425
442426
const serverList = computed<Archon.Servers.v0.Server[]>(() => {
443-
if (!serverResponse.value) return []
444-
return serverResponse.value.servers
427+
return []
428+
429+
// if (!serverResponse.value) return []
430+
// return serverResponse.value.servers
445431
})
446432
447433
const searchInput = ref('')
@@ -472,14 +458,12 @@ function filesExpired(server: Archon.Servers.v0.Server): boolean {
472458
}
473459
474460
const filteredData = computed<Archon.Servers.v0.Server[]>(() => {
475-
return []
476-
477-
// const base = !searchInput.value.trim()
478-
// ? introToTop(serverList.value)
479-
// : fuse.value
480-
// ? introToTop(fuse.value.search(searchInput.value).map((result) => result.item))
481-
// : []
482-
// return base.filter((server) => !filesExpired(server))
461+
const base = !searchInput.value.trim()
462+
? introToTop(serverList.value)
463+
: fuse.value
464+
? introToTop(fuse.value.search(searchInput.value).map((result) => result.item))
465+
: []
466+
return base.filter((server) => !filesExpired(server))
483467
})
484468
485469
// Start polling only after initial data is available so the baseline is correct
@@ -536,6 +520,10 @@ function openPurchaseModal() {
536520
purchaseModal.value.show('quarterly')
537521
}
538522
523+
function handleSignIn() {
524+
router.push({ name: 'login', query: { redirect: '/hosting/manage' } })
525+
}
526+
539527
const { data: subscriptions } = useQuery({
540528
queryKey: ['billing', 'subscriptions'],
541529
queryFn: () => client.labrinth.billing_internal.getSubscriptions(),

packages/ui/src/stories/servers/ServerListEmpty.stories.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,3 @@ export default meta
1414
type Story = StoryObj<typeof meta>
1515

1616
export const Default: Story = {}
17-
18-
export const WithImages: Story = {
19-
args: {
20-
gridImages: [
21-
'https://cdn.modrinth.com/data/AANobbMI/icon.png',
22-
'https://cdn.modrinth.com/data/P7dR8mSH/icon.png',
23-
'https://cdn.modrinth.com/data/gvQqBUqZ/icon.png',
24-
'https://cdn.modrinth.com/data/YL57xq9U/icon.png',
25-
'https://cdn.modrinth.com/data/mOgUt4GM/icon.png',
26-
'https://cdn.modrinth.com/data/9eGKb6K1/icon.png',
27-
],
28-
},
29-
}

0 commit comments

Comments
 (0)