remove use memo from settings (#869)

main
Michael Fix 5 years ago committed by GitHub
parent cc5c2ab94a
commit 68d8b3f2d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,8 +24,7 @@ function KeyboardShortcut({ handle }) {
return null return null
} }
const WindowSettings = React.memo( function WindowSettings({
({
onChange, onChange,
windowTheme, windowTheme,
paddingHorizontal, paddingHorizontal,
@ -40,13 +39,10 @@ const WindowSettings = React.memo(
watermark, watermark,
onWidthChanging, onWidthChanging,
onWidthChanged onWidthChanged
}) => { }) {
return ( return (
<div className="settings-content"> <div className="settings-content">
<ThemeSelect <ThemeSelect selected={windowTheme || 'none'} onChange={onChange.bind(null, 'windowTheme')} />
selected={windowTheme || 'none'}
onChange={onChange.bind(null, 'windowTheme')}
/>
<div className="row"> <div className="row">
<Slider <Slider
label="Padding (vert)" label="Padding (vert)"
@ -131,11 +127,17 @@ const WindowSettings = React.memo(
</style> </style>
</div> </div>
) )
} }
)
const TypeSettings = React.memo( function TypeSettings({
({ onChange, onUpload, font, size, lineHeight, onWidthChanging, onWidthChanged }) => { onChange,
onUpload,
font,
size,
lineHeight,
onWidthChanging,
onWidthChanged
}) {
return ( return (
<div className="settings-content"> <div className="settings-content">
<FontSelect <FontSelect
@ -163,12 +165,11 @@ const TypeSettings = React.memo(
/> />
</div> </div>
) )
} }
)
const resetButtonStyle = { borderTop: `1px solid ${COLORS.SECONDARY}` } const resetButtonStyle = { borderTop: `1px solid ${COLORS.SECONDARY}` }
const MiscSettings = React.memo(({ format, reset, applyPreset, settings }) => { function MiscSettings({ format, reset, applyPreset, settings }) {
const input = React.useRef(null) const input = React.useRef(null)
let download let download
try { try {
@ -226,7 +227,7 @@ const MiscSettings = React.memo(({ format, reset, applyPreset, settings }) => {
</style> </style>
</div> </div>
) )
}) }
const settingButtonStyle = { const settingButtonStyle = {
width: '40px', width: '40px',

Loading…
Cancel
Save