Browse Source

Merge pull request #692 from meriadec/polishes-and-refacto

Polishes and refacto
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
6a9902e802
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/components/EnsureDeviceApp.js
  2. 2
      src/components/base/Box/Box.js
  3. 2
      src/components/base/SideBar/SideBarListItem.js
  4. 5
      src/icons/Home.js
  5. 16
      src/logger.js

2
src/components/EnsureDeviceApp/index.js → src/components/EnsureDeviceApp.js

@ -36,7 +36,7 @@ type OwnProps = {
deviceSelected: ?Device,
deviceStatus: DeviceStatus,
error: ?Error,
}) => React$Element<*>,
}) => React$Node,
}
type Props = OwnProps & {

2
src/components/base/Box/Box.js

@ -17,6 +17,7 @@ import {
import fontFamily from 'styles/styled/fontFamily'
export const styledTextAlign = style({ prop: 'textAlign', cssProperty: 'textAlign' })
export const styledOverflow = style({ prop: 'overflow', cssProperty: 'overflow' })
export const styledCursor = style({ prop: 'cursor', cssProperty: 'cursor' })
export const styledTextTransform = style({ prop: 'textTransform', cssProperty: 'textTransform' })
@ -34,6 +35,7 @@ export default styled.div`
${styledTextAlign};
${styledCursor};
${styledTextTransform};
${styledOverflow};
display: flex;
flex-shrink: ${p => (p.noShrink === true ? '0' : p.shrink === true ? '1' : '')};

2
src/components/base/SideBar/SideBarListItem.js

@ -6,7 +6,7 @@ import styled from 'styled-components'
import Box, { Tabbable } from 'components/base/Box'
export type Props = {
label: string | (Props => React$Element<any>),
label: string | (Props => React$Node),
desc?: Props => any, // TODO: type should be more precise, but, eh ¯\_(ツ)_/¯
icon?: any, // TODO: type should be more precise, but, eh ¯\_(ツ)_/¯
disabled?: boolean,

5
src/icons/Home.js

@ -3,7 +3,10 @@
import React from 'react'
const path = (
<path d="m8.261 2.252a1.11 1.11 0 0 0-1.408 0l-6.772 5.545a0.224 0.224 0 0 0-0.03 0.313l0.563 0.69a0.224 0.224 0 0 0 0.314 0.03l0.408-0.333v5.502c0 0.245 0.2 0.445 0.445 0.445h4.667c0.122 0 0.222-0.1 0.222-0.222v-3.556h1.778v3.556c0 0.122 0.1 0.222 0.222 0.222h4.666c0.245 0 0.445-0.2 0.445-0.445v-5.505l0.408 0.333a0.224 0.224 0 0 0 0.314-0.03l0.564-0.69a0.227 0.227 0 0 0-0.036-0.31l-6.771-5.545zm4.184 10.858h-2.667v-3.555c0-0.122-0.1-0.222-0.222-0.222h-4c-0.122 0-0.222 0.1-0.222 0.222v3.555h-2.667v-5.708l4.747-3.889c0.08-0.066 0.2-0.066 0.28 0l4.748 3.89v5.707z" />
<path
fill="currentColor"
d="m8.261 2.252a1.11 1.11 0 0 0-1.408 0l-6.772 5.545a0.224 0.224 0 0 0-0.03 0.313l0.563 0.69a0.224 0.224 0 0 0 0.314 0.03l0.408-0.333v5.502c0 0.245 0.2 0.445 0.445 0.445h4.667c0.122 0 0.222-0.1 0.222-0.222v-3.556h1.778v3.556c0 0.122 0.1 0.222 0.222 0.222h4.666c0.245 0 0.445-0.2 0.445-0.445v-5.505l0.408 0.333a0.224 0.224 0 0 0 0.314-0.03l0.564-0.69a0.227 0.227 0 0 0-0.036-0.31l-6.771-5.545zm4.184 10.858h-2.667v-3.555c0-0.122-0.1-0.222-0.222-0.222h-4c-0.122 0-0.222 0.1-0.222 0.222v3.555h-2.667v-5.708l4.747-3.889c0.08-0.066 0.2-0.066 0.28 0l4.748 3.89v5.707z"
/>
)
export default ({ size, ...p }: { size: number }) => (

16
src/logger.js

@ -148,14 +148,16 @@ export default {
critical: (error: Error) => {
addLog('critical', error)
console.error(error)
try {
if (typeof window !== 'undefined') {
require('sentry/browser').captureException(error)
} else {
require('sentry/node').captureException(error)
if (!process.env.STORYBOOK_ENV) {
try {
if (typeof window !== 'undefined') {
require('sentry/browser').captureException(error)
} else {
require('sentry/node').captureException(error)
}
} catch (e) {
console.warn("Can't send to sentry", error, e)
}
} catch (e) {
console.warn("Can't send to sentry", error, e)
}
},

Loading…
Cancel
Save