diff --git a/app/components/App.js b/app/components/App.js
index 4d643c9..84e60d9 100644
--- a/app/components/App.js
+++ b/app/components/App.js
@@ -43,7 +43,8 @@ const App = ({ api, widgets, isSyncing }) => {
nextWidgets = widgets
nextWidgets[index] = widgetObject
}
- const cId = (await ipfs.object.put({ Data: Buffer.from(JSON.stringify(nextWidgets)), Links: [] }, { enc: 'json', pin: true })).string
+ const cId = (await ipfs.add(Buffer.from(JSON.stringify(nextWidgets))))[0].hash
+ //const cId = (await ipfs.object.put({ Data: Buffer.from(JSON.stringify(nextWidgets)), Links: [] }, { enc: 'json', pin: true })).string
api.updateContent(cId).toPromise()
setEditWidget(null)
}, [ api, widgets ])
@@ -53,7 +54,7 @@ const App = ({ api, widgets, isSyncing }) => {
}
const handleEditModeSubmit = useCallback(async () => {
- const cId = (await ipfs.object.put({ Data: Buffer.from(JSON.stringify(editedWidgets)), Links: [] }, { enc: 'json', pin: true })).string
+ const cId = (await ipfs.add(Buffer.from(JSON.stringify(editedWidgets))))[0].hash
api.updateContent(cId).toPromise()
setEditMode(false)
}, [ api, editedWidgets, setEditMode ])
diff --git a/app/components/Content/EmptyState.js b/app/components/Content/EmptyState.js
index 8cf27b3..d97ddb0 100644
--- a/app/components/Content/EmptyState.js
+++ b/app/components/Content/EmptyState.js
@@ -31,7 +31,7 @@ const EmptyState = React.memo(({ isSyncing, onActionClick }) => {
grid-template-columns: auto auto;
grid-gap: ${1 * GU}px;
/* Fixed weight to avoid flicker
- resizing when switching from
+ resizing when switching from
text to syncing state */
height: ${10.5 * GU}px;
margin: ${3 * GU}px 0;
@@ -52,8 +52,7 @@ const EmptyState = React.memo(({ isSyncing, onActionClick }) => {
{
const { editMode } = useEditMode()
const label = LABELS[type]
return (
- <>
-
- {label}
- {false && editMode && }
-
-
- >
+
+ {label}
+ {false && editMode && }
+
)
}
@@ -109,7 +105,7 @@ const Widget = ({ id, children, type, onEditMarkdown, ...props }) => {
const onRemove = async id => {
const nextWidgets = widgets.filter(w => w.id !== id)
- const cId = (await ipfs.object.put({ Data: Buffer.from(JSON.stringify(nextWidgets)), Links: [] }, { enc: 'json', pin: true })).string
+ const cId = (await ipfs.add(Buffer.from(JSON.stringify(nextWidgets))))[0].hash
api.updateContent(cId).toPromise()
}
@@ -123,7 +119,7 @@ const Widget = ({ id, children, type, onEditMarkdown, ...props }) => {
height: auto;
justify-content: center;
overflow: hidden;
- padding: ${2.25 * GU}px ${3 * GU}px;
+ padding: ${3 * GU}px;
width: auto;
margin-bottom: ${2 * GU}px;
&.sortable-ghost {
@@ -141,7 +137,7 @@ const Widget = ({ id, children, type, onEditMarkdown, ...props }) => {
css={`
position: absolute;
right: ${3 * GU}px;
- top: ${3* GU}px;
+ top: ${3 * GU}px;
display: flex;
justify-content: flex-start;
`}
@@ -167,7 +163,7 @@ const Widget = ({ id, children, type, onEditMarkdown, ...props }) => {
/>
}
- {(type !== 'MARKDOWN' || editMode) && }
+ {type !== 'MARKDOWN' && }
{React.cloneElement(children, props)}
)
diff --git a/app/components/EditModeButtons.js b/app/components/EditModeButtons.js
index 0ef9fdb..0f32c5c 100644
--- a/app/components/EditModeButtons.js
+++ b/app/components/EditModeButtons.js
@@ -1,14 +1,20 @@
import React from 'react'
import PropTypes from 'prop-types'
-import { Button, GU } from '@aragon/ui'
+import { Button, GU, Help } from '@aragon/ui'
const EditModeButtons = ({ onCancel, onSubmit }) => {
return (
- <>
-
+
+
+ Drag and drop widgets to change the layout.
+
+
- >
+
)
}
@@ -17,4 +23,4 @@ EditModeButtons.propTypes = {
onSubmit: PropTypes.func.isRequired,
}
-export default EditModeButtons
\ No newline at end of file
+export default EditModeButtons
diff --git a/app/components/Panel/Panel.js b/app/components/Panel/Panel.js
index db6b4d3..645a9b4 100644
--- a/app/components/Panel/Panel.js
+++ b/app/components/Panel/Panel.js
@@ -74,7 +74,7 @@ const Panel = ({ onSubmit, editWidget }) => {
// TODO: Refactor into an array filter / find
const needsConfig = getWidgetType(widget) !== 'VOTES' && getWidgetType(widget) !== 'DOT_VOTES' && getWidgetType(widget) !== 'NONE'
- const submitDisabled = widget === undefined || (needsConfig && configData === undefined)
+ const submitDisabled = widget === -1 || (needsConfig && configData === undefined)
// TODO: handle when selecting another widget once configData is set (we should reset on widget change)
diff --git a/app/components/Widget/Votes/Votes.js b/app/components/Widget/Votes/Votes.js
index fea9c0f..8f39982 100644
--- a/app/components/Widget/Votes/Votes.js
+++ b/app/components/Widget/Votes/Votes.js
@@ -39,11 +39,9 @@ const Votes = () => {
-
-
+
(
- #{id}
+ #{id}:
)
@@ -149,13 +147,14 @@ Id.propTypes = {
}
const IdContainer = styled.span`
- ${textStyle('body2')};
+ ${textStyle('body1')};
font-weight: bold;
+ margin-right: ${GU}px;
`
const ADDRESS_REGEX = /0x[a-fA-F0-9]{40}/g
-const Description = ({ text }) => {
+const Description = ({ id, text }) => {
const startIndex = text.search(ADDRESS_REGEX)
const endIndex = startIndex + 42
const beforeAddress = text.substring(0, startIndex)
@@ -168,7 +167,7 @@ const Description = ({ text }) => {
// TODO: separate address entity styling from text!
return (
{
-webkit-line-clamp: 3;
margin: 0 ${.5 * GU}px;
`}>
+
{
startIndex < 1
? text
@@ -200,6 +200,7 @@ const Description = ({ text }) => {
}
Description.propTypes = {
+ id: PropTypes.string.isRequired,
text: PropTypes.string.isRequired,
}
@@ -220,7 +221,7 @@ const Result = ({ yea, nay }) => {
}
return (
-
+
YES {percentageYea}%
diff --git a/app/store/utils/ipfs.js b/app/store/utils/ipfs.js
index a7b7c5d..7492d95 100644
--- a/app/store/utils/ipfs.js
+++ b/app/store/utils/ipfs.js
@@ -17,7 +17,15 @@ export const ipfsGet = async cId => {
}
try {
const { data } = await axios.get(endpoint)
- return data
+ if (typeof data === 'object') return data
+ // If we retrieve a regular IPFS file from the '/object/data' endpoint,
+ // it will contain the array but with some garbage data surrounding it.
+ // So we can extract the relavant string and parse it into JSON
+ const extractedString = data.substring(
+ data.indexOf('['),
+ data.lastIndexOf(']') + 1
+ )
+ return JSON.parse(extractedString)
} catch (err) {
console.error('Error getting data from IPFS', err)
}
diff --git a/manifest.json b/manifest.json
index 28b1896..a455c7d 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,6 +1,6 @@
{
"name": "About",
- "description": "A customizable interface to add interactive widgets with information and insights about your organization.",
+ "description": "A customizable interface to add widgets for your organization's details and insights",
"author": "Autark",
"changelog_url": "https://github.com/AutarkLabs/about/releases",
"source_url": "https://github.com/AutarkLabs/about/tree/master/",
diff --git a/public/meta/screenshot-1.png b/public/meta/screenshot-1.png
index e69de29..ac00119 100644
Binary files a/public/meta/screenshot-1.png and b/public/meta/screenshot-1.png differ
diff --git a/public/meta/screenshot-2.png b/public/meta/screenshot-2.png
index e69de29..02e9dba 100644
Binary files a/public/meta/screenshot-2.png and b/public/meta/screenshot-2.png differ
diff --git a/public/meta/screenshot-3.png b/public/meta/screenshot-3.png
index e69de29..908edf2 100644
Binary files a/public/meta/screenshot-3.png and b/public/meta/screenshot-3.png differ