Skip to content

Commit 8c15591

Browse files
committed
refactor: update-kleros-app-readme-and-package-json
1 parent 88c1537 commit 8c15591

File tree

4 files changed

+33
-33
lines changed

4 files changed

+33
-33
lines changed

kleros-app/package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
{
22
"name": "@kleros/kleros-app",
33
"version": "1.0.0",
4-
"source": "src/lib/index.ts",
5-
"module": "./dist/kleros-app.js",
6-
"types": "./dist/kleros-app.d.ts",
7-
"type": "module",
8-
"scripts": {
9-
"clean": "rm -rf dist",
10-
"check-style": "eslint 'src/**/*.{ts,tsx}'",
11-
"check-types": "tsc --noEmit",
12-
"start": "vite dev src/",
13-
"build": "yarn clean & vite build"
14-
},
154
"repository": {
165
"type": "git",
176
"url": "git+ssh://[email protected]/kleros/kleros-v2.git"
@@ -27,7 +16,18 @@
2716
"url": "https://github.com/kleros/kleros-v2/issues"
2817
},
2918
"homepage": "https://github.com/kleros/kleros-v2#readme",
30-
"description": "",
19+
"description": "Library for Kleros DApps with reusable abstractions and components.",
20+
"source": "src/lib/index.ts",
21+
"module": "./dist/kleros-app.js",
22+
"types": "./dist/kleros-app.d.ts",
23+
"type": "module",
24+
"scripts": {
25+
"clean": "rm -rf dist",
26+
"check-style": "eslint 'src/**/*.{ts,tsx}'",
27+
"check-types": "tsc --noEmit",
28+
"start": "vite dev src/",
29+
"build": "yarn clean && vite build"
30+
},
3131
"files": [
3232
"dist"
3333
],

kleros-app/src/lib/atlas/providers/AtlasProvider.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ export const AtlasProvider: React.FC<{ config: AtlasConfig; children?: React.Rea
187187

188188
const token = await loginUser(atlasGqlClient, { message, signature });
189189
setAuthToken(token);
190-
} catch (err: any) {
191-
throw new Error(err);
190+
} catch (err: unknown) {
191+
throw err;
192192
} finally {
193193
setIsSigningIn(false);
194194
}
@@ -211,8 +211,8 @@ export const AtlasProvider: React.FC<{ config: AtlasConfig; children?: React.Rea
211211
refetchUser();
212212

213213
return userAdded;
214-
} catch (err: any) {
215-
throw new Error(err);
214+
} catch (err: unknown) {
215+
throw err;
216216
} finally {
217217
setIsAddingUser(false);
218218
}
@@ -235,8 +235,8 @@ export const AtlasProvider: React.FC<{ config: AtlasConfig; children?: React.Rea
235235
refetchUser();
236236

237237
return emailUpdated;
238-
} catch (err: any) {
239-
throw new Error(err);
238+
} catch (err: unknown) {
239+
throw err;
240240
} finally {
241241
setIsUpdatingUser(false);
242242
}
@@ -261,8 +261,8 @@ export const AtlasProvider: React.FC<{ config: AtlasConfig; children?: React.Rea
261261
uploadToIpfs({ baseUrl: config.uri, authToken }, { file, name: file.name, role, product: config.product })
262262
);
263263
return hash ? `/ipfs/${hash}` : null;
264-
} catch (err: any) {
265-
throw new Error(err);
264+
} catch (err: unknown) {
265+
throw err;
266266
} finally {
267267
setIsUploadingFile(false);
268268
}

web/eslint.config.mjs

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
3+
14
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
5+
import { FlatCompat } from "@eslint/eslintrc";
6+
import js from "@eslint/js";
7+
import tsParser from "@typescript-eslint/parser";
8+
import _import from "eslint-plugin-import";
29
import react from "eslint-plugin-react";
310
import reactHooks from "eslint-plugin-react-hooks";
411
import security from "eslint-plugin-security";
5-
import _import from "eslint-plugin-import";
612
import globals from "globals";
7-
import tsParser from "@typescript-eslint/parser";
8-
import path from "node:path";
9-
import { fileURLToPath } from "node:url";
10-
import js from "@eslint/js";
11-
import { FlatCompat } from "@eslint/eslintrc";
1213

1314
const __filename = fileURLToPath(import.meta.url);
1415
const __dirname = path.dirname(__filename);
@@ -63,7 +64,7 @@ export default [
6364

6465
settings: {
6566
react: {
66-
version: "^16.12.0",
67+
version: "^18.3.1",
6768
},
6869

6970
"import/resolver": {

web/src/layout/Header/navbar/Menu/Settings/Notifications/FormContactDetails/EmailVerificationInfo.tsx

+5-6
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,21 @@ interface IEmailInfo {
6464
const EmailVerificationInfo: React.FC<IEmailInfo> = ({ toggleIsSettingsOpen }) => {
6565
const { userExists, user, updateEmail } = useAtlasProvider();
6666

67-
// TODO : update toast info, dont show "Updating email"
68-
const resendEmail = useCallback(
67+
const resendVerificationEmail = useCallback(
6968
(e: React.FormEvent<HTMLFormElement>) => {
7069
e.preventDefault();
7170
if (!user) return;
72-
infoToast(`Updating Email ...`);
71+
infoToast(`Sending verfication email ...`);
7372
updateEmail({ newEmail: user.email })
7473
.then(async (res) => {
7574
if (res) {
76-
successToast("Email Updated successfully!");
75+
successToast("Verification email sent successfully!");
7776
toggleIsSettingsOpen();
7877
}
7978
})
8079
.catch((err) => {
8180
console.log(err);
82-
errorToast(`Updating Email failed: ${err?.message}`);
81+
errorToast(`Failed to send verification email: ${err?.message}`);
8382
});
8483
},
8584
[user, updateEmail, toggleIsSettingsOpen]
@@ -92,7 +91,7 @@ const EmailVerificationInfo: React.FC<IEmailInfo> = ({ toggleIsSettingsOpen }) =
9291
<InfoTitle>Email Verification Pending</InfoTitle>
9392
<InfoSubtitle>
9493
We sent you a verification email. Please, verify it.
95-
<br /> Didn’t receive the email? <StyledButton text="Resend it" onClick={resendEmail} />
94+
<br /> Didn’t receive the email? <StyledButton text="Resend it" onClick={resendVerificationEmail} />
9695
</InfoSubtitle>
9796
</InfoInnerContainer>
9897
</InfoContainer>

0 commit comments

Comments
 (0)