Skip to content

Commit

Permalink
fix(series): add season prefix to episodes dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Jun 23, 2021
1 parent fed2e3b commit 3a89e3d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
'home',
'playlist',
'videodetail',
'series',
'search',
'watchhistory',
'favorites',
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ The allowed scopes are:
- home
- playlist
- videodetail
- series
- search
- watchhistory
- favorites
Expand Down
3 changes: 3 additions & 0 deletions src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Props = {
defaultLabel: string;
options: string[];
optionsStyle?: string;
valuePrefix?: string;
onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
};

Expand All @@ -19,6 +20,7 @@ const Dropdown: React.FC<Props & React.AriaAttributes> = ({
options,
onChange,
optionsStyle,
valuePrefix,
...rest
}: Props & React.AriaAttributes) => {
return (
Expand All @@ -29,6 +31,7 @@ const Dropdown: React.FC<Props & React.AriaAttributes> = ({
</option>
{options.map((option) => (
<option className={classNames(styles.option, optionsStyle)} key={option} value={option}>
{valuePrefix}
{option}
</option>
))}
Expand Down
1 change: 1 addition & 0 deletions src/components/Filter/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const Filter: FC<Props> = ({ name, value, defaultLabel, options, setValue, value
<Dropdown
options={options}
defaultLabel={defaultLabel}
valuePrefix={valuePrefix}
name={name}
value={value}
onChange={handleChange}
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/en_US/video.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"add_to_favorites": "Add to favorites",
"all_seasons": "All seasons",
"copied_url": "Copied url",
"current_episode": "Current episode",
"currently_playing": "Currently playing",
"episodes": "Episodes",
"favorite": "Favorite",
"remove_from_favorites": "Remove from favorites",
"season_prefix": "Season ",
"share": "Share",
"start_watching": "Start watching",
"trailer": "Trailer",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/nl_NL/video.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"add_to_favorites": "",
"all_seasons": "",
"copied_url": "",
"current_episode": "",
"currently_playing": "",
"episodes": "",
"favorite": "",
"remove_from_favorites": "",
"season_prefix": "",
"share": "",
"start_watching": "",
"trailer": "",
Expand Down
4 changes: 2 additions & 2 deletions src/screens/Series/Series.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ const Series = ({
<Filter
name="categories"
value={seasonFilter}
valuePrefix="Season "
defaultLabel="All"
valuePrefix={t('season_prefix')}
defaultLabel={t('all_seasons')}
options={filters}
setValue={setSeasonFilter}
/>
Expand Down

0 comments on commit 3a89e3d

Please sign in to comment.