-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(media): Renaming MediaSetting to Settings (#1371)
* refactor(media): Renaming MediaSetting to Settings * chore: pr comments * chore: pr comments Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
8a83f34
commit 3164ac3
Showing
37 changed files
with
374 additions
and
368 deletions.
There are no files selected for viewing
35 changes: 0 additions & 35 deletions
35
src/lib/viewers/controls/media/MediaSettings/MediaSettingsMenuBack.scss
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
src/lib/viewers/controls/media/MediaSettings/MediaSettingsMenuItem.scss
This file was deleted.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
src/lib/viewers/controls/media/MediaSettings/MediaSettingsRadioItem.scss
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
src/lib/viewers/controls/media/MediaSettings/MediaSettingsRate.tsx
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
src/lib/viewers/controls/media/MediaSettings/MediaSettingsToggle.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
14 changes: 7 additions & 7 deletions
14
...a/MediaSettings/MediaSettingsAutoplay.tsx → ...trols/media/MediaSettingsMenuAutoplay.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
import React from 'react'; | ||
import MediaSettings, { Menu } from '.'; | ||
import Settings, { Menu } from '../settings'; | ||
|
||
export type Props = { | ||
autoplay: boolean; | ||
onAutoplayChange: (autoplay: boolean) => void; | ||
}; | ||
|
||
export default function MediaSettingsMenuAutoplay({ autoplay, onAutoplayChange }: Props): JSX.Element { | ||
const { setActiveMenu } = React.useContext(MediaSettings.Context); | ||
const { setActiveMenu } = React.useContext(Settings.Context); | ||
|
||
const handleChange = (value: boolean): void => { | ||
setActiveMenu(Menu.MAIN); | ||
onAutoplayChange(value); | ||
}; | ||
|
||
return ( | ||
<MediaSettings.Menu name={Menu.AUTOPLAY}> | ||
<MediaSettings.MenuBack label={__('media_autoplay')} /> | ||
<MediaSettings.RadioItem | ||
<Settings.Menu name={Menu.AUTOPLAY}> | ||
<Settings.MenuBack label={__('media_autoplay')} /> | ||
<Settings.RadioItem | ||
isSelected={!autoplay} | ||
label={__('media_autoplay_disabled')} | ||
onChange={handleChange} | ||
value={false} | ||
/> | ||
<MediaSettings.RadioItem | ||
<Settings.RadioItem | ||
isSelected={autoplay} | ||
label={__('media_autoplay_enabled')} | ||
onChange={handleChange} | ||
value | ||
/> | ||
</MediaSettings.Menu> | ||
</Settings.Menu> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import Settings, { Menu } from '../settings'; | ||
|
||
export type Props = { | ||
onRateChange: (rate: string) => void; | ||
rate: string; | ||
}; | ||
|
||
export default function MediaSettingsMenuRate({ rate, onRateChange }: Props): JSX.Element { | ||
const { setActiveMenu } = React.useContext(Settings.Context); | ||
|
||
const handleChange = (value: string): void => { | ||
setActiveMenu(Menu.MAIN); | ||
onRateChange(value); | ||
}; | ||
|
||
return ( | ||
<Settings.Menu name={Menu.RATE}> | ||
<Settings.MenuBack label={__('media_speed')} /> | ||
<Settings.RadioItem isSelected={rate === '0.5'} onChange={handleChange} value="0.5" /> | ||
<Settings.RadioItem | ||
isSelected={rate === '1.0'} | ||
label={__('media_speed_normal')} | ||
onChange={handleChange} | ||
value="1.0" | ||
/> | ||
<Settings.RadioItem isSelected={rate === '1.25'} onChange={handleChange} value="1.25" /> | ||
<Settings.RadioItem isSelected={rate === '1.5'} onChange={handleChange} value="1.5" /> | ||
<Settings.RadioItem isSelected={rate === '2.0'} onChange={handleChange} value="2.0" /> | ||
</Settings.Menu> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.