Skip to content

Commit

Permalink
fix: improve shell component ux (#1487)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelramalho19 authored May 7, 2020
1 parent 28c7b0c commit eac930e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions src/components/shell/Shell.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react'
import classNames from 'classnames'

const Shell = ({
title = 'Shell',
children
children,
className
}) => {
return (
<div className='mw6 br1 overflow-hidden'>
<div className='f7 mb0 sans-serif ttu tracked charcoal pv1 pl2 bg-black-20'>Shell</div>
<div className={classNames('br1 overflow-hidden', className)}>
<div className='f7 mb0 sans-serif ttu tracked charcoal pv1 pl2 bg-black-20'>{ title }</div>
<div className='bg-black-70 snow pa2 f7 lh-copy monospace nowrap overflow-x-auto'>
{children}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/status/BandwidthStatsDisabled.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const StatusNotConnected = ({ t }) => {
</Trans>
</p>

<Shell>
<code className='db'>$ ipfs config --json Swarm.DisableBandwidthMetrics false</code>
<Shell className='mw6'>
<code className='db'><b className='no-select'>$ </b>ipfs config --json Swarm.DisableBandwidthMetrics false</code>
</Shell>
</Box>
)
Expand Down
4 changes: 2 additions & 2 deletions src/status/StatusNotConnected.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const StatusNotConnected = () => {
<Trans i18nKey='StatusNotConnected.paragraph1'>
<p className='mv3 lh-copy sans-serif'>Start an IPFS daemon in a terminal:</p>
</Trans>
<Shell>
<code className='db'>$ ipfs daemon</code>
<Shell className='mw6'>
<code className='db'><b className='no-select'>$ </b>ipfs daemon</code>
<code className='db'>Initializing daemon...</code>
<code className='db'>API server listening on /ip4/127.0.0.1/tcp/5001</code>
</Shell>
Expand Down
6 changes: 3 additions & 3 deletions src/welcome/WelcomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ const ConnectionStatus = ({ t, connected, sameOrigin }) => {
<p>Make sure you <a className='link blue' href='https://github.com/ipfs-shipyard/ipfs-webui#configure-ipfs-api-cors-headers'>configure your IPFS API</a> to allow cross-origin (CORS) requests, running the commands below:</p>
</Trans>
<Shell>
<code className='db'>$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '[{addOrigin && `"${origin}", `}"{defaultDomains.join('", "')}"]'</code>
<code className='db'>$ ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'</code>
<code className='db'><b className='no-select'>$ </b>ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '[{addOrigin && `"${origin}", `}"{defaultDomains.join('", "')}"]'</code>
<code className='db'><b className='no-select'>$ </b>ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'</code>
</Shell>
</div>
)}
<Trans i18nKey='notConnected.paragraph3'>
<p>Start an IPFS daemon in a terminal:</p>
</Trans>
<Shell>
<code className='db'>$ ipfs daemon</code>
<code className='db'><b className='no-select'>$ </b>ipfs daemon</code>
<code className='db'>Initializing daemon...</code>
<code className='db'>API server listening on /ip4/127.0.0.1/tcp/5001</code>
</Shell>
Expand Down

0 comments on commit eac930e

Please sign in to comment.