This repository was archived by the owner on May 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +94
-60
lines changed Expand file tree Collapse file tree 5 files changed +94
-60
lines changed Original file line number Diff line number Diff line change 88import Home from "./views/home"
99import Repo from "./views/Repo"
1010import Deployment from "./views/Deployment"
11- import Settings from "./views/Settings "
11+ import Settings from "./views/settings "
1212import Members from "./views/members"
1313
1414function App ( ) : JSX . Element {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import { shallowEqual } from "react-redux"
2+ import { Button , Descriptions } from "antd"
3+
4+ import { useAppSelector } from "../../redux/hooks"
5+
6+ export default function SlackDescriptions ( ) : JSX . Element {
7+ const { user } = useAppSelector ( state => state . settings , shallowEqual )
8+
9+ const connected = ( user ?. chatUser ) ? true : false
10+
11+ return (
12+ < Descriptions title = "Slack" >
13+ < Descriptions . Item >
14+ { ( connected ) ?
15+ < Button href = "/slack/signout" type = "primary" danger > DISCONNECTED</ Button > :
16+ < Button href = "/slack/" type = "primary" > CONNECT</ Button > }
17+ </ Descriptions . Item >
18+ </ Descriptions >
19+ )
20+ }
Original file line number Diff line number Diff line change 1+ import { shallowEqual } from "react-redux"
2+ import { Tag , Descriptions , Input } from "antd"
3+
4+ import { useAppSelector } from "../../redux/hooks"
5+
6+ export default function UserDescriptions ( ) : JSX . Element {
7+ const { user } = useAppSelector ( state => state . settings , shallowEqual )
8+
9+ return (
10+ < Descriptions
11+ title = "User Info"
12+ column = { 2 }
13+ layout = "vertical"
14+ style = { { marginTop : "40px" } }
15+ >
16+ < Descriptions . Item label = "Login" >
17+ { user ?. login }
18+ </ Descriptions . Item >
19+ < Descriptions . Item label = "Role" >
20+ { ( user ?. admin ) ?
21+ < Tag color = "purple" > Admin</ Tag >
22+ :
23+ < Tag color = "purple" > Member</ Tag > }
24+ </ Descriptions . Item >
25+ < Descriptions . Item label = "Token" >
26+ < Input . Password
27+ value = { user ?. hash }
28+ style = { { width : 200 , padding :0 } }
29+ readOnly
30+ bordered = { false }
31+ />
32+ </ Descriptions . Item >
33+ </ Descriptions >
34+ )
35+ }
Original file line number Diff line number Diff line change 1+ import { useEffect } from "react"
2+ import { shallowEqual } from "react-redux"
3+ import { Helmet } from "react-helmet"
4+
5+ import { useAppSelector , useAppDispatch } from "../../redux/hooks"
6+ import { fetchMe , checkSlack } from "../../redux/settings"
7+
8+ import Main from "../main"
9+ import UserDescription from "./UserDescriptions"
10+ import SlackDescriptions from "./SlackDescriptions"
11+
12+ export default function Settings ( ) : JSX . Element {
13+ const { isSlackEnabled } = useAppSelector ( state => state . settings , shallowEqual )
14+ const dispatch = useAppDispatch ( )
15+
16+ useEffect ( ( ) => {
17+ dispatch ( fetchMe ( ) )
18+ dispatch ( checkSlack ( ) )
19+ } , [ dispatch ] )
20+
21+ return (
22+ < Main >
23+ < Helmet >
24+ < title > Settings</ title >
25+ </ Helmet >
26+ < h1 > Settings</ h1 >
27+ < div >
28+ < UserDescription />
29+ </ div >
30+ { ( isSlackEnabled ) ?
31+ < div style = { { marginTop : "40px" , marginBottom : "20px" } } >
32+ < SlackDescriptions />
33+ </ div >
34+ :
35+ < > </ > }
36+ </ Main >
37+ )
38+ }
You can’t perform that action at this time.
0 commit comments