mirror of
https://github.com/MedzikUser/gatsby-pingbot
synced 2024-08-15 03:20:27 +00:00
fix: Fix enter button click
This commit is contained in:
parent
397411b341
commit
fd11c3ade8
3 changed files with 21 additions and 6 deletions
1
src/css/notifications.sass
Normal file
1
src/css/notifications.sass
Normal file
|
@ -0,0 +1 @@
|
|||
@import 'react-notifications/lib/notifications.css'
|
|
@ -1,17 +1,23 @@
|
|||
import React from "react"
|
||||
import AniLink from "gatsby-plugin-transition-link/AniLink"
|
||||
import { NotificationManager, NotificationContainer } from 'react-notifications'
|
||||
import 'react-notifications/lib/notifications.css'
|
||||
import { NotificationManager, NotificationContainer } from "react-notifications"
|
||||
|
||||
import Seo from "../components/seo"
|
||||
import axios from "../axios"
|
||||
|
||||
import "../css/base.sass"
|
||||
import "../css/url.sass"
|
||||
import "../css/notifications.sass"
|
||||
|
||||
const AddURLPage = () => {
|
||||
const [url, setURL] = React.useState('')
|
||||
|
||||
const handleKeypress = e => {
|
||||
if (e.charCode === 13 || e.keyCode === 13) {
|
||||
addURL()
|
||||
}
|
||||
}
|
||||
|
||||
const changeURLHandler = event => {
|
||||
const value = event.target.value
|
||||
setURL(value)
|
||||
|
@ -61,7 +67,8 @@ const AddURLPage = () => {
|
|||
className="input"
|
||||
placeholder="URL"
|
||||
value={url}
|
||||
onChange={changeURLHandler} />
|
||||
onChange={changeURLHandler}
|
||||
onKeyPress={handleKeypress} />
|
||||
</div>
|
||||
|
||||
<button
|
||||
|
|
|
@ -1,17 +1,23 @@
|
|||
import React from "react"
|
||||
import AniLink from "gatsby-plugin-transition-link/AniLink"
|
||||
import { NotificationManager, NotificationContainer } from 'react-notifications'
|
||||
import 'react-notifications/lib/notifications.css'
|
||||
import { NotificationManager, NotificationContainer } from "react-notifications"
|
||||
|
||||
import Seo from "../components/seo"
|
||||
import axios from "../axios"
|
||||
|
||||
import "../css/base.sass"
|
||||
import "../css/url.sass"
|
||||
import "../css/notifications.sass"
|
||||
|
||||
const DeleteURLPage = () => {
|
||||
const [url, setURL] = React.useState('')
|
||||
|
||||
const handleKeypress = e => {
|
||||
if (e.charCode === 13 || e.keyCode === 13) {
|
||||
deleteURL()
|
||||
}
|
||||
}
|
||||
|
||||
const changeURLHandler = event => {
|
||||
const value = event.target.value
|
||||
setURL(value)
|
||||
|
@ -63,7 +69,8 @@ const DeleteURLPage = () => {
|
|||
className="input"
|
||||
placeholder="URL"
|
||||
value={url}
|
||||
onChange={changeURLHandler} />
|
||||
onChange={changeURLHandler}
|
||||
onKeyPress={handleKeypress} />
|
||||
</div>
|
||||
|
||||
<button
|
||||
|
|
Loading…
Reference in a new issue