Skip to content

Commit

Permalink
Add Enums strings
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowFish085 committed Apr 11, 2020
1 parent 41d7c27 commit d9204fc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/activity/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ export default class Item extends Vue {
const parts = [];
// Add type part.
parts.push(this.data.params!.type);
parts.push(Enum.Strings[this.data.params!.type]);
// Add year part if present.
if (this.data.params!.year) parts.push(this.data.params!.year);
// Add season part if present.
if (this.data.params!.season) parts.push(this.data.params!.season);
if (this.data.params!.season) parts.push(Enum.Strings[this.data.params!.season]);
return parts.join(' / ');
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/search/inputs/InputSeason.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:disabled="invalidType || disabled"
@change="$emit('update:value', $event.target.value || null)">
<option :value="null">All seasons</option>
<option v-for="y in seasons" :key="y" :value="y">{{ y }}</option>
<option v-for="y in seasons" :key="y" :value="y">{{ strings[y] }}</option>
</select>
<!-- eslint-enable max-len -->
</template>
Expand All @@ -31,6 +31,9 @@ export default class InputSeason extends Vue {
/** Search season. */
seasons = Enum.SearchSeason;
/** Strings */
strings = Enum.Strings;
/**
* Disabled?
*/
Expand Down
17 changes: 17 additions & 0 deletions src/utils/Enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,20 @@ export enum ResponseTypeKeys {
CHARACTERS = 'characters',
STAFF = 'staff',
}

/**
* Strings
*/
export enum Strings {
// Search type.
ANIME = 'Anime',
MANGA = 'Manga',
STUDIOS = 'Studios',
CHARACTERS = 'Characters',
STAFF = 'Staff',
// Search season.
SPRING = 'Spring',
SUMMER = 'Summer',
FALL = 'Fall',
WINTER = 'Winter',
}

0 comments on commit d9204fc

Please sign in to comment.