From d69ef2b71ed94eae0186bc01334763189c95ae12 Mon Sep 17 00:00:00 2001 From: Spectralitree Date: Tue, 13 Apr 2021 20:46:43 +0200 Subject: [PATCH] fix react-hook-form stuffs --- package-lock.json | 5 +++++ package.json | 1 + src/App.js | 4 ++-- src/Components/MemberCard.js | 34 +++++++++++++++++----------------- src/Components/MemberPage.js | 36 ++++++++++++++++++------------------ src/Components/Memberlist.js | 30 +++++++++++++++--------------- src/Components/Public.js | 2 +- src/Components/System.js | 18 +++++++++--------- 8 files changed, 68 insertions(+), 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index b6248ae1..566117ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12456,6 +12456,11 @@ "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.8.tgz", "integrity": "sha512-HvPuUQnLp5H7TouGq3kzBeioJmXms1wHy9EGjz2OURWBp4qZO6AfGEcnxts1D/CbwPLRAgTMPCEgYhA3sEM4vw==" }, + "react-hook-form": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.0.7.tgz", + "integrity": "sha512-PUiiEzAsLoO0hlO9Q3z/smDQ0mgPffL52QhLYvtjK11vDkXUgDc1l3ZXXvdeR4+VGwJNIuhl0bboFkhJN3E+Qg==" + }, "react-icons": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.1.0.tgz", diff --git a/package.json b/package.json index 44e594c5..d1627a76 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "react": "^17.0.1", "react-bootstrap": "^1.4.0", "react-dom": "^17.0.1", + "react-hook-form": "^7.0.7", "react-icons": "^4.1.0", "react-lazyload": "^3.1.0", "react-moment": "^1.0.0", diff --git a/src/App.js b/src/App.js index 4cea5913..5770c846 100644 --- a/src/App.js +++ b/src/App.js @@ -58,7 +58,7 @@ export default function App() { headers: { 'Authorization': JSON.stringify(localStorage.getItem("token")).slice(1, -1) }}).then ( res => res.json() - ).then (data => { + ).then (data => { localStorage.setItem('user', JSON.stringify(data)); setIsSubmit(true); setIsLoading(false); @@ -145,7 +145,7 @@ export default function App() { - + Submit diff --git a/src/Components/MemberCard.js b/src/Components/MemberCard.js index 71086e20..3f92e672 100644 --- a/src/Components/MemberCard.js +++ b/src/Components/MemberCard.js @@ -229,34 +229,34 @@ export default function MemberCard(props) { Name: - + Display name: - + Birthday: - + (YYYY-MM-DD) Pronouns: - + Avatar url: - + Color: - + (hexcode) Description: - + setEditMode(false)}>Cancel Submit setOpen(o => !o)}>Delete @@ -271,7 +271,7 @@ export default function MemberCard(props) {

If you're sure you want to delete this member, please enter the member ID ({member.id}) below.

Member ID: - + Delete Cancel @@ -298,49 +298,49 @@ export default function MemberCard(props) { Visibility: - + Name: - + Description: - + Avatar: - + Birthday: - + Pronouns: - + Meta: - + @@ -370,9 +370,9 @@ export default function MemberCard(props) { - + - + diff --git a/src/Components/MemberPage.js b/src/Components/MemberPage.js index e287df94..7fae1ebb 100644 --- a/src/Components/MemberPage.js +++ b/src/Components/MemberPage.js @@ -254,34 +254,34 @@ export default function MemberPage(props) { Name: - + Display name: - + Birthday: - + (YYYY-MM-DD) Pronouns: - + Avatar url: - + Color: - + (hexcode) Description: - + setEditMode(false)}>Cancel Submit setOpen(o => !o)}>Delete @@ -296,7 +296,7 @@ export default function MemberPage(props) {

If you're sure you want to delete this member, please enter the member ID ({member.id}) below.

Member ID: - + Delete Cancel @@ -320,52 +320,52 @@ export default function MemberPage(props) { { privacyMode ?
Editing privacy settings
- + Visibility: - + Name: - + Description: - + Avatar: - + Birthday: - + Pronouns: - + Meta: - + @@ -395,9 +395,9 @@ export default function MemberPage(props) { - + - + diff --git a/src/Components/Memberlist.js b/src/Components/Memberlist.js index 6ca8ffb0..81711ece 100644 --- a/src/Components/Memberlist.js +++ b/src/Components/Memberlist.js @@ -279,28 +279,28 @@ export default function Memberlist() { Name: - + Display name: - + Birthday: - + (YYYY-MM-DD) Pronouns: - + Avatar url: - + Color: - + (hexcode) @@ -320,9 +320,9 @@ export default function Memberlist() { - + - + @@ -333,42 +333,42 @@ export default function Memberlist() { Visibility: - + Name: - + Description: - + Birthday: - + Pronouns: - + Meta: - + @@ -377,7 +377,7 @@ export default function Memberlist() {
: "" } Description: - + Submit Cancel
diff --git a/src/Components/Public.js b/src/Components/Public.js index 932e90ba..ba95d61a 100644 --- a/src/Components/Public.js +++ b/src/Components/Public.js @@ -29,7 +29,7 @@ export default function Public () { - + Submit diff --git a/src/Components/System.js b/src/Components/System.js index 14c172dc..0d726a4f 100644 --- a/src/Components/System.js +++ b/src/Components/System.js @@ -139,25 +139,25 @@ const submitPrivacy = data => { Name: - + Tag: - + Timezone: - + { invalidTimezone ? Please enter a valid timezone : "" } Avatar url: - + Description: - + setEditMode(false)}>Cancel Submit : @@ -173,28 +173,28 @@ const submitPrivacy = data => { Description: - + Member list: - + Front: - + Front history: - +