|
39 | 39 |
|
40 | 40 | <div class="flex w-full justify-between px-6 py-4 bg-white"> |
41 | 41 | <div class="flex w-full items-center gap-3"> |
42 | | - <!-- 프로필 사진 API 필요 --> |
43 | | - <div class="w-10 h-10 rounded-full bg-background-1" /> |
| 42 | + <img |
| 43 | + v-if="info?.imageUrl" |
| 44 | + class="rounded-[50%] w-10 h-10" |
| 45 | + :src="info.imageUrl" |
| 46 | + alt="프로필 이미지" /> |
| 47 | + <div |
| 48 | + v-else |
| 49 | + class="w-10 h-10 rounded-full bg-background-1" /> |
44 | 50 | <div class="flex flex-col gap-1"> |
45 | 51 | <p class="text-xs text-body font-bold">{{ name }}</p> |
46 | 52 | <p class="text-sm text-black">{{ nickname }}</p> |
|
61 | 67 |
|
62 | 68 | <script setup lang="ts"> |
63 | 69 | import { useRoute } from 'vue-router' |
64 | | -import { computed, ref } from 'vue' |
| 70 | +import { computed } from 'vue' |
65 | 71 | import CommonIcons from './common/CommonIcons.vue' |
66 | 72 | import { hamburgerIcon } from '@/constants/iconPath' |
67 | 73 | import { SIDE_USER_MENU, SIDE_MANAGER_MENU, SIDE_ADMIN_MENU } from '@/constants/menu' |
| 74 | +import { useMemberStore } from '@/stores/member' |
| 75 | +import { storeToRefs } from 'pinia' |
| 76 | +
|
| 77 | +const memberStore = useMemberStore() |
| 78 | +const { info } = storeToRefs(memberStore) |
68 | 79 |
|
69 | 80 | const route = useRoute() |
70 | 81 |
|
71 | | -// 회원 역할, 닉네임 필요 |
72 | | -const role = ref('manager') |
73 | | -const name = ref('백지연') |
74 | | -const nickname = ref('Chloe.yeon') |
| 82 | +const role = computed(() => info.value.memberRole) |
| 83 | +const name = computed(() => info.value.memberName) |
| 84 | +const nickname = computed(() => info.value.nickname) |
75 | 85 |
|
76 | 86 | const filteredMenu = computed(() => { |
77 | | - return role.value === 'user' |
| 87 | + return role.value === 'ROLE_USER' |
78 | 88 | ? SIDE_USER_MENU |
79 | | - : role.value === 'manager' |
| 89 | + : role.value === 'ROLE_MANAGER' |
80 | 90 | ? SIDE_MANAGER_MENU |
81 | 91 | : SIDE_ADMIN_MENU |
82 | 92 | }) |
|
0 commit comments