feat: update rapper instal modal

pull/103/head
bigfengyu 5 years ago
parent 5973221c79
commit 3a2e570ceb

@ -20,11 +20,11 @@ type RapperType = 'normal' | 'redux'
const codeTmpl = ({ projectId, token, rapperType, rapperPath }: {
projectId: number
token: string
token?: string
rapperType: RapperType
rapperPath: string
}) => {
const apiUrl = `${config.serve}/repository/get?id=${projectId}&token=${token}`
const apiUrl = `${config.serve}/repository/get?id=${projectId}${token ? `&token=${token}` : ''}`
const rapUrl = window.location.origin
return String.raw`"rapper": "rapper --type ${rapperType} --rapperPath \"${rapperPath}\" --apiUrl \"${apiUrl}\" --rapUrl \"${rapUrl}\""`
}
@ -35,6 +35,11 @@ const useReadmeStyles = makeStyles({
fontSize: 16,
},
},
badge: {
display: 'flex',
justifyContent: 'center',
alignItems: 'center'
},
})
function Readme() {
@ -42,15 +47,32 @@ function Readme() {
return (
<div className={classes.root}>
<p style={{ textAlign: 'center' }}>
<div style={{ textAlign: 'center' }}>
<a href="https://github.com/thx/rapper" target="_blank" rel="noopener noreferrer">
<img src="https://img.alicdn.com/tfs/TB1SlW9lQT2gK0jSZPcXXcKkpXa-1138-220.png" alt="Logo" width="250" />
<img
src="https://img.alicdn.com/tfs/TB1SlW9lQT2gK0jSZPcXXcKkpXa-1138-220.png"
alt="Logo"
width="250"
/>
</a>
<h3></h3>
<p>
<a href="https://www.yuque.com/rap/rapper/readme" target="_blank" rel="noopener noreferrer"></a>
</p>
</p>
<div className={classes.badge}>
<iframe
src="https://ghbtns.com/github-btn.html?user=thx&repo=rapper&type=star&count=true"
scrolling="0"
frameBorder="0"
width="100px"
height="20px"
/>
<a
href="https://www.yuque.com/rap/rapper/readme"
target="_blank"
rel="noopener noreferrer"
>
</a>
</div>
</div>
<h2>Rapper </h2>
<p>Rapper TypeScript </p>
@ -59,10 +81,19 @@ function Readme() {
<li>/</li>
<li> React/Redux hooks 使</li>
</ul>
<p><a href="https://www.yuque.com/rap/rapper/readme" target="_blank" rel="noopener noreferrer"></a></p>
<p>
<a href="https://www.yuque.com/rap/rapper/readme" target="_blank" rel="noopener noreferrer">
</a>
</p>
<p>使21912534</p>
{/* <div style={{ textAlign: 'center' }}> */}
<img src="https://img.alicdn.com/tfs/TB1mLzfnF67gK0jSZPfXXahhFXa-828-1068.png" alt="dingtalk" width="200" />
<img
src="https://img.alicdn.com/tfs/TB1mLzfnF67gK0jSZPfXXahhFXa-828-1068.png"
alt="dingtalk"
width="200"
/>
{/* </div> */}
<h2></h2>
</div>
@ -172,8 +203,8 @@ function RapperInstallerModal({
onChange={(event) => setRapperPath(event.target.value)}
/>
</div>
<p className={classes.step}>1. rapper </p>
<pre>npm install rap</pre>
<p className={classes.step}>1. rapper </p>
<pre>npm install rap --save</pre>
<p className={classes.step}>2. package.json scripts </p>
<pre>
{codeTmpl({ projectId: repository.id, token: repository.token, rapperType, rapperPath })}

Loading…
Cancel
Save