- updated button to match
This commit is contained in:
@@ -56,23 +56,13 @@ const ModemSettings = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<ModemToggle
|
||||
showSettings={showSettings}
|
||||
onShowSettings={setShowSettings}
|
||||
/>
|
||||
<ModemToggle showSettings={showSettings} onShowSettings={setShowSettings} />
|
||||
{!showSettings && (
|
||||
<Formik
|
||||
initialValues={inititalValues}
|
||||
onSubmit={handleSubmit}
|
||||
enableReinitialize
|
||||
>
|
||||
<Formik initialValues={inititalValues} onSubmit={handleSubmit} enableReinitialize>
|
||||
{({ isSubmitting }) => (
|
||||
<Form className="flex flex-col space-y-5 px-2">
|
||||
<FormGroup>
|
||||
<label
|
||||
htmlFor="apn"
|
||||
className="font-medium whitespace-nowrap md:w-2/3"
|
||||
>
|
||||
<label htmlFor="apn" className="font-medium whitespace-nowrap md:w-2/3">
|
||||
APN
|
||||
</label>
|
||||
<Field
|
||||
@@ -84,10 +74,7 @@ const ModemSettings = () => {
|
||||
/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<label
|
||||
htmlFor="username"
|
||||
className="font-medium whitespace-nowrap md:w-2/3"
|
||||
>
|
||||
<label htmlFor="username" className="font-medium whitespace-nowrap md:w-2/3">
|
||||
Username
|
||||
</label>
|
||||
<Field
|
||||
@@ -99,10 +86,7 @@ const ModemSettings = () => {
|
||||
/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<label
|
||||
htmlFor="password"
|
||||
className="font-medium whitespace-nowrap md:w-2/3"
|
||||
>
|
||||
<label htmlFor="password" className="font-medium whitespace-nowrap md:w-2/3">
|
||||
Password
|
||||
</label>
|
||||
<div className="flex gap-2 items-center relative mb-4">
|
||||
@@ -122,10 +106,7 @@ const ModemSettings = () => {
|
||||
</div>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<label
|
||||
htmlFor="password"
|
||||
className="font-medium whitespace-nowrap md:w-2/3"
|
||||
>
|
||||
<label htmlFor="password" className="font-medium whitespace-nowrap md:w-2/3">
|
||||
Password
|
||||
</label>
|
||||
<Field
|
||||
@@ -140,11 +121,9 @@ const ModemSettings = () => {
|
||||
</FormGroup>
|
||||
<button
|
||||
type="submit"
|
||||
className="bg-[#26B170] text-white px-4 py-2 rounded hover:bg-green-700 transition w-full md:w-[50%]"
|
||||
className="w-1/4 text-white bg-green-700 hover:bg-green-800 font-small rounded-lg text-sm px-2 py-2.5"
|
||||
>
|
||||
{isSubmitting || modemMutation.isPending
|
||||
? "Saving..."
|
||||
: "Save Modem settings"}
|
||||
{isSubmitting || modemMutation.isPending ? "Saving..." : "Save Modem settings"}
|
||||
</button>
|
||||
</Form>
|
||||
)}
|
||||
|
||||
@@ -37,18 +37,11 @@ const WiFiSettingsForm = () => {
|
||||
await wifiMutation.mutateAsync(wifiConfig);
|
||||
};
|
||||
return (
|
||||
<Formik
|
||||
initialValues={initialValues}
|
||||
onSubmit={handleSubmit}
|
||||
enableReinitialize
|
||||
>
|
||||
<Formik initialValues={initialValues} onSubmit={handleSubmit} enableReinitialize>
|
||||
{({ isSubmitting }) => (
|
||||
<Form className="flex flex-col space-y-5 px-2">
|
||||
<FormGroup>
|
||||
<label
|
||||
htmlFor="ssid"
|
||||
className="font-medium whitespace-nowrap md:w-2/3"
|
||||
>
|
||||
<label htmlFor="ssid" className="font-medium whitespace-nowrap md:w-2/3">
|
||||
SSID
|
||||
</label>
|
||||
<Field
|
||||
@@ -60,10 +53,7 @@ const WiFiSettingsForm = () => {
|
||||
/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<label
|
||||
htmlFor="password"
|
||||
className="font-medium whitespace-nowrap md:w-2/3"
|
||||
>
|
||||
<label htmlFor="password" className="font-medium whitespace-nowrap md:w-2/3">
|
||||
Password
|
||||
</label>
|
||||
<div className="flex gap-2 items-center relative mb-4">
|
||||
@@ -83,10 +73,7 @@ const WiFiSettingsForm = () => {
|
||||
</div>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<label
|
||||
htmlFor="encryption"
|
||||
className="font-medium whitespace-nowrap md:w-2/3"
|
||||
>
|
||||
<label htmlFor="encryption" className="font-medium whitespace-nowrap md:w-2/3">
|
||||
WPA/Encryption Type
|
||||
</label>
|
||||
<Field
|
||||
@@ -103,11 +90,9 @@ const WiFiSettingsForm = () => {
|
||||
</FormGroup>
|
||||
<button
|
||||
type="submit"
|
||||
className="bg-[#26B170] text-white px-4 py-2 rounded hover:bg-green-700 transition w-full md:w-[50%]"
|
||||
className="w-1/4 text-white bg-green-700 hover:bg-green-800 font-small rounded-lg text-sm px-2 py-2.5"
|
||||
>
|
||||
{isSubmitting || wifiMutation.isPending
|
||||
? "Saving..."
|
||||
: " Save WiFi settings"}
|
||||
{isSubmitting || wifiMutation.isPending ? "Saving..." : " Save WiFi settings"}
|
||||
</button>
|
||||
</Form>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user