-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathWebhookEditPage.js
More file actions
33 lines (28 loc) · 1.01 KB
/
WebhookEditPage.js
File metadata and controls
33 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React, { useEffect } from 'react'
import { Card } from 'Components'
import applicationStyle from 'Routes/Apps/Gluu/styles/applicationstyle'
import WebhookForm from './WebhookForm'
import GluuLoader from 'Routes/Apps/Gluu/GluuLoader'
import { useDispatch, useSelector } from 'react-redux'
import {
getFeaturesByWebhookId,
getFeaturesByWebhookIdResponse,
} from 'Plugins/admin/redux/features/WebhookSlice'
import { useParams } from 'react-router'
const WebhookEditPage = () => {
const { id } = useParams()
const dispatch = useDispatch()
const { loading, loadingWebhookFeatures } = useSelector((state) => state.webhookReducer)
useEffect(() => {
if (id) dispatch(getFeaturesByWebhookId(id))
return function cleanup() {
dispatch(getFeaturesByWebhookIdResponse([]))
}
}, [])
return (
<GluuLoader blocking={loading || loadingWebhookFeatures}>
<Card style={applicationStyle.mainCard}>{!loadingWebhookFeatures && <WebhookForm />}</Card>
</GluuLoader>
)
}
export default WebhookEditPage