refactor(client): use css modules

This commit is contained in:
syuilo 2023-03-02 14:38:45 +09:00
parent ea1cff499a
commit fdf7605074

View file

@ -3,9 +3,8 @@
<MkStickyContainer> <MkStickyContainer>
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template> <template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :content-max="900"> <MkSpacer :content-max="900">
<div class="lknzcolw"> <div class="_gaps">
<div class="users"> <div :class="$style.inputs">
<div class="inputs">
<MkSelect v-model="sort" style="flex: 1;"> <MkSelect v-model="sort" style="flex: 1;">
<template #label>{{ i18n.ts.sort }}</template> <template #label>{{ i18n.ts.sort }}</template>
<option value="-createdAt">{{ i18n.ts.registeredDate }} ({{ i18n.ts.ascendingOrder }})</option> <option value="-createdAt">{{ i18n.ts.registeredDate }} ({{ i18n.ts.ascendingOrder }})</option>
@ -28,7 +27,7 @@
<option value="remote">{{ i18n.ts.remote }}</option> <option value="remote">{{ i18n.ts.remote }}</option>
</MkSelect> </MkSelect>
</div> </div>
<div class="inputs"> <div :class="$style.inputs">
<MkInput v-model="searchUsername" style="flex: 1;" type="text" :spellcheck="false" @update:model-value="$refs.users.reload()"> <MkInput v-model="searchUsername" style="flex: 1;" type="text" :spellcheck="false" @update:model-value="$refs.users.reload()">
<template #prefix>@</template> <template #prefix>@</template>
<template #label>{{ i18n.ts.username }}</template> <template #label>{{ i18n.ts.username }}</template>
@ -39,12 +38,13 @@
</MkInput> </MkInput>
</div> </div>
<MkPagination v-slot="{items}" ref="paginationComponent" :pagination="pagination" class="users"> <MkPagination v-slot="{items}" ref="paginationComponent" :pagination="pagination">
<MkA v-for="user in items" :key="user.id" v-tooltip.mfm="`Last posted: ${dateString(user.updatedAt)}`" class="user" :to="`/user-info/${user.id}`"> <div :class="$style.users">
<MkA v-for="user in items" :key="user.id" v-tooltip.mfm="`Last posted: ${dateString(user.updatedAt)}`" :class="$style.user" :to="`/user-info/${user.id}`">
<MkUserCardMini :user="user"/> <MkUserCardMini :user="user"/>
</MkA> </MkA>
</MkPagination>
</div> </div>
</MkPagination>
</div> </div>
</MkSpacer> </MkSpacer>
</MkStickyContainer> </MkStickyContainer>
@ -138,25 +138,14 @@ definePageMetadata(computed(() => ({
}))); })));
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.lknzcolw { .inputs {
> .users {
> .inputs {
display: flex; display: flex;
margin-bottom: 16px; gap: 8px;
flex-wrap: wrap;
}
> * { .users {
margin-right: 16px;
&:last-child {
margin-right: 0;
}
}
}
> .users {
margin-top: var(--margin);
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
grid-gap: 12px; grid-gap: 12px;
@ -164,7 +153,5 @@ definePageMetadata(computed(() => ({
> .user:hover { > .user:hover {
text-decoration: none; text-decoration: none;
} }
}
}
} }
</style> </style>