From be959df8dfe4f3d5f4dafaac7374aacb68edfce7 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Wed, 21 Oct 2020 15:23:36 -0400 Subject: [PATCH] launch: migrate remainder to indigo-react Fixes urbit/landscape#53. --- pkg/interface/src/views/apps/launch/app.js | 21 ++--- .../apps/launch/components/tiles/basic.js | 3 +- .../apps/launch/components/tiles/custom.js | 32 ++++--- .../apps/launch/components/tiles/weather.js | 87 +++++++++++-------- 4 files changed, 80 insertions(+), 63 deletions(-) diff --git a/pkg/interface/src/views/apps/launch/app.js b/pkg/interface/src/views/apps/launch/app.js index f2e09aeebd..090026d45f 100644 --- a/pkg/interface/src/views/apps/launch/app.js +++ b/pkg/interface/src/views/apps/launch/app.js @@ -1,24 +1,21 @@ import React from 'react'; import Helmet from 'react-helmet'; -import { Link } from 'react-router-dom'; import { Box, Row, Icon, Text, Center } from '@tlon/indigo-react'; -import { uxToHex, adjustHex } from "~/logic/lib/util"; +import { uxToHex, adjustHex } from '~/logic/lib/util'; import './css/custom.css'; -import { Sigil } from "~/logic/lib/sigil"; +import { Sigil } from '~/logic/lib/sigil'; import Tiles from './components/tiles'; import Tile from './components/tiles/tile'; import Welcome from './components/welcome'; import Groups from './components/Groups'; export default class LaunchApp extends React.Component { - componentDidMount() { // preload spinner asset new Image().src = '/~landscape/img/Spinner.png'; - } render() { @@ -27,16 +24,15 @@ export default class LaunchApp extends React.Component { const sigilColor = contact?.color ? `#${uxToHex(contact.color)}` : props.dark - ? "#FFFFFF" - : "#000000"; - + ? '#FFFFFF' + : '#000000'; return ( <> OS1 - Home -
+ - + + p={2} + > {props.baseHash} -
+ ); } diff --git a/pkg/interface/src/views/apps/launch/components/tiles/basic.js b/pkg/interface/src/views/apps/launch/components/tiles/basic.js index c15aaa40e0..c511432a81 100644 --- a/pkg/interface/src/views/apps/launch/components/tiles/basic.js +++ b/pkg/interface/src/views/apps/launch/components/tiles/basic.js @@ -1,5 +1,4 @@ import React from 'react'; -import classnames from 'classnames'; import { Text, Icon } from '@tlon/indigo-react'; import Tile from './tile'; @@ -23,7 +22,7 @@ export default class BasicTile extends React.PureComponent { verticalAlign='top' pt='5px' pr='2px' - /> + /> : null }{props.title} diff --git a/pkg/interface/src/views/apps/launch/components/tiles/custom.js b/pkg/interface/src/views/apps/launch/components/tiles/custom.js index 7a5eb4690d..47403b3487 100644 --- a/pkg/interface/src/views/apps/launch/components/tiles/custom.js +++ b/pkg/interface/src/views/apps/launch/components/tiles/custom.js @@ -1,26 +1,30 @@ import React from 'react'; -import classnames from 'classnames'; - +import { Box, BaseImage } from '@tlon/indigo-react'; import Tile from './tile'; export default class CustomTile extends React.PureComponent { - render() { - const { props } = this; - return ( -
- + -
+ src='/~launch/img/UnknownCustomTile.png' + width='48px' + height='48px' + /> +
); } - } diff --git a/pkg/interface/src/views/apps/launch/components/tiles/weather.js b/pkg/interface/src/views/apps/launch/components/tiles/weather.js index 545c780fc0..64140b2711 100644 --- a/pkg/interface/src/views/apps/launch/components/tiles/weather.js +++ b/pkg/interface/src/views/apps/launch/components/tiles/weather.js @@ -1,6 +1,6 @@ import React from 'react'; import moment from 'moment'; -import { Box, Icon, Text } from '@tlon/indigo-react'; +import { Box, Icon, Text, BaseAnchor, BaseInput } from '@tlon/indigo-react'; import Tile from './tile'; @@ -103,14 +103,15 @@ export default class WeatherTile extends React.Component { let secureCheck; let error; if (this.state.error === true) { - error =

Please try again.

; + error = Please try again.; } if (location.protocol === 'https:') { secureCheck = ( - this.locationSubmit()}> + this.locationSubmit()} + > Detect -> - + ); } return this.renderWrapper( @@ -120,32 +121,38 @@ export default class WeatherTile extends React.Component { justifyContent='space-between' height='100%' > - this.setState({ manualEntry: !this.state.manualEntry }) } > <- - + {secureCheck} Please enter your{' '} - latitude and longitude - + . {error} -
- + { @@ -153,15 +160,21 @@ export default class WeatherTile extends React.Component { e.preventDefault(); this.manualLocationSubmit(e.target.value); } - }} /> - + this.manualLocationSubmit()} value="->" /> - + ); } @@ -216,17 +229,17 @@ export default class WeatherTile extends React.Component { alignItems='space-between' > - + Weather - - this.setState({ manualEntry: !this.state.manualEntry }) - } - > - -> - + + this.setState({ manualEntry: !this.state.manualEntry }) + } + > + -> + + Weather -

+ Loading, please check again later... -

- + +
)); } return this.renderNoData();