Skip to content

Commit 35e1ba4

Browse files
authored
Merge pull request #984 from traPtitech/feature/refine-ui-colors
feat: 申請のステータス関連のUIの色と表示を調整
2 parents 1fd4fcd + 03d8534 commit 35e1ba4

File tree

15 files changed

+127
-140
lines changed

15 files changed

+127
-140
lines changed

client/src/plugins/theme.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ export const colors = {
88
info: "#00d3ee",
99
success: "#5cb860",
1010
warning: "#ffa21a",
11-
done: "#009688"
11+
done: "#009688",
12+
state_submitted: "#42A5F5",
13+
state_fix_required: "#FFA726",
14+
state_accepted: "#66BB6A",
15+
state_fully_repaid: "#AB47BC",
16+
state_rejected: "#EF5350",
17+
diff_added: "#e6ffed",
18+
diff_removed: "#ffeef0",
19+
text_primary_disabled: "#888888"
1220
};
1321

1422
export default colors;

client/src/styles/_variables.scss

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1 @@
1-
$color-primary: #011a27;
2-
$color-primary-hover: #00103a;
3-
$color-primary-disabled: #00669c;
4-
$color-primary-accent: #52254f;
5-
6-
$color-secondary: #f0daee;
7-
$color-secondary-hover: #e0bfde;
8-
$color-secondary-disabled: #cccccc;
9-
$color-secondary-accent: #e0bfde;
10-
11-
$color-grey: #9e9e9e;
12-
$color-info: #00d3ee;
13-
$color-success: #5cb860;
14-
$color-warning: #ffa21a;
15-
$color-error: #f55a4e;
16-
17-
$color-text-primary: #ffffff;
18-
$color-text-primary-disabled: #888888;
19-
20-
$color-text-secondary: #011a27;
21-
$color-text-secondary-disabled: #011a275b;
22-
23-
$color-text-white: #eeeeee;
24-
25-
$color-background: #eeeeee;
26-
27-
$breakpoint: 768px;
1+
$breakpoint: 768px;

client/src/use/stateColor.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
export const getStateLabel = (state: string): string => {
2+
switch (state) {
3+
case "submitted":
4+
return "承認待ち";
5+
case "fix_required":
6+
return "要修正";
7+
case "accepted":
8+
return "承認済み";
9+
case "fully_repaid":
10+
return "返済完了";
11+
case "rejected":
12+
return "却下";
13+
default:
14+
return "ERROR";
15+
}
16+
};
17+
18+
export const getStateColor = (state: string): string => {
19+
switch (state) {
20+
case "submitted":
21+
return "state_submitted";
22+
case "rejected":
23+
return "state_rejected";
24+
case "fix_required":
25+
return "state_fix_required";
26+
case "accepted":
27+
return "state_accepted";
28+
case "fully_repaid":
29+
return "state_fully_repaid";
30+
default:
31+
return "white";
32+
}
33+
};
34+
35+
export const getStateTextColor = (state: string): string => {
36+
switch (state) {
37+
case "fix_required":
38+
return "text-black";
39+
case "submitted":
40+
case "rejected":
41+
case "accepted":
42+
case "fully_repaid":
43+
default:
44+
return "text-white";
45+
}
46+
};

client/src/views/ApplicationListPage.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
<script setup lang="ts">
130130
import { useApplicationListStore } from "@/stores/applicationList";
131131
import { useUserListStore } from "@/stores/userList";
132+
import { getStateLabel } from "@/use/stateColor";
132133
import { storeToRefs } from "pinia";
133134
import { onMounted, reactive, ref } from "vue";
134135
import { useDisplay } from "vuetify";
@@ -159,11 +160,11 @@ const type_items = [
159160
];
160161
161162
const state_items = [
162-
{ state: "submitted", jpn: "提出済み" },
163-
{ state: "rejected", jpn: "却下" },
164-
{ state: "fix_required", jpn: "要修正" },
165-
{ state: "accepted", jpn: "払い戻し待ち" },
166-
{ state: "fully_repaid", jpn: "払い戻し完了" }
163+
{ state: "submitted", jpn: getStateLabel("submitted") },
164+
{ state: "rejected", jpn: getStateLabel("rejected") },
165+
{ state: "fix_required", jpn: getStateLabel("fix_required") },
166+
{ state: "accepted", jpn: getStateLabel("accepted") },
167+
{ state: "fully_repaid", jpn: getStateLabel("fully_repaid") }
167168
];
168169
169170
const header = {

client/src/views/components/ApplicationDetail.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ onMounted(async () => {
133133
}
134134
.section {
135135
margin: 16px 0;
136-
border-bottom: 1px solid $color-grey;
136+
border-bottom: 1px solid rgb(var(--v-theme-grey));
137137
}
138138
.section_title {
139-
color: $color-text-primary-disabled;
139+
color: rgb(var(--v-theme-text_primary_disabled));
140140
}
141141
.section_item {
142142
margin-left: 8px;

client/src/views/components/ApplicationDetailDifference.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ onMounted(async () => {
8787
padding: 8px;
8888
}
8989
.before {
90-
background: #ffeef0;
90+
background: rgb(var(--v-theme-diff_removed));
9191
display: flex;
9292
padding: 8px;
9393
}
9494
.after {
95-
background: #e6ffed;
95+
background: rgb(var(--v-theme-diff_added));
9696
display: flex;
9797
padding: 8px;
9898
}

client/src/views/components/ChangeLog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ defineProps<{
5656
flex-wrap: wrap;
5757
max-width: 100%;
5858
margin-bottom: 8px;
59-
color: $color-grey;
59+
color: rgb(var(--v-theme-grey));
6060
}
6161
</style>

client/src/views/components/CommentLog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ const cancelChange = () => {
156156
<style lang="scss" module>
157157
.text {
158158
display: flex;
159-
color: $color-grey;
159+
color: rgb(var(--v-theme-grey));
160160
}
161161
.button {
162162
margin: 8px 8px 0 0;
163163
}
164164
.grey_text {
165-
color: $color-grey;
165+
color: rgb(var(--v-theme-grey));
166166
}
167167
</style>

client/src/views/components/FixApplicationDetail.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,10 @@ onMounted(async () => {
330330
}
331331
.section {
332332
margin: 16px 0;
333-
border-bottom: 1px solid $color-grey;
333+
border-bottom: 1px solid rgb(var(--v-theme-grey));
334334
}
335335
.section_title {
336-
color: $color-text-primary-disabled;
336+
color: rgb(var(--v-theme-text_primary_disabled));
337337
}
338338
.section_item {
339339
margin-left: 8px;

client/src/views/components/RefundLog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ const datePrint = (date: string) => {
6464

6565
<style lang="scss" module>
6666
.text {
67-
color: $color-grey;
67+
color: rgb(var(--v-theme-grey));
6868
}
6969
</style>

0 commit comments

Comments
 (0)