Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve shell component ux #1487

Merged
merged 1 commit into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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