mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
feat: use safe-touch
This commit is contained in:
parent
5552f98f6c
commit
009af163ec
3 changed files with 10 additions and 3 deletions
|
|
@ -20,7 +20,8 @@
|
|||
"octicons": "^7.1.0",
|
||||
"prop-types": "^15.6.1",
|
||||
"react": "^16.8.1",
|
||||
"react-dom": "^16.8.1"
|
||||
"react-dom": "^16.8.1",
|
||||
"safe-touch": "^0.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chrome": "^0.0.77",
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
import * as React from 'react'
|
||||
import { MetaData } from 'utils/GitHubHelper'
|
||||
import { safeTouch } from 'safe-touch'
|
||||
|
||||
type Props = {
|
||||
metaData: MetaData
|
||||
}
|
||||
|
||||
export default function MetaBar({ metaData }: Props) {
|
||||
const userUrl = metaData ? metaData.api && metaData.api.owner.html_url : undefined
|
||||
const repoUrl = metaData ? metaData.api && metaData.api.html_url : undefined
|
||||
const userUrl = safeTouch(metaData).api.owner.html_url()
|
||||
const repoUrl = safeTouch(metaData).api.html_url()
|
||||
return (
|
||||
<div className={'meta-bar'}>
|
||||
<a className={'username'} href={userUrl}>
|
||||
|
|
|
|||
|
|
@ -6576,6 +6576,11 @@ safe-regex@^1.1.0:
|
|||
dependencies:
|
||||
ret "~0.1.10"
|
||||
|
||||
safe-touch@^0.2.2:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/safe-touch/-/safe-touch-0.2.2.tgz#82d98bdda308a7825282e80b825c789015c96e1d"
|
||||
integrity sha512-PW+KGMF/klqznPIgBPQhBe1bIt4DoKcK7IWJ92oOkFH4hqAIckXlkv+JyFVMJvMgvFFheHI63Q0sOw5uuWJF+w==
|
||||
|
||||
"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||
|
|
|
|||
Loading…
Reference in a new issue