Skip to content

Commit

Permalink
react-s-alert
Browse files Browse the repository at this point in the history
  • Loading branch information
romiogaku committed Feb 21, 2018
1 parent 0cc8935 commit d644525
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 78 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"axios": "^0.17.1",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-s-alert": "^1.4.1",
"react-scripts": "1.1.1",
"react-toastify": "^3.3.4",
"react-tooltip": "^3.4.0"
},
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from "react";
import Search from "./Search";
import Grid from "./Grid";
import axios from "axios";
import Alert from "react-s-alert";

const instance = axios.create({
baseURL: "http://localhost:29903/api/",
Expand Down Expand Up @@ -55,6 +56,7 @@ class App extends React.Component {
onKeyPress={e => this.handleKeyPress(e)}
/>
<Grid list={this.state.list} />
<Alert stack={{ limit: 1 }} />
</div>
);
}
Expand Down
18 changes: 9 additions & 9 deletions src/components/Grid.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import * as React from "react";
import ReactTooltip from "react-tooltip";
import { ToastContainer, toast } from "react-toastify";
import Alert from "react-s-alert";
import "./Grid.css";
import "react-s-alert/dist/s-alert-default.css";
import "react-s-alert/dist/s-alert-css-effects/flip.css";

const copyLgtm = (e, { word, url }) => {
const text = `![${word}](${url})`;
Expand All @@ -19,8 +21,12 @@ const copyLgtm = (e, { word, url }) => {
document.execCommand("copy");
// 追加テキストエリアを削除
bodyElm.removeChild(copyFrom);
// トースト表示
toast("クリップボードにコピーしました");
// toast
Alert.info("クリップボードにコピーしました", {
position: "top",
effect: "flip",
timeout: 1000
});
};

const Grid = props => {
Expand All @@ -47,12 +53,6 @@ const Grid = props => {
});
return (
<div>
<ToastContainer
hideProgressBar={true}
autoClose={2000}
closeButton={false}
position="top-center"
/>
<ul className="grid">{listItems}</ul>
</div>
);
Expand Down
78 changes: 10 additions & 68 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ babel-register@^6.26.0:
mkdirp "^0.5.1"
source-map-support "^0.4.15"

[email protected], babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0:
[email protected], babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
dependencies:
Expand Down Expand Up @@ -1049,10 +1049,6 @@ [email protected]:
dependencies:
hoek "4.x.x"

bowser@^1.7.3:
version "1.9.2"
resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.2.tgz#d66fc868ca5f4ba895bee1363c343fe7b37d3394"

boxen@^1.2.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b"
Expand Down Expand Up @@ -1276,10 +1272,6 @@ center-align@^0.1.1:
align-text "^0.1.3"
lazy-cache "^1.0.3"

chain-function@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/chain-function/-/chain-function-1.0.0.tgz#0d4ab37e7e18ead0bdc47b920764118ce58733dc"

[email protected], chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
Expand Down Expand Up @@ -1634,12 +1626,6 @@ [email protected]:
version "0.0.4"
resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0"

css-in-js-utils@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/css-in-js-utils/-/css-in-js-utils-2.0.0.tgz#5af1dd70f4b06b331f48d22a3d86e0786c0b9435"
dependencies:
hyphenate-style-name "^1.0.2"

[email protected]:
version "0.28.7"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.7.tgz#5f2ee989dd32edd907717f953317656160999c1b"
Expand Down Expand Up @@ -1928,10 +1914,6 @@ dom-converter@~0.1:
dependencies:
utila "~0.3"

dom-helpers@^3.2.0:
version "3.3.1"
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.3.1.tgz#fc1a4e15ffdf60ddde03a480a9c0fece821dd4a6"

dom-serializer@0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82"
Expand Down Expand Up @@ -2506,7 +2488,7 @@ fb-watchman@^2.0.0:
dependencies:
bser "^2.0.0"

fbjs@^0.8.12, fbjs@^0.8.16:
fbjs@^0.8.16:
version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
dependencies:
Expand Down Expand Up @@ -2750,16 +2732,6 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"

glamor@^2.20.40:
version "2.20.40"
resolved "https://registry.yarnpkg.com/glamor/-/glamor-2.20.40.tgz#f606660357b7cf18dface731ad1a2cfa93817f05"
dependencies:
fbjs "^0.8.12"
inline-style-prefixer "^3.0.6"
object-assign "^4.1.1"
prop-types "^15.5.10"
through "^2.3.8"

glob-base@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
Expand Down Expand Up @@ -3111,10 +3083,6 @@ https-browserify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"

hyphenate-style-name@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.2.tgz#31160a36930adaf1fc04c6074f7eb41465d4ec4b"

[email protected], iconv-lite@^0.4.17, iconv-lite@~0.4.13:
version "0.4.19"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b"
Expand Down Expand Up @@ -3185,13 +3153,6 @@ ini@^1.3.4, ini@~1.3.0:
version "1.3.5"
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"

inline-style-prefixer@^3.0.6:
version "3.0.8"
resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-3.0.8.tgz#8551b8e5b4d573244e66a34b04f7d32076a2b534"
dependencies:
bowser "^1.7.3"
css-in-js-utils "^2.0.0"

[email protected], inquirer@^3.0.6:
version "3.3.0"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9"
Expand Down Expand Up @@ -5039,7 +5000,7 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"

prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0:
prop-types@^15.5.10, prop-types@^15.6.0:
version "15.6.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies:
Expand Down Expand Up @@ -5199,6 +5160,12 @@ react-error-overlay@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-4.0.0.tgz#d198408a85b4070937a98667f500c832f86bd5d4"

react-s-alert@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/react-s-alert/-/react-s-alert-1.4.1.tgz#ef3665a9d98c4cf2e448fc2d84e48aeca799bb5a"
dependencies:
babel-runtime "^6.23.0"

[email protected]:
version "1.1.1"
resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-1.1.1.tgz#279d449f7311fed910506987a1ade014027788a8"
Expand Down Expand Up @@ -5243,32 +5210,13 @@ [email protected]:
optionalDependencies:
fsevents "^1.1.3"

react-toastify@^3.3.4:
version "3.3.4"
resolved "https://registry.yarnpkg.com/react-toastify/-/react-toastify-3.3.4.tgz#29f882653a41d8958a0da3ea8f07115a775eda6e"
dependencies:
glamor "^2.20.40"
prop-types "^15.6.0"
react-transition-group "^2.2.1"

react-tooltip@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/react-tooltip/-/react-tooltip-3.4.0.tgz#037f38f797c3e6b1b58d2534ccc8c2c76af4f52d"
dependencies:
classnames "^2.2.5"
prop-types "^15.6.0"

react-transition-group@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.2.1.tgz#e9fb677b79e6455fd391b03823afe84849df4a10"
dependencies:
chain-function "^1.0.0"
classnames "^2.2.5"
dom-helpers "^3.2.0"
loose-envify "^1.3.1"
prop-types "^15.5.8"
warning "^3.0.0"

react@^16.2.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba"
Expand Down Expand Up @@ -6111,7 +6059,7 @@ throat@^3.0.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/throat/-/throat-3.2.0.tgz#50cb0670edbc40237b9e347d7e1f88e4620af836"

through@^2.3.6, through@^2.3.8:
through@^2.3.6:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"

Expand Down Expand Up @@ -6394,12 +6342,6 @@ walker@~1.0.5:
dependencies:
makeerror "1.0.x"

warning@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c"
dependencies:
loose-envify "^1.0.0"

watch@~0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc"
Expand Down

0 comments on commit d644525

Please sign in to comment.