Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/event modal #82

Merged
merged 17 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions src/components/Events/EventLevelMenu.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<script lang="ts" setup>
import {
EventLevelValue,
eventLevelValueMap,
eventLevels
} from '/@/consts/eventLevel'

interface Props {
eventLevel: EventLevelValue
}

defineProps<Props>()

const emit = defineEmits<{
(e: 'update-public-status', value: EventLevelValue): void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo
今更だけどここ、propsと合わせてupdate-event-levelの方がよさそうです

}>()
</script>

<template>
<div :class="$style.eventLevelMenu">
<div v-for="[key, value] in Object.entries(eventLevels)" :key="key">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo
keyvalueじゃなくて変更前のような命名でよさそうです

<button
:class="$style.eventLevelMenuButton"
:disabled="eventLevel === key"
@click="emit('update-public-status', eventLevelValueMap[value.value])"
SSlime-s marked this conversation as resolved.
Show resolved Hide resolved
>
<p :class="$style.statusName">{{ value.label }}</p>
<p :class="$style.description">
{{ value.description }}
</p>
</button>
</div>
</div>
</template>

<style lang="scss" module>
.eventLevelMenu {
width: max-content;
display: flex;
flex-direction: column;
padding: 1rem;
gap: 1rem;
border: 1px solid $color-secondary;
border-radius: 0.375rem;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
}
.eventLevelMenuButton {
text-align: left;
display: flex;
flex-direction: column;
gap: 0.25rem;
.description {
font-size: 0.75rem;
color: $color-secondary;
// タイポグラフィのため改行を有効に
white-space: pre-wrap;
}
.statusName {
font-weight: bold;
color: $color-secondary;
}
&:disabled {
& .statusName {
color: $color-primary;
}
& .description {
color: $color-text;
}
}
}
</style>
2 changes: 1 addition & 1 deletion src/consts/eventLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const eventLevels = deepFreeze({
anonymous: {
label: '匿名公開',
value: EventLevel.Anonymous,
description: '企画者の名前を伏せて、ポートフォリオにて公開します'
description: '企画者の名前を伏せて、\nポートフォリオにて公開します'
},
private: {
label: '非公開',
Expand Down