Skip to content

Commit

Permalink
feat: welcome page (#1571)
Browse files Browse the repository at this point in the history
* Make connection icon go to status page, not welcome

* Legacy text fix for no-files state: "Import" button

* Remove WelcomeInfo from blank files screen, update AddFilesInfo

* Remove info-boxes/welcome-info, add its contents to WelcomePage.js

* Move welcomeInfo i18n text into welcome.json

* Remove masonry

* remove duplicate welcome text; configureApiPort gets its own box

* Bullet lists

* Tighten "could not connect" guidance

* Appease draconian linting

* Change connx status icon to red if fail, update text

* Add 'connected' icon

* Add 'not connected' icon

* Consolidate shell examples, will need to wire up show/hide

* Language tweaks, nonworking ApiAddressForm in ConnectionStatus

* Language tweaks, move to-go API dialog to bottom for now

* Rewrite "you can" box copy

* Rewrite "what is IPFS" copy

* Text tweaks and link to awesome-ipfs, thanks @RubenKelevra and #1406

* Update daemon guidance on status page after disconnect

* Standardize box padding

* more box padding

* remove extraneous onClicks

* Draconian linting

* feat: make welcome page shell tababble

* feat: improve api address input location

* Tidy settings page: api in own box, standardize font sizes

* Make shell choices  ttu tracked

* Responsive tweaks for narrow widths

* Responsive display tweak

* Style edit link in status screen, make i18n

* Updates Joyride cues throughout

Co-authored-by: Rafael Ramalho <rafazelramalho19@gmail.com>
  • Loading branch information
jessicaschilling and rafaelramalho19 authored Aug 5, 2020
1 parent fee6744 commit d6ef7fd
Show file tree
Hide file tree
Showing 20 changed files with 303 additions and 218 deletions.
11 changes: 1 addition & 10 deletions public/locales/en/files.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@
"title": "New folder",
"description": "Insert the name of the folder you want to create."
},
"welcomeInfo": {
"header": "Welcome to the IPFS Web UI",
"paragraph1": "<0><0>Check the status</0> of your node, its Peer ID and connection info, the network traffic and the number of connected peers.</0>",
"paragraph2": "<0>Easily manage files in your IPFS repo. Drag and drop here to add files, and you can move, rename, delete, share or download them.</0>",
"paragraph3": "<0>You can <1>explore IPLD data</1> that underpins how IPFS works.</0>",
"paragraph4": "<0>See all of your <1>connected peers</1>, geolocated by their IP address.</0>",
"paragraph5": "<0><0>Review the settings</0> for your IPFS node, and update them to better suit your needs.</0>",
"paragraph6": "<0>If you want to help push the Web UI forward, <1>check out its code</1> or <3>report a bug</3>!</0>"
},
"filesListLabel": "Files list",
"filesList": {
"noFiles": "<0>No files in this directory. Click the “Import” button to add some.</0>"
Expand All @@ -85,7 +76,7 @@
"closeDropdown": "Close dropdown",
"count": "{count} of {count}"
},
"addFilesInfo": "<0>Add files to your local IPFS node by clicking the <1>Add to IPFS</1> button above.</0>",
"addFilesInfo": "<0>No files here yet! Add files to your local IPFS node by clicking the <1>Import</1> button above.</0>",
"companionInfo": "<0>As you are using <1>IPFS Companion</1>, the files view is limited to files added while using the extension.</0>",
"tour": {
"back": "Back",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/en/notify.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"connectingToIpfs": "Connecting to IPFS…",
"connectedToIpfs": "Connected to IPFS!",
"ipfsApiRequestFailed": "IPFS request failed. Please check if your daemon is running.",
"ipfsApiRequestFailed": "Could not connect. Please check if your daemon is running.",
"windowIpfsRequestFailed": "IPFS request failed. Please check your IPFS Companion settings.",
"ipfsIsBack": "Normal IPFS service has resumed. Enjoy!",
"folderExists": "A folder with that name already exists. Please choose another.",
Expand Down
6 changes: 6 additions & 0 deletions public/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"reset": "Reset",
"language": "Language",
"analytics": "Analytics",
"api": "API Address",
"config": "IPFS Config",
"languageModal": {
"title": "Change language",
Expand All @@ -16,6 +17,7 @@
"edit": "Change",
"close": "Close"
},
"apiDescription": "<0>If your node is configured with a <1>custom API address</1>, including a port other than the default 5001, enter it here to update your config file.</0>",
"fetchingSettings": "Fetching settings...",
"configApiNotAvailable": "The IPFS config API is not available. Please disable the \"IPFS Companion\" Web Extension and try again.",
"ipfsDaemonOffline": "The IPFS daemon is offline. Please turn it on and try again.",
Expand Down Expand Up @@ -81,6 +83,10 @@
"paragraph2": "You're able to choose what data you send us and we won't be able to identify you, we value privacy above all else."
},
"step4": {
"title": "Custom API address",
"paragraph1": "If you've configured your IPFS node with a custom API address, you can update your config file right here instead of editing the JSON by hand."
},
"step5": {
"title": "IPFS Config",
"paragraph1": "You can change the config of your IPFS node right from Web UI!",
"paragraph2": "Don't forget to restart the daemon to apply the changes."
Expand Down
13 changes: 7 additions & 6 deletions public/locales/en/status.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"peerId": "Peer ID",
"gateway": "Gateway",
"api": "API",
"apiEdit": "Edit",
"version": "Version",
"advanced": "Advanced",
"publicKey": "Public key",
Expand Down Expand Up @@ -34,9 +35,9 @@
"paragraph2": "{count, plural, one {Discovered <0>1 peer</0>} other {Discovered <0>{peersCount} peers</0>}}"
},
"StatusNotConnected": {
"header1": "Failed to connect to the API",
"paragraph1": "<0>Start an IPFS daemon in a terminal:</0>",
"paragraph2": "<0>For more info on how to get started with IPFS you can <1>read the guide</1>.</0>"
"header1": "Could not connect to the IPFS API",
"paragraph1": "<0>Is your IPFS daemon running? Try starting or restarting it from your terminal:</0>",
"paragraph2": "<0>For more information, check out the installation guide in the <1>IPFS Docs</1>.</0>"
},
"AskToEnable": {
"label": "Help improve this app by sending anonymous usage data.",
Expand All @@ -57,13 +58,13 @@
},
"step2": {
"title": "Connection status",
"paragraph1": "This takes you to a page where you can check if you are connected to an IPFS daemon, and if not, how to connect to one.",
"paragraph2": "You can configure your node with a custom API address, too."
"paragraph1": "Click this icon from anywhere in the app to return to the Status page. If you lose your connection to the IPFS API, the icon will turn red.",
"paragraph2": "If you need to configure a custom API address for your node, just click the \"Edit\" link next to where the API address is listed on this page."
},
"step3": {
"title": "Node info",
"paragraph1": "Here you have information about the size of your repo, how many peers are connected, your peer ID and the IPFS flavour that's currently in use.",
"paragraph2": "<0>Click on <1>Advanced</1> to see more info such as the gateway URL and addresses.</0>"
"paragraph2": "<0>Expand the <1>Advanced</1> link to see more info, such as the gateway URL and addresses. There's also a link inside the Advanced section to change your API address.</0>"
},
"step4": {
"title": "Network bandwidth/traffic",
Expand Down
45 changes: 29 additions & 16 deletions public/locales/en/welcome.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@
{
"title": "Welcome | IPFS",
"description": "Welcome Page",
"configureApiPort": {
"header": "Is your API on a port other than 5001?",
"paragraph1": "<0>If your IPFS node is configured with a <1>custom API address</1>, please set it here.</0>"
},
"apiAddressForm": {
"apiLabel": "API ADDRESS",
"submitButton": "Submit"
},
"connected": {
"header": "Connected to IPFS",
"paragraph1": "<0>Now, it’s time for you to explore your node. Head to <1>Files page</1> to manage and share your files, or explore the <3>Merkle Forest</3> of peer-hosted hash-linked data via <5>IPLD explorer</5>.</0>",
"paragraph2": "<0>You can always come back to this address to change the IPFS node you're connected to.</0>"
"paragraph1": "Welcome to the revolution! You are now a valuable part of the distributed web."
},
"notConnected": {
"header": "Is your IPFS daemon running?",
"paragraph1": "<0>Failed to connect to the API.</0>",
"paragraph2": "<0>Make sure you <1>configure your IPFS API</1> to allow cross-origin (CORS) requests, running the commands below:</0>",
"paragraph3": "<0>Start an IPFS daemon in a terminal:</0>",
"paragraph4": "<0>For more info on how to get started with IPFS you can <1>read the guide</1>.</0>"
"header": "Could not connect to the IPFS API",
"paragraph1": "<0>Check out the installation guide in the <1>IPFS Docs</1>, or try these common fixes:</0>",
"paragraph2": "<0>Is your IPFS daemon running? Try starting or restarting it from your terminal:</0>",
"paragraph3": "<0>Is your IPFS API configured to allow <1>cross-origin (CORS) requests</1>? If not, run these commands and then start your daemon from the terminal:</0>",
"paragraph4": "<0>Is your IPFS API on a port other than 5001? If your node is configured with a <1>custom API address</1>, enter it here to update your config file.</0>"
},
"aboutIpfs": {
"header": "What is IPFS?",
"paragraph1": "<0><0>IPFS is a protocol</0> that defines a content-addressed file system, coordinates content delivery and combines ideas from Kademlia, BitTorrent, Git and more.</0>",
"paragraph2": "<0><0>IPFS is a filesystem.</0> It has directories and files and mountable filesystem via FUSE.</0>",
"paragraph3": "<0><0>IPFS is a web.</0> Files are accessible via HTTP gateways like <2>https://ipfs.io</2>. Browsers <4>can be extended</4> to use the <6>ipfs://</6> scheme directly, and hash-addressed content guarantees authenticity.</0>",
"paragraph4": "<0><0>IPFS is p2p.</0> It supports worldwide peer-to-peer file transfers with a completely decentralized architecture and no central point of failure.</0>",
"paragraph5": "<0><0>IPFS is a CDN.</0> Add a file to your local repository, and it's now available to the world with cache-friendly content-hash addressing and BitTorrent-like bandwidth distribution.</0>"
"paragraph1": "<0><0>A hypermedia distribution protocol</0> that incorporates ideas from Kademlia, BitTorrent, Git, and more</0>",
"paragraph2": "<0><0>A peer-to-peer file transfer network</0> with a completely decentralized architecture and no central point of failure, censorship, or control</0>",
"paragraph3": "<0><0>An on-ramp to tomorrow's web</0> — traditional browsers can access IPFS files through gateways like <2>https://ipfs.io</2> or directly using the <4>IPFS Companion</4> extension</0>",
"paragraph4": "<0><0>A next-gen CDN</0> — just add a file to your node to make it available to the world with cache-friendly content-hash addressing and BitTorrent-style bandwidth distribution</0>",
"paragraph5": "<0><0>A developer toolset</0> for building <2>completely distributed apps and services</2>, backed by a robust open-source community</0>"
},
"welcomeInfo": {
"header": "In this app, you can …",
"paragraph1": "<0><0>Check your node status</0>, including how many peers you're connected to, your storage and bandwidth stats, and more</0>",
"paragraph2": "<0><0>View and manage files</0> in your IPFS repo, including drag-and-drop file import, easy pinning, and quick sharing and download options</0>",
"paragraph3": "<0><0>Visit the \"Merkle Forest\"</0> with some sample datasets and explore IPLD, the data model that underpins how IPFS works</0>",
"paragraph4": "<0><0>See who's connected to your node</0>, geolocated on a world map by their IP address</0>",
"paragraph5": "<0><0>Review or edit your node settings</0> — no command line required</0>",
"paragraph6": "<0><0>Check this app's source code</0> to <2>report a bug</2> or make a contribution, and make IPFS better for everyone!</0>"
},
"tour": {
"close": "Close",
"step1": {
"title": "Welcome page",
"paragraph1": "This page lets you know if you're connected to IPFS, and offers ideas for things you can do in this app.",
"paragraph2": "If you aren't connected to the IPFS API, this page also appears in place of some other pages, with hints for how to get connected.",
"paragraph3": "You can visit this page from anywhere in the app by clicking the IPFS cube logo in the navigation bar."
}
}
}
3 changes: 2 additions & 1 deletion src/bundles/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ export default createRouteBundle({
'/ipns*': FilesPage,
'/pins*': FilesPage,
'/peers': PeersPage,
'/settings': SettingsPage,
'/settings/analytics': AnalyticsPage,
'/settings*': SettingsPage,
'/welcome': WelcomePage,
'/blank': BlankPage,
'/status*': StatusPage,
'/': StatusPage,
'': StatusPage
}, { routeInfoSelector: 'selectHash' })
34 changes: 18 additions & 16 deletions src/components/about-ipfs/AboutIpfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ import Box from '../box/Box'
export const AboutIpfs = ({ t }) => {
return (
<Box>
<h1 className='mt0 mb3 montserrat fw4 f4 charcoal'>{t('aboutIpfs.header')}</h1>
<Trans i18nKey='aboutIpfs.paragraph1' t={t}>
<p className='mt0'><strong>IPFS is a protocol</strong> that defines a content-addressed file system, coordinates content delivery and combines ideas from Kademlia, BitTorrent, Git and more.</p>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph2' t={t}>
<p><strong>IPFS is a filesystem.</strong> It has directories and files and mountable filesystem via FUSE.</p>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph3' t={t}>
<p><strong>IPFS is a web.</strong> Files are accessible via HTTP gateways like <code className='f7'>https://ipfs.io</code>. Browsers <a className='link blue' target='_blank' rel='noopener noreferrer' href='https://github.com/ipfs-shipyard/ipfs-companion#release-channel'>can be extended</a> to use the <code className='f7'>ipfs://</code> scheme directly, and hash-addressed content guarantees authenticity</p>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph4' t={t}>
<p><strong>IPFS is p2p.</strong> It supports worldwide peer-to-peer file transfers with a completely decentralized architecture and no central point of failure.</p>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph5' t={t}>
<p><strong>IPFS is a CDN.</strong> Add a file to your local repository, and it's now available to the world with cache-friendly content-hash addressing and bittorrent-like bandwidth distribution.</p>
</Trans>
<h1 className='mt0 mb3 montserrat fw2 f3 charcoal'>{t('aboutIpfs.header')}</h1>
<ul className='pl3'>
<Trans i18nKey='aboutIpfs.paragraph1' t={t}>
<li className='mb2'><strong>A hypermedia distribution protocol</strong> that incorporates ideas from Kademlia, BitTorrent, Git, and more</li>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph2' t={t}>
<li className='mb2'><strong>A peer-to-peer file transfer network</strong> with a completely decentralized architecture and no central point of failure, censorship, or control</li>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph3' t={t}>
<li className='mb2'><strong>An on-ramp to tomorrow's web</strong> &mdash; traditional browsers can access IPFS files through gateways like <code className='f5 bg-light-gray br2 pa1'>https://ipfs.io</code> or directly using the <a className='link blue' target='_blank' rel='noopener noreferrer' href='https://github.com/ipfs-shipyard/ipfs-companion#ipfs-companion'>IFPS Companion</a> extension</li>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph4' t={t}>
<li className='mb2'><strong>A next-gen CDN</strong> &mdash; just add a file to your node to make it available to the world with cache-friendly content-hash addressing and BitTorrent-style bandwidth distribution</li>
</Trans>
<Trans i18nKey='aboutIpfs.paragraph5' t={t}>
<li className='mb2'><strong>A developer toolset</strong> for building completely <a className='link blue' target='_blank' rel='noopener noreferrer' href='https://awesome.ipfs.io/'>distributed apps and services</a>, backed by a robust open-source community</li>
</Trans>
</ul>
</Box>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/analytics-toggle/AnalyticsToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const AnalyticsToggle = ({ analyticsActionsToRecord, analyticsConsent, doToggleC
return (
<React.Fragment>
<Checkbox className='dib' onChange={doToggleAnalytics} checked={analyticsEnabled} label={
<span className='fw5 f6'>
<span className='f5'>
{t('AnalyticsToggle.label')}
</span>
} />
Expand Down
41 changes: 41 additions & 0 deletions src/components/api-address-form/ApiAddressForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React, { useState } from 'react'
import { connect } from 'redux-bundler-react'
import { withTranslation } from 'react-i18next'
import Button from '../button/Button'

const ApiAddressForm = ({ t, doUpdateIpfsApiAddress, ipfsApiAddress = '' }) => {
const [value, setValue] = useState(ipfsApiAddress)

const onChange = (event) => setValue(event.target.value)

const onSubmit = async (event) => {
event.preventDefault()
doUpdateIpfsApiAddress(value)
}

const onKeyPress = (event) => {
if (event.key === 'Enter') {
onSubmit(event)
}
}
return (
<form onSubmit={onSubmit}>
<label htmlFor='api-address' className='db f7 mb2 ttu tracked charcoal pl1'>{t('apiAddressForm.apiLabel')}</label>
<input id='api-address'
type='text'
className='w-100 lh-copy monospace f5 pl1 pv1 mb2 charcoal input-reset ba b--black-20 br1 focus-outline'
onChange={onChange}
onKeyPress={onKeyPress}
value={value} />
<div className='tr'>
<Button className="tc">{t('apiAddressForm.submitButton')}</Button>
</div>
</form>
)
}

export default connect(
'doUpdateIpfsApiAddress',
'selectIpfsApiAddress',
withTranslation('welcome')(ApiAddressForm)
)
4 changes: 2 additions & 2 deletions src/components/connected/Connected.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { withTranslation } from 'react-i18next'

const pickColor = (ipfsReady, ipfsConnected) => {
if (ipfsReady && ipfsConnected) return 'teal'
if (ipfsReady) return 'yellow'
if (ipfsReady) return 'red'
return 'gray'
}

Expand All @@ -20,7 +20,7 @@ export const Connected = ({ t, ipfsReady, ipfsConnected, className, size = 28 })
const opacity = ipfsConnected ? 'o-60' : 'o-100'

return (
<a title={title} className={`dib ${className}`} href='#/welcome'>
<a title={title} className={`dib ${className}`} href='#/status?fromConnected=1'>
<svg className={`${fill} ${opacity} fill-current-color transition-all glow`} viewBox='0 0 24 24' width={size} height={size} aria-hidden="true">
<path d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM6.5 9L10 5.5 13.5 9H11v4H9V9H6.5zm11 6L14 18.5 10.5 15H13v-4h2v4h2.5z ' />
</svg>
Expand Down
2 changes: 1 addition & 1 deletion src/components/language-selector/LanguageSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LanguageSelector extends Component {
return (
<Fragment>
<div className='flex'>
<div className='ph4 flex items-center bg-white lh-copy charcoal f6 fw5' style={{ height: 40 }}>
<div className='ph4 flex items-center bg-white lh-copy charcoal f5 fw5' style={{ height: 40 }}>
{getCurrentLanguage()}
</div>
<Button className="tc" minWidth={100} onClick={this.onLanguageEditOpen}>
Expand Down
2 changes: 0 additions & 2 deletions src/files/info-boxes/InfoBoxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import React from 'react'
import PropTypes from 'prop-types'
import CompanionInfo from './companion-info/CompanionInfo'
import AddFilesInfo from './add-files-info/AddFilesInfo'
import WelcomeInfo from './welcome-info/WelcomeInfo'

const InfoBoxes = ({ isRoot, isCompanion, filesExist }) => (
<div>
{ isRoot && isCompanion && <CompanionInfo /> }
{ isRoot && !filesExist && !isCompanion && <AddFilesInfo /> }
{ isRoot && !filesExist && <WelcomeInfo /> }
</div>
)

Expand Down
2 changes: 1 addition & 1 deletion src/files/info-boxes/add-files-info/AddFilesInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const AddFilesInfo = ({ t }) => (
<div className='mv4 tc navy f5' >
<Box style={{ background: 'rgba(105, 196, 205, 0.1)' }}>
<Trans i18nKey='addFilesInfo' t={t}>
<p className='ma0'>Add files to your local IPFS node by clicking the <strong>Add to IPFS</strong> button above.</p>
<p className='ma0'>No files here yet! Add files to your local IPFS node by clicking the <strong>Import</strong> button above.</p>
</Trans>
</Box>
</div>
Expand Down
Loading

0 comments on commit d6ef7fd

Please sign in to comment.