From 7b1d2f2d2b4acce207a7d7b00ed4d025b82920ba Mon Sep 17 00:00:00 2001 From: adriano Date: Wed, 9 Aug 2023 10:26:54 -0300 Subject: [PATCH] =?UTF-8?q?refatora=C3=A7=C3=A3o=20de=20frontend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ConfigModal/index.js | 31 +++++--------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/ConfigModal/index.js b/frontend/src/components/ConfigModal/index.js index 0f2ef88..c221455 100644 --- a/frontend/src/components/ConfigModal/index.js +++ b/frontend/src/components/ConfigModal/index.js @@ -95,12 +95,12 @@ const ConfigModal = ({ open, onClose, change }) => { try { const { data } = await api.get('/settings') - const outBusinessHours = data.config.find((c) => c.key == "outBusinessHours") - const ticketExpiration = data.config.find((c) => c.key == "ticketExpiration") - const saturday = data.config.find((c) => c.key == "saturday") - const sunday = data.config.find((c) => c.key == "sunday") - const weekend = data.config.find((c) => c.key == "weekend") - const holiday = data.config.find((c) => c.key == "holiday") + const outBusinessHours = data.config.find((c) => c.key === "outBusinessHours") + const ticketExpiration = data.config.find((c) => c.key === "ticketExpiration") + const saturday = data.config.find((c) => c.key === "saturday") + const sunday = data.config.find((c) => c.key === "sunday") + const weekend = data.config.find((c) => c.key === "weekend") + const holiday = data.config.find((c) => c.key === "holiday") setConfig({ startTimeBus: outBusinessHours.startTime, @@ -443,24 +443,7 @@ const ConfigModal = ({ open, onClose, change }) => { } - -const TimePickerField = ({ field, form, ...other }) => { - const { name, value } = field - - const handleChange = (time) => { - form.setFieldValue(name, time, true) - } - - return ( - - ) -} + export default React.memo(ConfigModal)