| 24 | import styles from "./index.module.scss" |
| 25 | |
| 26 | export default function IndexOptions() { |
| 27 | const csdnRef = useRef<any>() |
| 28 | const zhihuRef = useRef<any>() |
| 29 | const baiduRef = useRef<any>() |
| 30 | const juejinRef = useRef<any>() |
| 31 | const oschinaRef = useRef<any>() |
| 32 | const jianshuRef = useRef<any>() |
| 33 | const jb51Ref = useRef<any>() |
| 34 | const cnblogsRef = useRef<any>() |
| 35 | const cto51Ref = useRef<any>() |
| 36 | const phpRef = useRef<any>() |
| 37 | const segmentfaultRef = useRef<any>() |
| 38 | const weixinRef = useRef<any>() |
| 39 | const customRef = useRef<any>() |
| 40 | const appRef = useRef<any>() |
| 41 | |
| 42 | function handleReset() { |
| 43 | if (confirm("确认重置配置?")) { |
| 44 | csdnRef.current && csdnRef.current.handleReset() |
| 45 | zhihuRef.current && zhihuRef.current.handleReset() |
| 46 | baiduRef.current && baiduRef.current.handleReset() |
| 47 | jianshuRef.current && jianshuRef.current.handleReset() |
| 48 | jb51Ref.current && jb51Ref.current.handleReset() |
| 49 | cnblogsRef.current && cnblogsRef.current.handleReset() |
| 50 | cto51Ref.current && cto51Ref.current.handleReset() |
| 51 | phpRef.current && phpRef.current.handleReset() |
| 52 | appRef.current && appRef.current.handleReset() |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | return ( |
| 57 | <ThemeProvider> |
| 58 | <div className={`App ${styles.options}`}> |
| 59 | <div className="App-header"> |
| 60 | <h2 className="title">CodeBox 🎉</h2> |
| 61 | <p className="desc">{i18n("popupDescription")}</p> |
| 62 | </div> |
| 63 | <div className="App-body"> |
| 64 | <Csdn forwardRef={csdnRef} /> |
| 65 | <Zhihu forwardRef={zhihuRef} /> |
| 66 | <Baidu forwardRef={baiduRef} /> |
| 67 | <Jianshu forwardRef={jianshuRef} /> |
| 68 | <Jb51 forwardRef={jb51Ref} /> |
| 69 | <Cnblogs forwardRef={cnblogsRef} /> |
| 70 | <Cto51 forwardRef={cto51Ref} /> |
| 71 | <Juejin /> |
| 72 | <Php forwardRef={phpRef} /> |
| 73 | <Oschina /> |
| 74 | <Segmentfault /> |
| 75 | <Weixin /> |
| 76 | <Medium /> |
| 77 | <Custom /> |
| 78 | <Config forwardRef={appRef} /> |
| 79 | </div> |
| 80 | <div className="App-link"> |
| 81 | <div className="item"> |
| 82 | {i18n("version")}:{chrome.runtime.getManifest().version} |
| 83 | </div> |