Skip to content

Commit

Permalink
Merge pull request #243 from traPtitech/searchPage
Browse files Browse the repository at this point in the history
Search page
  • Loading branch information
Pugma authored May 12, 2024
2 parents b35778f + 9a633b3 commit 4c7ec97
Showing 1 changed file with 11 additions and 53 deletions.
64 changes: 11 additions & 53 deletions src/components/Layout/PageHeader.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<script lang="ts" setup>
import SearchInput from '/@/components/UI/SearchInput.vue'
import Icon from '/@/components/UI/Icon.vue'
import { storeToRefs } from 'pinia'
import { useResponsiveStore } from '/@/store/responsive'
import apis from '/@/lib/apis'
import { useToast } from 'vue-toastification'
interface Props {
isOpenNavigationBar: boolean
Expand All @@ -15,41 +12,22 @@ const emit = defineEmits<{
(e: 'toggleNavigationBar'): void
}>()
const toast = useToast()
const { isMobile } = storeToRefs(useResponsiveStore())
const handleSyncUsers = async () => {
if (!confirm('ユーザーとグループ情報を同期します')) return
try {
await apis.syncUsers()
toast.success('ユーザーとグループ情報を同期しました')
} catch {
toast.error('ユーザーとグループ情報の同期に失敗しました')
}
}
</script>

<template>
<div :class="$style.container">
<div :class="$style.leftContainer">
<button v-if="isMobile" @click="emit('toggleNavigationBar')">
<icon name="mdi:menu" />
</button>
<router-link to="/">
<img
src="/@/assets/traP_logo_blue.svg"
alt="traP"
width="343"
height="48"
/>
</router-link>
</div>
<div :class="$style.rightContainer">
<button @click="handleSyncUsers">
<icon name="mdi:sync" :class="$style.syncButton" />
</button>
<search-input />
</div>
<button v-if="isMobile" @click="emit('toggleNavigationBar')">
<icon name="mdi:menu" />
</button>
<router-link to="/">
<img
src="/@/assets/traP_logo_blue.svg"
alt="traP"
width="343"
height="48"
/>
</router-link>
</div>
</template>

Expand All @@ -58,31 +36,11 @@ const handleSyncUsers = async () => {
display: flex;
height: 5rem;
padding: 0 1rem;
justify-content: space-between;
align-items: center;
border-bottom: solid 0.1rem $color-secondary;
}
.leftContainer {
display: flex;
align-items: center;
gap: 1rem;
}
.rightContainer {
display: flex;
align-items: center;
gap: 1rem;
}
.syncButton {
color: $color-secondary;
transition: 0.2s all ease-in-out;
&:hover {
color: $color-primary;
}
}
@media (width <= 768px) {
.container {
padding: 0 1rem;
Expand Down

0 comments on commit 4c7ec97

Please sign in to comment.