Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoya0819 committed Sep 5, 2024
1 parent 73eef87 commit a969620
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"stylelint:fix": "stylelint \"**/*.{css,scss,sass}\" --fix"
},
"dependencies": {
"@ky-y./ui": "^1.0.167",
"@ky-y./ui": "^1.0.207",
"next": "^14.2.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
7 changes: 6 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Root } from "@ky-y./ui";
import type { AppProps } from "next/app";

import "styles/app.scss";
Expand All @@ -6,7 +7,11 @@ import "styles/app.scss";
import "@ky-y./ui/style.css";

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
return (
<Root>
<Component {...pageProps} />
</Root>
);
}

export default MyApp;
6 changes: 4 additions & 2 deletions src/sections/password/Generator/Generator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Card, Range, Section, Textarea } from "@ky-y./ui";
import { Button, Card, Range, Section, Textarea, toast } from "@ky-y./ui";
import { Roboto_Mono } from "next/font/google";
import { Dispatch, FC, SetStateAction, useEffect, useState } from "react";

Expand Down Expand Up @@ -88,15 +88,17 @@ const copy = (password: string) => {
textarea.select();
// noinspection JSDeprecatedSymbols
document.execCommand("copy");
toast.success("Copy Success");

document.body.removeChild(textarea);
}
else {
navigator.clipboard.writeText(password)
.then(() => {
toast.success("Copy Success");
})
.catch(() => {
alert("クリップボードへの書き込み時にエラーが発生しました。\nAn error occurred during copying.");
toast.error("Copy Failed");
});
}
};
11 changes: 6 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@ky-y./kytools@workspace:."
dependencies:
"@ky-y./ui": "npm:^1.0.167"
"@ky-y./ui": "npm:^1.0.207"
"@types/node": "npm:^20.14.11"
"@types/react": "npm:^18.3.3"
"@types/uuid": "npm:^10.0.0"
Expand Down Expand Up @@ -205,16 +205,17 @@ __metadata:
languageName: unknown
linkType: soft

"@ky-y./ui@npm:^1.0.167":
version: 1.0.167
resolution: "@ky-y./ui@npm:1.0.167"
"@ky-y./ui@npm:^1.0.207":
version: 1.0.207
resolution: "@ky-y./ui@npm:1.0.207"
dependencies:
react: "npm:^18.3.1"
react-icons: "npm:^5.2.1"
react-textarea-autosize: "npm:^8.5.3"
shiki: "npm:^1.14.1"
sonner: "npm:^1.5.0"
uuid: "npm:^10.0.0"
checksum: 10c0/ab64d128b85ffb11acf3427ce155e1b6e98d7201e4ce06de50d965c93ca0846090086e25e6bd87f20571eb16c1f58a5fb169872442494619b3038733240354ce
checksum: 10c0/95c2ee5818830ee677339f903ca41dff7e4457ae43e8a51ea3c1bde1245ef772b2c19f40a49e83cd05f3b6e53413f22a4b82836a4af049e80348390b4d01ae80
languageName: node
linkType: hard

Expand Down

0 comments on commit a969620

Please sign in to comment.