mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
style fixes
This commit is contained in:
parent
37d2f19c1b
commit
165e4acd9d
@ -12,6 +12,7 @@
|
|||||||
"format": "npm run format:js && npm run format:css",
|
"format": "npm run format:js && npm run format:css",
|
||||||
"lint:css": "stylelint './src/**/*.{css,scss}'",
|
"lint:css": "stylelint './src/**/*.{css,scss}'",
|
||||||
"lint:js": "eslint --ignore-path .gitignore --ignore-path .prettierignore --ext .ts,.tsx .",
|
"lint:js": "eslint --ignore-path .gitignore --ignore-path .prettierignore --ext .ts,.tsx .",
|
||||||
|
"lint:fix": "eslint --fix --ignore-path .gitignore --ignore-path .prettierignore --ext .ts,.tsx .",
|
||||||
"lint": "npm run lint:js && npm run lint:css"
|
"lint": "npm run lint:js && npm run lint:css"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -7,8 +7,11 @@ const Item = ({ item, removeItem }: { item: any; removeItem: any }) => (
|
|||||||
<a href={item.url}>{item.url}</a>
|
<a href={item.url}>{item.url}</a>
|
||||||
<div className={styles.details}>
|
<div className={styles.details}>
|
||||||
<span>url: {item.found ? 'confirmed' : 'unconfirmed'}</span>
|
<span>url: {item.found ? 'confirmed' : 'unconfirmed'}</span>
|
||||||
<span>size: { item.found && item.size ? filesize(item.size) : 'unknown'}</span>
|
<span>
|
||||||
<span>type: { item.found && item.type ? item.type : 'unknown'}</span>
|
size:
|
||||||
|
{item.found && item.size ? filesize(item.size) : 'unknown'}
|
||||||
|
</span>
|
||||||
|
<span>type: {item.found && item.type ? item.type : 'unknown'}</span>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
@ -6,11 +6,7 @@ import ItemForm from './ItemForm'
|
|||||||
import Item from './Item'
|
import Item from './Item'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
import {
|
import { serviceHost, servicePort, serviceScheme } from '../../../config'
|
||||||
serviceHost,
|
|
||||||
servicePort,
|
|
||||||
serviceScheme
|
|
||||||
} from '../../../config'
|
|
||||||
|
|
||||||
interface FilesProps {
|
interface FilesProps {
|
||||||
files: any[]
|
files: any[]
|
||||||
@ -26,7 +22,7 @@ interface FilesStates {
|
|||||||
|
|
||||||
export default class Files extends PureComponent<FilesProps, FilesStates> {
|
export default class Files extends PureComponent<FilesProps, FilesStates> {
|
||||||
public state: FilesStates = {
|
public state: FilesStates = {
|
||||||
isFormShown: false,
|
isFormShown: false
|
||||||
}
|
}
|
||||||
|
|
||||||
public toggleForm = (e: Event) => {
|
public toggleForm = (e: Event) => {
|
||||||
@ -39,13 +35,16 @@ export default class Files extends PureComponent<FilesProps, FilesStates> {
|
|||||||
let res: any
|
let res: any
|
||||||
let file: any = { url: value, found: false }
|
let file: any = { url: value, found: false }
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${serviceScheme}://${serviceHost}:${servicePort}/api/v1/urlcheck`, {
|
const response = await fetch(
|
||||||
method: 'POST',
|
`${serviceScheme}://${serviceHost}:${servicePort}/api/v1/urlcheck`,
|
||||||
body: JSON.stringify({url: value}),
|
{
|
||||||
headers:{
|
method: 'POST',
|
||||||
'Content-Type': 'application/json'
|
body: JSON.stringify({ url: value }),
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
)
|
||||||
res = await response.json()
|
res = await response.json()
|
||||||
file.size = res.result.contentLength
|
file.size = res.result.contentLength
|
||||||
file.type = res.result.contentType
|
file.type = res.result.contentType
|
||||||
|
Loading…
x
Reference in New Issue
Block a user